Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ci: add on-demand + auto-on-approval PR CI, piloted on two workflows#32012

Closed
gkarat wants to merge 5 commits into
openssl:masteropenssl/openssl:masterfrom
gkarat:pr-ci-on-demand-2027gkarat/openssl:pr-ci-on-demand-2027Copy head branch name to clipboard
Closed

ci: add on-demand + auto-on-approval PR CI, piloted on two workflows#32012
gkarat wants to merge 5 commits into
openssl:masteropenssl/openssl:masterfrom
gkarat:pr-ci-on-demand-2027gkarat/openssl:pr-ci-on-demand-2027Copy head branch name to clipboard

Conversation

@gkarat

@gkarat gkarat commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Relates to openssl/project#2027.

What

Adds a mechanism for committers to run selected non-PR workflows against a pull request's code, two ways:

  • On demand — comment /ci <jobs> on a PR (e.g. /ci ct-validation aarch64, or /ci all).
  • Automatically on approval — the wired workflows run when a committer submits an approving review.

How it works

Two controllers plus a shared gate:

  • ci-command.yml — parses /ci, gates on repository write/admin permission, pins the PR head SHA at command time, opens a pending check-run per requested job, and dispatches each workflow with {pr, head_sha, check_run_id}. It never checks out PR code, and the comment body is only ever passed through the API (never into a shell). /ci all requires a nonce confirmation because of its cost.
  • ci-report.yml — completes those check-runs on workflow_run.completed, recovering the routing from a trusted artifact written by the authorize gate, or from the trusted run-name if a run was cancelled while still queued.
  • ci-authorize.yml — a reusable workflow (workflow_call) holding the single copy of the authorize gate (contents: read, no PR checkout). Each wired workflow calls it via uses:; it decides whether the build runs and which commit it builds:
    • approval path → the reviewed commit (review.commit_id, required to equal the PR head);
    • /ci path → the pinned head SHA;
    • schedule / push / ordinary manual dispatch → unchanged behaviour.

Security model

PR code is treated as untrusted regardless of head repository. It runs only on GitHub-hosted, secret-less runners (contents: read, persist-credentials: false). The privileged controllers and the authorize gate never check out PR code.

Gradual rollout

This PR wires only ct-validation and aarch64 — both cheap and GitHub-hosted, and together they exercise the full plumbing plus the trickier per-job guards. The remaining eligible workflows stay schedule-only until they graduate (add them to the controller lists and point their authorize job at the shared reusable workflow).

Checklist
  • documentation is added or updated
  • tests are added or updated

openssl/project#2027. Only ct-validation and aarch64 are wired for now;
the rest stay schedule-only until they graduate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gkarat gkarat self-assigned this Jul 20, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@openssl-machine openssl-machine added the approval: review pending This pull request needs review by a committer label Jul 20, 2026
gkarat and others added 2 commits July 20, 2026 13:52
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gkarat
gkarat requested review from bob-beck, jogme, mbroz and t8m July 20, 2026 12:47
@gkarat
gkarat marked this pull request as ready for review July 20, 2026 12:47
@gkarat
gkarat requested a review from quarckster as a code owner July 20, 2026 12:47
Comment on lines +31 to +32
pull_request_review:
types: [submitted]

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.

IMO this will run it too early. The original idea was to run it when the label approval: done is assigned - i.e. when there are two approvals, not just a single one. Also this will run the job multiple times if multiple approvals are submitted, AFAIK. That's definitely not wanted.

@gkarat gkarat Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I have switched to using approval: done as you suggested. Seems to be the right source of truth (and it also cuts some good bunch of code for ci-authorize)

@levitte
levitte self-requested a review July 20, 2026 12:58
Comment thread .github/workflows/ci-authorize.yml Outdated
Comment thread .github/workflows/ci-authorize.yml Outdated
Comment thread .github/workflows/ci-command.yml
`@${commenter}: \`/ci all\` dispatches **${Object.keys(WORKFLOWS).length} `
+ `workflows** (~**${total} compute-min** per PR). To confirm, comment:\n\n`
+ `\`/ci all confirm ${nonce}\`\n\n_(valid for 60 minutes)_\n`
+ `<!-- ${marker(nonce)} pr=${prNum} sha=${head_sha} by=${commenter} exp=${exp} -->`);

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.

is it really necessary to confirm /ci all?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When we later enable all workflows to be run on PRs, the computing cost of running ci all is quite expensive. I thought of a little confirmation guard to be useful here. But assuming committers member knows what they are doing, we can drop this check

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.

If it can be run only by commiters, I think confirmation is not needed.

Switch the auto trigger from pull_request_review to pull_request: labeled
gated on 'approval: done', so CI runs at the 2-approval merge threshold and
not again on later approvals. The gate trusts the label, scopes to
stale-dismissing base branches, and pins the label-payload head SHA.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gkarat
gkarat requested review from mbroz, quarckster and t8m July 20, 2026 14:13
@quarckster

quarckster commented Jul 21, 2026

Copy link
Copy Markdown
Member

I'm a bit concerned that we keep all this logic in this repository. It's my bad that I didn't read the proposed design in time. But I think implementing this via webhooks and deploying it as a separate service will remove burden from committers to review all the changes which will need to be landed.

@gkarat
gkarat marked this pull request as draft July 21, 2026 12:06
@gkarat

gkarat commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Putting this to draft, let's explore the webhooks path, and I will either close or update this PR.

@mbroz

mbroz commented Jul 22, 2026

Copy link
Copy Markdown
Member

Putting this to draft, let's explore the webhooks path, and I will either close or update this PR.

FIne, but please take this as priority, we really need to run nightly tests on-demand now.

@gkarat

gkarat commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Continued at #32053.

@gkarat gkarat closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: review pending This pull request needs review by a committer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.