Skip to content

Require exact-SHA Cloud integration decisions - #533

Open
sdairs wants to merge 1 commit into
stack/458-disable-script-telemetryfrom
stack/410-cloud-integration-decision
Open

Require exact-SHA Cloud integration decisions#533
sdairs wants to merge 1 commit into
stack/458-disable-script-telemetryfrom
stack/410-cloud-integration-decision

Conversation

@sdairs

@sdairs sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a trusted controller that creates one Cloud integration decision check per exact PR head SHA
  • accept only verified selected-suite success, trusted no-suite plans, or maintain/admin exact-SHA comment overrides with an audit trail
  • reject stale, fork, skipped-admission, unrelated, and self-modified workflow evidence without executing PR code on write-capable controller paths
  • document stacked-PR handling and wire controller tests into ordinary Cloud API CI

Tests

  • python3 -m unittest discover -s scripts/tests -p 'test_*.py' (65 passed)\n- python3 -m py_compile scripts/cloud-integration-decision.py scripts/tests/test_cloud_integration_decision.py\n- cargo fmt --all --check\n- Ruby YAML parse for the changed workflows\n- git diff --check\n\n## Rollout\nDo not require the check before this stack lands on the default branch. After merge, initialize and exercise Cloud integration decision on a representative current PR, then add that GitHub Actions check to the required status checks for main; existing open PRs must first be synchronized/reopened, label-run, or explicitly overridden. Keep the on-demand Cloud Integration workflow itself informational.\n\nCloses Require an explicit Cloud integration decision before merge #410

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 79baced. Configure here.

if decision is None:
print("Cloud run did not change the current decision")
return
check = api.upsert_decision(head_sha, decision)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Override wiped by later reconcile

Medium Severity

reconcile always upserts the latest Cloud Integration outcome onto the exact-SHA check and never preserves an existing maintainer override. After an audited /cloud-integration-override success, a later label-triggered run that fails replaces that success with failure, so the explicit same-SHA acceptance no longer satisfies the required check.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 79baced. Configure here.

" This is a fork PR, so use a trusted same-repository mirror or a "
"maintainer override; Cloud secrets are not available to the fork."
if is_fork
else ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Null fork repo crashes controller

Low Severity

waiting_decision indexes pull_request["head"]["repo"]["full_name"] without allowing a null head.repo, which GitHub returns when the fork source was deleted. That raises during initialize, so no decision check is created. current_run_is_safe has the same footgun: .get("repo", {}) still yields None when the key is present and null.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 79baced. Configure here.

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