Skip to content

Dispatch pull request security reviews - #338

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/dispatch-security-review
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/dispatch-security-review

Conversation

@zaniebot

Copy link
Copy Markdown
Collaborator

Pull-request-triggered CI currently invokes the security-review workflow from the pull-request revision, allowing repository-controlled setup and scripts to run around the automation environment and its publisher. Route eligible same-repository pull-request activity through the automations dispatcher and run the reviewer from trusted main, preparing the plugin, prompt, schema, and threat model before checking out the verified head for sandboxed analysis.

Keep documentation-only changes inexpensive, preserve the isolated pull_requests: write publisher and its freshness check, and remove the privileged reusable-workflow call from normal pull-request CI.

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch 2 times, most recently from 8ccd54e to 7decc69 Compare July 21, 2026 17:46
Comment thread .github/workflows/ci.yml Outdated
@@ -17,7 +17,6 @@ jobs:
runs-on: depot-ubuntu-24.04
outputs:
test-code: ${{ steps.plan.outputs.test_code }}
review-security: ${{ steps.plan.outputs.review_security }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this suggest we should allow dispatching on plan to get the outputs of it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i.e., via workflow call?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #365 and related stack.

Need to figure that out first.

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from 7decc69 to c570983 Compare July 21, 2026 18:31
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from c570983 to 8287f1c Compare July 22, 2026 14:10
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch 3 times, most recently from dda70af to de9f8a8 Compare August 5, 2026 17:33
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch 4 times, most recently from e275071 to abbce70 Compare September 7, 2026 18:14
@zaniebot zaniebot added priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context. internal:automations Related to internal automations security labels Sep 9, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch 2 times, most recently from 955479d to 7612a90 Compare September 10, 2026 17:08
@zaniebot zaniebot added the risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. label Sep 11, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from 7612a90 to 456b837 Compare September 14, 2026 20:23
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch 2 times, most recently from 2f11953 to 73bab51 Compare October 7, 2026 23:13
Comment on lines +23 to +26
uses: astral-sh/github-actions/.github/workflows/pull-request-security-review.yml@3c57a5dba8ad854a97e8b9fbf454286a7574e677
with:
pull-request: ${{ inputs.pull_request }}
head-sha: ${{ inputs.head_sha }}

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] Pin a reusable workflow that supports dispatch inputs

At the pinned 3c57a5d… revision, the reusable workflow declares neither pull-request nor head-sha; it still obtains PR metadata from github.event.pull_request. GitHub rejects these undeclared inputs, so removing the CI job leaves security reviews unable to run. Pin a dispatch-capable implementation that resolves and validates the PR metadata, and update the matching reusable_workflow SHA in the token-service policy.

Comment thread .github/workflows/ci.yml
Comment on lines -29 to -31
review:
needs: plan
if: ${{ github.event_name == 'pull_request' && github.repository == 'astral-sh/uv' && github.event.pull_request.head.repo.full_name == github.repository && needs.plan.outputs.review-security == 'true' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P2] Retain the documentation-only review gate

This removes the only consumer of plan.outputs.review-security, which skips documentation-only changes. Neither the new dispatcher rule nor the pinned reusable workflow supplies an equivalent changed-path gate. Once the dispatch contract is fixed, a README-only PR will incur tool setup and a full security review on every update, contrary to the intended inexpensive documentation path. Add a trusted changed-path preflight and gate the reviewer on its result.

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from 73bab51 to 267e82d Compare October 12, 2026 16:36
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from 267e82d to bb30963 Compare October 14, 2026 16:22
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/dispatch-security-review branch from 006af1f to 23b654c Compare October 23, 2026 00:31

This branch was successfully deployed

1 active (outdated) deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal:automations Related to internal automations priority:2 Important: bounded correctness, release reliability, committed work, or proven performance gains. risk:3 Credible risk of meaningful incorrect behavior or regression; bounded or recoverable. security size:4 Complex: architectural or security-sensitive work requiring broad or cross-repository context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants