Repository navigation
feat: ask for merge risk in the run and keep it in the artifact and the review comment - #179
Merged
Merged
Conversation
…ment
A third request beside the review guide and architecture, POST
/v1/merge-risk, sends the files changed between the merge base and the
head with their patches. They come from git in the checkout, not the
compare API, which stops at 300 files; the checkout is one commit deep, so
the merge base is fetched by sha with the run's token passed through the
environment. A patch over 300 KB is left out, and the patches go when the
request would be over the service's limit.
The answer is written to closed/merge_risk.json in the review artifact
with the head and base it describes, and summed up in one hidden line of
the review comment, <!-- codeboarding:merge_risk {json} -->, for the web
platform's dashboard. The JSON escapes <, >, - and = so nothing in it can
end the comment or match the status line's reader.
It runs from the start, whatever happens to the analysis inputs or the
guide, and a failure is one notice that writes nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
CodeBoarding reviewStatus: 1 changed component See the full change in CodeBoarding. graph LR
n_Action_Workflow_and_Analysis_Execution["Action Workflow and Analysis Execution"]
n_Remote_Review_and_Problem_Ledger["Remote Review and Problem Ledger"]
n_Remote_Review_and_Problem_Ledger -- "validates credentials and requests tokens throu…" --> n_Action_Workflow_and_Analysis_Execution
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_Remote_Review_and_Problem_Ledger modified;
linkStyle 0 stroke:#0b5d23,stroke-width:2px;
|
The file list now comes from GitHub's pull request files, page by page, instead of fetching the merge base by sha and parsing `git diff` in the checkout; a run whose head moved on during it sends nothing, since a newer run answers for that head. The bearer is asked for once and shared, so the lock around it goes, and the comment's hidden line is built in remote_features.py and handed to the comment step as an output, so merge_risk_marker.py goes too. The line no longer carries tests and dirs, which nothing reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ew findings - closed_features_source: false now reaches merge risk: it sends each changed file's path, additions and deletions with patch null, read through the same source_allowed check that collect_source uses. README and the input description say so. - A credentials failure logs its own merge-risk notice beside the guide's; before, merge risk was never submitted and said nothing. - The comment line and the stored JSON are both built before either is written, so an answer the line cannot carry leaves neither behind. - Merge risk compresses at xz preset 1 instead of 9e, and a file list over ten times the compressed limit drops its patches before compressing. The guide's and architecture's requests are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Svilen-Stefanov
force-pushed
the
feat/merge-risk-in-run
branch
from
November 27, 2026 00:10
23b1409 to
50541f4
Compare
With source off or a diff too large, the request goes without patches and licensing's mention and dependency checks cannot run. The answer now says so (`facts.patches`), the run logs a notice, and the comment line carries `patches` for the web platform. The README says the input does not keep code from the review guide's request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Escaping `-` would turn a negative number into invalid JSON; escaping `>` already keeps `-->` out. The line is now left out, with a notice, when it would take more than 8,000 characters of a comment GitHub caps at 65,536; the artifact still carries the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ivanmilevtues
marked this pull request as ready for review
November 29, 2026 03:53
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Ask for merge risk in the run, and keep the answer where the web platform reads it, so the webview never calls the service.
What
scripts/remote_features.pymakes a third request beside the review guide and architecture,POST /v1/merge-risk, with the same bearer (OIDC plus license, or the run's token), asked for once and shared by all three. It sends no analysis:{version: 1, repo, pr, files: [{filename, additions, deletions, patch}]}, xz.GET /pulls/{n}/files, 100 a page, at most 3,000 files, a very large file without its patch). It is read after the head is checked: if the pull request moved on to a newer head during the run, nothing is sent, since the newer run answers for that head.closed_features_source: falsekeeps merge risk's patches on the runner (the review guide's request still carries the changed files; this input never governed it). Merge risk then sends each file's path, additions and deletions withpatch: null, so the diff's size and the areas its paths fall in still count. It reads the setting throughsource_allowed, the same checkcollect_sourceuses. README (the merge-risk paragraph, the source paragraph and the inputs table) and the input's description say so.facts.patches(all,some,none), the run logs::notice::merge-risk read none of the patches (...), and the comment line carriespatches, so the web platform shows it instead of reading the silence as clean.::notice::and writes nothing. When getting credentials fails, nothing is sent and merge risk logs its own::notice::merge-risk failed: getting credentials failed: ...beside the guide's.closed/merge_risk.jsonin the review artifact (withrepo,pr,headSha) before the upload step.merge_risk_lineoutput, andbuild-review-comment.shprints it before the existing machine-readable line:<!-- codeboarding:merge_risk {json} -->with the head sha,sensitive, critical area names, up to 20 dependency names, srcLines, sourceFiles, and each reason's level, code and params. The JSON escapes<,>,-and=so nothing in it can end the comment or match the status line'skey=valuereader. The existing marker stays the last line. The line and the stored JSON are both built before either is written, so an answer the line cannot carry leaves neither behind.review_guide_urlinput description mention the third request.Asking for the guide when the service cannot call the run's provider moved to https://app.codeboarding.org/CodeBoarding/CodeBoarding-action/pull/180, which waits on licensing #70.
Related
Tests
tests/test_remote_features.py: the request body, the stored file and the step output, isolation in both directions (merge risk failing or skipped leaves the guide and architecture alone; missing analysis inputs leave merge risk alone), dropping patches over the limit, reading every page of the file list, skipping a head that moved on, and the hidden line's escaping and round trip. New with the review: source turned off sends no patches (falseandFalse) and on sends them; a credentials failure logs both notices and sends nothing; an answer the line cannot carry writes neither file nor line; merge risk compresses at preset 1 while the guide stays at 9e; a 44 MB diff goes out without patches, compressed once, well under five seconds.tests/test_review_comment.py: the line's position, and no line without one. Full suite: 374 tests OK (9 skipped). Black clean; no shell changed since the last review.Size, product code without tests: +184 / -29, 155 net.
Nothing visible changes in the comment: the line is an HTML comment.
Not tagged or released.
🤖 Generated with Claude Code