Skip to content

Commit a4913ee

Browse files
committed
Refactor code graph commands and enhance architecture documentation
- Updated `run.sh` script to use new command syntax for querying symbols. - Added an Architecture Overview document outlining module boundaries, interfaces, and key classes. - Modified CLI program to support new edge-kind parameter in query requests. - Enhanced `CodeGraphIndexer` to handle `.slnx` files and improved node management. - Updated `QueryRequest` to include edge-kind and incremented schema version. - Adjusted LiteGraphStore SQL queries to filter by edge-kind and document. - Created a new MCP server for JSON-RPC requests handling. - Updated SkillInstaller to include graph-related commands and options. - Added integration tests for type and member references in the code graph. - Cleaned up project references and package versions across multiple projects.
1 parent 2ad28f6 commit a4913ee

File tree

29 files changed

+1364
-53
lines changed

29 files changed

+1364
-53
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: build-and-test
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
push:
7+
branches: [ main ]
8+
9+
env:
10+
DOTNET_VERSION: '10.0.x'
11+
12+
jobs:
13+
build-and-test:
14+
name: build-and-test
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v5
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: ${{ env.DOTNET_VERSION }}
25+
26+
- name: Restore dependencies
27+
run: dotnet restore RagSharp.slnx
28+
29+
- name: Build
30+
run: dotnet build RagSharp.slnx --configuration Release --no-restore
31+
32+
- name: Test
33+
run: dotnet test RagSharp.slnx --configuration Release --no-build --verbosity normal

