Repository navigation
Update tracked branch heads from full scans - #479
David Larsen (dc-larsen) wants to merge 2 commits into
Conversation
PR SummaryMedium Risk Overview
Docs and changelog describe branch heads and the Reviewed by Cursor Bugbot for commit 2b912ed. Configure here. |
8cefa17 to
6a297e9
Compare
|
bugbot run |
There was a problem hiding this comment.
David Larsen (@dc-larsen), please tighten the promotion gate and verify the server behavior before including this in 2.16.0.
Use scan context to decide head eligibility
- The promotion check treats a missing PR number as a branch run. I reproduced a GitHub PR event with
--pr-number 0requesting head promotion, including when the SCM adapter selected the comparison flow. Use resolved scan context to keep PR/MR runs out of the new promotion path even when a PR number is unavailable. Add a regression test through the CLI path. - An explicit
--default-branchon a PR still requests head promotion today. Please test this case and align the code, docs, and PR body with the intended compatibility behavior. If the existing explicit behavior stays, say so and avoid the blanket promise that PR scans never request promotion. Test--no-default-branchon a tracked-branch run too. - Validate the revised build in staging for a default branch, a tracked non-default branch, an untracked branch, and the explicit opt-out. Confirm which scans update the branch head and that the tracked scan leaves the repository’s default branch intact. The current live check predates the opt-out gate.
Docs, changelog, and stack
- Suggested title: Update tracked branch heads from full scans. Keep the body focused on the behavior change, the dependency on #478, and the final validation. In code, keep one comment describing server-side eligibility. Remove the historical wording from the test comment and name the PR test for the case it covers.
- Under Changed in the shared
2.16.0changelog and in the Public Changelog block, explain the upgrade effect: “Full scans of branches that match an organization’s tracked branch patterns can update those branch heads, so findings from those branches can appear on the organization Alerts page after upgrade.” Note the--no-default-branchopt-out and explain that untracked branches are ineligible. The CLI reference should link the behavior to Settings > Alerts > Scans and clarify that--pending-headremains deprecated and has no effect. A pointer from the existing README CI guidance is enough. - Rebase and retarget this PR to
mainafter #478 lands. Keep #478’s 2.16.0 version and drop the independent 2.15.9 bump. #478’s new public flag drives the minor bump. This PR’s upgrade impact belongs in the same release notes. Rerun CI and Bugbot on the final stack.
81105de to
8cae773
Compare
6a297e9 to
b398abc
Compare
|
bugbot run |
Full scans sent set_as_pending_head=is_default_branch, so only a default-branch scan could become a head. The API also makes a scan the head of a branch that matches the organization's tracked branch patterns (Settings > Alerts > Scans), but only when the request sets set_as_pending_head, and it ignores the flag on branches it doesn't track. Python CLI scans of a tracked branch were never that branch's head, so their findings never reached the organization Alerts page. Branch runs now send set_as_pending_head=true and let the API decide. make_default_branch is unchanged. A run counts as a pull or merge request when it has a PR number, when the SCM adapter selected the comparison flow, or when the CI environment describes a PR or MR event, so a PR run with --pr-number 0 stays out of the new path. A scan marked as the default branch, including one with an explicit --default-branch on a PR, still requests it as before, and --no-default-branch keeps it off. --pending-head stays a deprecated no-op. Its warning, the CLI reference, the README and the CHANGELOG describe the new behavior. Shares the 2.16.0 version set in #478.
b398abc to
29b1612
Compare
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2b912ed. Configure here.
Stacked on #478 for the shared 2.16.0 release.
Full scans can update heads for branches that match an organization's tracked branch patterns. This lets findings from those branches appear on the organization Alerts page. The API decides which branches are tracked, and this change preserves the repository's default branch.
Pull and merge request runs on non-default branches skip automatic promotion even when the PR number is unavailable. Automatic branch-head updates also skip a Git scan if the checkout lacks its explicitly requested commit.
--default-branchretains its explicit behavior.--no-default-branchopts a scan out of both updates.Verification
Public Changelog
Full scans of tracked branches can update branch heads, so findings from those branches can appear on the organization Alerts page after upgrade. Use
--no-default-branchto opt a scan out.Refs: CE-529