Skip to content

feat: ask CodeBoarding for the pull request's review guide (experimental) - #160

Merged
ivanmilevtues merged 2 commits into
mainfrom
feat/review-guide
Oct 31, 2026
Merged

ivanmilevtues merged 2 commits into
mainfrom
feat/review-guide

Conversation

@Svilen-Stefanov

@Svilen-Stefanov Svilen-Stefanov commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What

An experimental step that asks CodeBoarding for the pull request's review guide and stores it in the review artifact. It uses the deployed production service by default; set review_guide_url to an empty string to disable it.

After the review analysis, scripts/review_guide.py:

  1. Packs what the run already has into one gzipped bundle:
    • both analysis.json files;
    • both call graphs, read from the static_analysis.pkl beside each, so nothing is recomputed;
    • the diff between the two analysed commits, from the compare API, so it's exactly what was analysed;
    • the changed files at both commits: head from the checkout, base from the contents API.
  2. Posts it to the closed-functions service (licensing-aws #44).
  3. Writes the answer to the artifact folder as review_guide.json, before the upload. The webview reads it from there (webview #255). The webview never calls the service.

Credentials follow the analysis:

  • Proving the caller: a fresh OIDC token plus the license, minted by oidc_relay.py, the same bearer the hosted proxy gets. The run's GITHUB_TOKEN stands in when the workflow can't mint one.
  • The model: a run with its own Ollama, OpenRouter or OpenAI key sends that key along. Otherwise the service uses CodeBoarding's hosted model, metered like the analysis.

Never fails the run: a refusal, a timeout or a bundle over the service's limit leaves the artifact without a guide and logs one line.

The guide's code isn't in this repository; only the bundling is.

Not done yet

  • Not on v1 yet: the production URL is now the default. Merge and publish an Action release to deliver it to v1 users.
  • Readable for now: the guide is stored unencrypted. Encrypting it with a key shared by the service and the webview is the next step.

Changes nothing visible by itself. Tests: 7 new (tests/test_review_guide.py), all passing with the existing suite; Black clean.

🤖 Generated with Claude Code

…tal)

When `review_guide_url` is set, a review run packs what it already has (both analyses, both call
graphs from the static_analysis.pkl beside them, the diff between the two analysed commits, and the
changed files at both) into a gzipped bundle, posts it to the closed-functions service, and stores
the answer in the review artifact as review_guide.json, where the platform reads it.

It authenticates the way the hosted proxy does (a fresh OIDC token plus the license, minted by
oidc_relay), or with the run's GITHUB_TOKEN when the workflow cannot mint one; a run with its own
Ollama, OpenRouter or OpenAI key sends that key along. Off by default, and it never fails the run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codeboarding-review

codeboarding-review Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

CodeBoarding review

Status: 1 changed component

See the full change in CodeBoarding.

graph LR
    n_action_support_scripts["action_support_scripts"]
    classDef added fill:#1f883d,stroke:#0b5d23,color:#ffffff;
    classDef modified fill:#bf8700,stroke:#7d4e00,color:#ffffff;
    classDef deleted fill:#cf222e,stroke:#82071e,color:#ffffff,stroke-dasharray:5 3;
    class n_action_support_scripts modified;
Loading

download artifacts · run 41215295267

@ivanmilevtues
ivanmilevtues marked this pull request as ready for review October 31, 2026 14:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T15:33:14.683917Z fe5109a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e64b7c858a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/review_guide.py
Comment on lines +134 to +136
p = checkout / f["filename"]
try:
files[f"{head_sha}:{f['filename']}"] = p.read_text(encoding="utf-8")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid following checkout symlinks when collecting changed files

When a trusted collaborator requests a review of a fork PR with review_guide_url enabled, the PR can introduce a symlink pointing outside the checkout. read_text() follows that link, so a file pointing to /proc/self/environ on a Linux runner copies this step's environment—including GITHUB_TOKEN, provider keys and OIDC request credentials—into the bundle sent to the guide service. I reproduced the external-file read with a symlink and a secret marker. Read the committed blob or reject symlinks and paths resolving outside the checkout before collecting contents.

Useful? React with 👍 / 👎.

Comment thread scripts/review_guide.py
Comment on lines +178 to +182
for name, provider in OWN_KEYS:
if env.get(name, "").strip():
# The service still checks the caller is this repository's run.
return {**_bearer(env), "x-llm-api-key": env[name].strip(), "x-llm-provider": provider}
return _bearer(env)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Respect the explicitly selected provider for review guides

For a valid workflow selecting llm: anthropic (or another provider outside OWN_KEYS), enabling the guide silently switches its model requests to CodeBoarding's hosted tier: the new action step forwards only three providers' keys, and this fallback returns authentication without any provider selection. This consumes hosted usage and sends code to a different model provider despite the workflow's explicit choice. AGENTS.md requires that a workflow naming a provider “runs on that provider or fails.” Pass the resolved provider plan through and skip the optional guide with an explicit notice when that provider is unsupported, rather than falling back.

AGENTS.md reference: AGENTS.md:L53-L58

Useful? React with 👍 / 👎.

@ivanmilevtues
ivanmilevtues merged commit d55de4f into main Oct 31, 2026
5 checks passed
@ivanmilevtues
ivanmilevtues deleted the feat/review-guide branch October 31, 2026 15:37
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.

2 participants