feat(ci): codegraph PR review scaffold (template-based for OAuth scope safety)#9
Merged
Merged
Conversation
…ependabot)
The PR-review workflow lives at .github/ci-templates/pr-review.workflow.yml
(outside .github/workflows/ so a token without the `workflow` OAuth scope
can still push the repo). Activation is a one-time copy + push:
gh auth refresh -h github.com -s workflow
cp .github/ci-templates/pr-review.workflow.yml .github/workflows/pr-review.yml
git add .github/workflows/pr-review.yml && git commit && git push
Once active, every PR against main:
1. Worktree-checkout origin/main, build, save baseline
2. Build PR head graph
3. codegraph review --fail-on high --format markdown --baseline ...
4. Sticky PR comment via peter-evans/create-or-update-comment
(comment-tag: codegraph-review — replaces, doesn't stack)
5. Fail check if findings exceed threshold
Concurrency group on PR number with cancel-in-progress; review.md +
comment.md + graph.db uploaded as a 7-day artifact for debugging.
First-PR graceful path: if no baseline can be saved from main, post a
friendly "first-time review" comment and pass.
Also adds:
- .github/PULL_REQUEST_TEMPLATE.md with a codegraph-signals section
- .github/dependabot.yml — weekly pip + github-actions
- scripts/test-pr-review-locally.sh — local dry-run that emulates the
workflow exactly (worktree-add origin/main, baseline save, review)
- README "PR review CI" section with activation + dry-run docs
No production code changed; 467 tests still pass; ruff + mypy --strict clean.
2 tasks
smochan
added a commit
that referenced
this pull request
May 30, 2026
When `~/.codegraph/workspace.yml` didn't exist, `workspace_state`
returned `{workspace_size: 0, repos: []}` — same shape as a configured
but empty workspace. LLMs read this as "everything is broken".
Result now carries a `status` field:
- `workspace_not_configured` when the YAML doesn't exist
- `workspace_empty` when it exists with no repos
- `ok` when there's at least one repo
The not-configured case includes a message clarifying that the local
single-repo MCP tools work independently — only the cross-repo tools
are affected.
v0.1.2 backlog item #9.
smochan
added a commit
that referenced
this pull request
May 30, 2026
When `~/.codegraph/workspace.yml` didn't exist, `workspace_state`
returned `{workspace_size: 0, repos: []}` — same shape as a configured
but empty workspace. LLMs read this as "everything is broken".
Result now carries a `status` field:
- `workspace_not_configured` when the YAML doesn't exist
- `workspace_empty` when it exists with no repos
- `ok` when there's at least one repo
The not-configured case includes a message clarifying that the local
single-repo MCP tools work independently — only the cross-repo tools
are affected.
v0.1.2 backlog item #9.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Workflow shipped as a template at .github/ci-templates/. Activation is one cp + push after gh auth refresh -s workflow.