Ci/knowledge graph - #1271
Ci/knowledge graph#1271wyzula-jan wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow and supporting scripts to generate a “graphify” knowledge graph for the repository and publish it as a CI artifact, while keeping generated outputs out of version control.
Changes:
- Add
knowledge-graphGitHub Actions workflow that builds and uploads the graph as an artifact (with caching). - Add a CI-friendly Python script (
graph_rebuild.py) plus a minimalgraph_spec.jsonto drive graph generation. - Ignore local/CI graph outputs via
.gitignore(graphify-out/).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .gitignore | Ignores graphify-out/ so generated knowledge-graph outputs aren’t committed. |
| .github/workflows/knowledge-graph.yml | New workflow to build and upload the knowledge graph artifact, with a release-gate and cache. |
| .github/scripts/graphify/graph_spec.json | Adds a default graphify scan spec for the repo. |
| .github/scripts/graphify/graph_rebuild.py | Adds a headless Python builder to generate the graph and report in CI. |
Suppressed comments (2)
.github/workflows/knowledge-graph.yml:60
- The cache key is based on
github.sha, which can differ fromgithub.event.workflow_run.head_shaonworkflow_runtriggers. If you switch checkout toworkflow_run.head_sha, the cache key should use the same SHA to avoid mixing caches across unrelated commits.
path: graphify-out
key: graphify-${{ runner.os }}-${{ github.sha }}
restore-keys: |
.github/workflows/knowledge-graph.yml:82
- The stamped
build_meta.jsoncommit usesgithub.sha, which can differ from the actual checked out commit forworkflow_runevents. Stamp the same SHA you build from (prefergithub.event.workflow_run.head_shawhen present) so the artifact metadata matches the graph contents.
import json
meta = json.load(open("graphify-out/build_meta.json"))
meta["commit"] = "${{ github.sha }}"
json.dump(meta, open("graphify-out/build_meta.json", "w"), indent=2)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| workflow_dispatch: {} | ||
| # TEMPORARY dry-run trigger — this commit is meant to be dropped before merge. | ||
| pull_request: {} |
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-tags: true |
| repo = Path(sys.argv[1]).resolve() | ||
| spec = json.loads(Path(sys.argv[2]).read_text(encoding="utf-8")) | ||
| import os |
…ractives for the project
Builds the graphify knowledge graph after each semantic-release and attaches it to that release as knowledge-graph-v<version>.tar.gz, so every developer can fetch the map for a given version. The map carries its own identity — released package versions, tag and commit — in build_meta.json and embedded in graph.json, which is what lets a consumer tell a current map from a stale one. The graph is never committed; graphify-out/ is gitignored.
Records how to fetch the map for a checkout's version and how to tell whether it is current, so the graph is used for orientation only while it demonstrably matches the code being read.
Lets the graph be built and fetched before any release carries it, so the self-update path can be exercised end to end. Also stamps the PR head commit rather than the merge commit, which exists in no local clone and would make every staleness check report an invalid revision range. Dry-run only — drop this commit before merging.
f0ddb6d to
563a190
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Benchmark comparisonThreshold: 20% (lower is better). No benchmark regression exceeded the configured threshold. No benchmark improvement exceeded the configured threshold. All benchmark results
|
Description
[Provide a brief description of the changes introduced by this pull request.]
Related Issues
[Cite any related issues or feature requests that are addressed or resolved by this pull request. Link the associated issue, for example, with
fixes #123orcloses #123.]Type of Change
How to test
Potential side effects
[Describe any potential side effects or risks of merging this PR.]
Screenshots / GIFs (if applicable)
[Include any relevant screenshots or GIFs to showcase the changes made.]
Additional Comments
[Add any additional comments or information that may be helpful for reviewers.]
Definition of Done