.github/workflows/docs.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- README.md
8+
- docs/**
9+
- .github/workflows/docs.yml
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: pages
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5
27+
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v5
30+
with:
31+
enablement: true
32+
33+
- name: Build static docs
34+
run: |
35+
set -euo pipefail
36+
mkdir -p _site
37+
cp -R docs _site/docs
38+
cp README.md _site/index.md
39+
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v4
42+
with:
43+
path: ./_site
44+
45+
deploy:
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: github-pages
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
env:
9+
DOTNET_VERSION: '10.0.x'
10+
11+
jobs:
12+
build:
13+
name: Build and Test
14+
runs-on: ubuntu-latest
15+
16+
outputs:
17+
version: ${{ steps.version.outputs.version }}
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
23+
- name: Setup .NET
24+
uses: actions/setup-dotnet@v4
25+
with:
26+
dotnet-version: ${{ env.DOTNET_VERSION }}
27+
28+
- name: Extract version from RagSharp.Packaging.csproj
29+
id: version
30+
run: |
31+
VERSION=$(grep -oPm1 "(?<=<Version>)[^<]+" src/RagSharp.Packaging/RagSharp.Packaging.csproj)
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
echo "Version from RagSharp.Packaging.csproj: $VERSION"
34+
35+
- name: Restore dependencies
36+
run: dotnet restore RagSharp.slnx
37+
38+
- name: Build
39+
run: dotnet build RagSharp.slnx --configuration Release --no-restore
40+
41+
- name: Test
42+
run: dotnet test RagSharp.slnx --configuration Release --no-build --verbosity normal
43+
44+
- name: Pack NuGet packages
45+
run: dotnet pack src/RagSharp.Packaging/RagSharp.Packaging.csproj --configuration Release --no-build -p:IncludeSymbols=false -p:SymbolPackageFormat=snupkg --output ./artifacts
46+
47+
- name: Upload artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: nuget-packages
51+
path: ./artifacts/*.nupkg
52+
retention-days: 5
53+
54+
publish-nuget:
55+
name: Publish to NuGet
56+
needs: build
57+
runs-on: ubuntu-latest
58+
if: github.ref == 'refs/heads/main'
59+
60+
outputs:
61+
published: ${{ steps.publish.outputs.published }}
62+
version: ${{ needs.build.outputs.version }}
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v5
67+
68+
- name: Download artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: nuget-packages
72+
path: ./artifacts
73+
74+
- name: Setup .NET
75+
uses: actions/setup-dotnet@v4
76+
with:
77+
dotnet-version: ${{ env.DOTNET_VERSION }}
78+
79+
- name: Publish to NuGet
80+
id: publish
81+
continue-on-error: true
82+
run: |
83+
set +e
84+
OUTPUT=""
85+
PUBLISHED=false
86+
87+
for package in ./artifacts/*.nupkg; do
88+
echo "Publishing $package..."
89+
RESULT=$(dotnet nuget push "$package" \
90+
--api-key ${{ secrets.NUGET_API_KEY }} \
91+
--source https://api.nuget.org/v3/index.json \
92+
--skip-duplicate 2>&1)
93+
EXIT_CODE=$?
94+
echo "$RESULT"
95+
OUTPUT="$OUTPUT$RESULT"
96+
97+
if [ $EXIT_CODE -eq 0 ]; then
98+
echo "Successfully published $package"
99+
PUBLISHED=true
100+
elif echo "$RESULT" | grep -q "already exists"; then
101+
echo "Package already exists, skipping..."
102+
else
103+
echo "Failed to publish $package"
104+
exit 1
105+
fi
106+
done
107+
108+
if [ "$PUBLISHED" = true ] || echo "$OUTPUT" | grep -q "Your package was pushed"; then
109+
echo "published=true" >> $GITHUB_OUTPUT
110+
echo "At least one package was successfully published"
111+
else
112+
echo "published=false" >> $GITHUB_OUTPUT
113+
echo "No new packages were published (all already exist)"
114+
fi
115+
116+
create-release:
117+
name: Create GitHub Release and Tag
118+
needs: publish-nuget
119+
runs-on: ubuntu-latest
120+
if: needs.publish-nuget.outputs.published == 'true'
121+
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v5
125+
with:
126+
fetch-depth: 0
127+
token: ${{ secrets.GITHUB_TOKEN }}
128+
129+
- name: Download artifacts
130+
uses: actions/download-artifact@v4
131+
with:
132+
name: nuget-packages
133+
path: ./artifacts
134+
135+
- name: Create and push tag
136+
id: create_tag
137+
run: |
138+
VERSION="${{ needs.publish-nuget.outputs.version }}"
139+
TAG="v$VERSION"
140+
141+
git config user.name "github-actions[bot]"
142+
git config user.email "github-actions[bot]@users.noreply.github.com"
143+
144+
if git rev-parse "$TAG" >/dev/null 2>&1; then
145+
echo "Tag $TAG already exists"
146+
echo "tag_exists=true" >> $GITHUB_OUTPUT
147+
else
148+
echo "Creating tag $TAG"
149+
git tag -a "$TAG" -m "Release $VERSION"
150+
git push origin "$TAG"
151+
echo "tag_exists=false" >> $GITHUB_OUTPUT
152+
fi
153+
154+
- name: Get previous tag
155+
id: prev_tag
156+
run: |
157+
CURRENT_TAG="v${{ needs.publish-nuget.outputs.version }}"
158+
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -A1 "^$CURRENT_TAG$" | tail -n1 || echo "")
159+
if [ "$PREVIOUS_TAG" = "$CURRENT_TAG" ] || [ -z "$PREVIOUS_TAG" ]; then
160+
PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -v "^$CURRENT_TAG$" | head -n1 || echo "")
161+
fi
162+
echo "previous_tag=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
163+
echo "Current tag: $CURRENT_TAG"
164+
echo "Previous tag: $PREVIOUS_TAG"
165+
166+
- name: Generate release notes
167+
id: release_notes
168+
run: |
169+
VERSION="${{ needs.publish-nuget.outputs.version }}"
170+
CURRENT_TAG="v$VERSION"
171+
PREVIOUS_TAG="${{ steps.prev_tag.outputs.previous_tag }}"
172+
173+
echo "# Release $VERSION" > release_notes.md
174+
echo "" >> release_notes.md
175+
echo "Released on $(date +'%Y-%m-%d')" >> release_notes.md
176+
echo "" >> release_notes.md
177+
178+
if [ -n "$PREVIOUS_TAG" ]; then
179+
echo "## 📋 Changes since $PREVIOUS_TAG" >> release_notes.md
180+
echo "" >> release_notes.md
181+
182+
echo "### ✨ Features" >> release_notes.md
183+
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD --grep="^feat" --grep="^feature" >> release_notes.md || true
184+
echo "" >> release_notes.md
185+
186+
echo "### 🐛 Bug Fixes" >> release_notes.md
187+
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD --grep="^fix" --grep="^bugfix" >> release_notes.md || true
188+
echo "" >> release_notes.md
189+
190+
echo "### 📚 Documentation" >> release_notes.md
191+
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD --grep="^docs" --grep="^doc" >> release_notes.md || true
192+
echo "" >> release_notes.md
193+
194+
echo "### 🔧 Other Changes" >> release_notes.md
195+
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD --invert-grep --grep="^feat" --grep="^feature" --grep="^fix" --grep="^bugfix" --grep="^docs" --grep="^doc" >> release_notes.md || true
196+
echo "" >> release_notes.md
197+
else
198+
echo "## 🎉 Initial Release" >> release_notes.md
199+
echo "" >> release_notes.md
200+
echo "### Recent Changes" >> release_notes.md
201+
git log --pretty=format:"- %s (%h)" --max-count=20 >> release_notes.md
202+
echo "" >> release_notes.md
203+
fi
204+
205+
echo "" >> release_notes.md
206+
echo "## 📦 NuGet Package" >> release_notes.md
207+
echo "" >> release_notes.md
208+
echo "- [RagSharp v$VERSION](https://www.nuget.org/packages/RagSharp/$VERSION)" >> release_notes.md
209+
echo "" >> release_notes.md
210+
echo "---" >> release_notes.md
211+
echo "*This release was automatically created by GitHub Actions*" >> release_notes.md
212+
213+
- name: Create GitHub Release
214+
uses: softprops/action-gh-release@v2
215+
with:
216+
tag_name: v${{ needs.publish-nuget.outputs.version }}
217+
name: v${{ needs.publish-nuget.outputs.version }}
218+
body_path: release_notes.md
219+
draft: false
220+
prerelease: false
221+
files: ./artifacts/*.nupkg
222+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)