Skip to content

feat(ci): codegraph PR review scaffold (template-based for OAuth scope safety)#9

Merged
smochan merged 1 commit into
mainfrom
feat/ci-pr-review-scaffold
Apr 27, 2026
Merged

feat(ci): codegraph PR review scaffold (template-based for OAuth scope safety)#9
smochan merged 1 commit into
mainfrom
feat/ci-pr-review-scaffold

Conversation

@smochan

@smochan smochan commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Workflow shipped as a template at .github/ci-templates/. Activation is one cp + push after gh auth refresh -s workflow.

…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.
@smochan smochan merged commit dde6d94 into main Apr 27, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant