-
Notifications
You must be signed in to change notification settings - Fork 9
ci: incrementally update docs graph on PR merge #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+183
−0
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c85cbd8
ci: incrementally update docs graph on PR merge
galshubeli 160fd4a
ci: simplify update-graph workflow to a single endpoint call (Design B)
galshubeli fa72491
Merge branch 'main' into feat/docs-update-workflow
galshubeli c7ae19a
fix(ci): correct concurrency group target + add least-privilege permi…
galshubeli 03c58e6
fix(ci): use merge_commit_sha for HEAD_SHA, not github.sha (Naseem)
galshubeli 836fb6d
ci: switch trigger from pull_request to push:branches:[main]
galshubeli e443e39
style(ci): strip unnecessary commentary from update-graph.yml
galshubeli 4307c21
docs(ci): add 4-line header explaining update-graph.yml
galshubeli 1d935e9
refactor(ci): extract diff-payload Python to .github/scripts
galshubeli 83792ed
fix(ci): read file content from git object store, not working tree
galshubeli b745c17
ci(workflow): pin actions/checkout to commit SHA
galshubeli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Incrementally updates the FalkorDB docs knowledge graph on PR merge. | ||
| # | ||
| # On merge to main of a PR touching .md files, this workflow: | ||
| # 1. Checks out this repo (the content) and FalkorDB/GraphRAG-UI (the Python). | ||
| # 2. Runs `python -m server.scripts.update_graph --graph-id docs_benchmark` | ||
| # from the GraphRAG-UI checkout. That script: | ||
| # - looks up the :Graph node for docs_benchmark in the org graph | ||
| # - reads ingestion config (LLM/embedder/chunker/extractor/resolver/globs) | ||
| # from the node, NOT from this workflow — the workflow stays generic | ||
| # - copies the live graph to docs_v{N+1}_pending via redis-cli GRAPH.COPY | ||
| # - SDK.apply_changes(added, modified, deleted) + SDK.finalize() on pending | ||
| # - smoke-tests the `questions` from the :Graph node against the pending | ||
| # - on success: atomic Cypher flip of active_graph; drops old previous | ||
| # - on failure: exits non-zero, leaves pending graph for inspection | ||
| # | ||
| # The only docs-specific input from this file is `--graph-id docs_benchmark`. | ||
| # Everything else lives as data in the org graph so user-created widgets | ||
| # share the same code path with no workflow changes. | ||
|
|
||
| name: Update graph (incremental) | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [main] | ||
| paths: | ||
| - "**/*.md" | ||
|
|
||
| # Merge target is always main, so all runs share one group. Bursts of PR | ||
| # merges queue rather than race. cancel-in-progress: false because each | ||
| # run consumes LLM credit and we'd rather pay the wait than re-do work. | ||
| concurrency: | ||
| group: update-graph-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| update-graph: | ||
| if: github.event.pull_request.merged == true | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Checkout docs (this repo) | ||
| uses: actions/checkout@v4 | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
galshubeli marked this conversation as resolved.
Outdated
|
||
| with: | ||
| fetch-depth: 0 # need history for git diff against an arbitrary base | ||
| path: docs | ||
|
|
||
| - name: Checkout GraphRAG-UI (action code lives there) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: FalkorDB/GraphRAG-UI | ||
| # Required if GraphRAG-UI is private. Drop this line entirely | ||
| # when the repo becomes public. | ||
| token: ${{ secrets.GRAPHRAG_UI_CHECKOUT_PAT }} | ||
| path: graphrag-ui | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install GraphRAG-UI server deps | ||
| run: pip install -r graphrag-ui/server/requirements.txt | ||
|
|
||
| - name: Run incremental update | ||
| env: | ||
| # FalkorDB connection (the action talks via redis-cli AND via the SDK). | ||
| FALKORDB_HOST: ${{ secrets.FALKORDB_HOST }} | ||
| FALKORDB_PORT: ${{ secrets.FALKORDB_PORT }} | ||
| FALKORDB_PASSWORD: ${{ secrets.FALKORDB_PASSWORD }} | ||
|
|
||
| # Azure OpenAI credentials — read at factory time inside | ||
| # IngestionConfig.{LLM,Embedder}Config.to_*(). Never stored in | ||
| # the org graph alongside the rest of the config. | ||
| AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
| AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} | ||
| AZURE_OPENAI_DEPLOYMENT: ${{ secrets.AZURE_OPENAI_DEPLOYMENT }} | ||
| working-directory: graphrag-ui | ||
| run: | | ||
| python -m server.scripts.update_graph \ | ||
| --graph-id docs_benchmark \ | ||
| --source-root ../docs \ | ||
| --base-sha ${{ github.event.pull_request.base.sha }} \ | ||
| --head-sha ${{ github.sha }} | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.