Skip to content

fix(ci): migrate privileged PR automation - #551

Merged
sudhirverma merged 4 commits into
mainfrom
fix/aap-103650-ack-workflow
Dec 4, 2026
Merged

sudhirverma merged 4 commits into
mainfrom
fix/aap-103650-ack-workflow

Conversation

@shvenkat-rh

@shvenkat-rh shvenkat-rh commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Migrate PR classification to a read-only pull_request ACK check and a trusted workflow_run updater. The updater re-fetches the source run and current PR through GitHub's API, validates repository/workflow/branch/head SHA, and authorizes writes only after a successful ACK run. No pull_request_target event trigger remains in this repository.

The new ack-check.yml reusable interface and direct ack-pr.yml entry use identical classification logic, enforced by a parity test. Privileged labeling never checks out PR code or consumes PR artifacts. Extra-label regex rules have type/count/size limits and a 100 ms evaluation limit before any mutation. Both the new and compatibility bot auto-merge paths use a head-SHA guard. The reusable updater deliberately retains the caller's workflow_run/issues event boundary; ordinary PR/manual callers cannot authorize writes.

Add coverage.yml for API-validated Sonar processing and coverage-run.yml to connect this repository's completed test runs to it. Artifacts come only from the validated source run and are isolated from checkout. Scanner settings are allowlisted from the default branch; credentials are not persisted and dependency/SCA execution is disabled. Missing, ambiguous, closed, superseded, or changed PR identity now fails before scanning or publishing a source check, avoiding green no-analysis wrapper results. Trusted non-PR source events and optional source-commit checks remain supported.

Retain the legacy reusable ACK/finalize contracts and pr_number producer for existing external consumers. This repository's new coverage caller does not consume the legacy PR-number artifact. The audit records affected external consumers beyond the 13 coordinated PRs; it does not claim their migrations are complete.

Validation: full-tree tox -e lint passes. Full CI-mode tox -e py passes: 114 passed, 102 live GitHub-mutating cases skipped, coverage threshold met. Actionlint passes for every changed/new workflow. Regression coverage includes failed-run rejection, head guards, malformed/oversized/pathological regexes, classification parity, caller event context, missing/ambiguous/changed identities and the direct in-repository ACK source-path default, and own-repository coverage wiring.

Rollout: merge this shared implementation before the caller PRs. Re-pin all coordinated callers to the final reviewed shared revision before merging them. Trusted follow-ups only run once their definitions exist on the default branch. Verify same-repository and fork PR classification/label writes, stale-head rejection, optional project/bot credentials, required-check names, merge queues, and Sonar/default-branch behavior. Production smoke evidence remains pending; local tests and pre-migration green runs do not establish live permissions or secret configuration.

The compatibility ACK display name is now ack compatibility, with a Bot-type and head-SHA guard on legacy auto-merge. The migration guide records the scoped Sonar privileged-checkout control review, exact pinned action sources inspected, controls, residual analyzer risk, and conditions requiring renewed review. CodeQL alert #66 was dismissed as a false positive for that data-only scanner path; this does not waive live rollout verification.

Related: AAP-103650

Document the workflow-specific policy required for fork PR metadata
automation and align caller permissions with the shared workflow.

Related: AAP-103650
Assisted-by: OpenAI Codex
Split read-only ACK checks from trusted workflow-run labeling and bot automation. Add API-validated coverage processing with trusted scanner settings and isolated artifacts, while retaining legacy interfaces for other teams.

Related: AAP-103650

Assisted-by: OpenAI Codex
@shvenkat-rh shvenkat-rh changed the title chore: audit privileged ack workflow fix(ci): migrate privileged PR automation Dec 3, 2026

@sudhirverma sudhirverma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Deep review (Security / Functionality / Quality)

Critical and important blocking findings only. Inline comments are on the cited lines.

Note: tox.yml / finalize.yml caller wiring is not in this diff — rollout gap called out on coverage.yml.

Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/ack-pr.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/coverage.yml Resolved
Comment thread .github/workflows/coverage.yml Resolved
Comment thread .github/workflows/ack.yml Resolved
Comment thread .github/workflows/ack-pr.yml Resolved
Reject failed ACK runs, bound extra-label matching, guard legacy auto-merge by SHA, and add the in-repository trusted coverage caller. Test classifier parity and caller-event boundaries; reject ambiguous coverage identity while skipping superseded runs.

Related: AAP-103650

Assisted-by: OpenAI Codex
@github-actions github-actions Bot added the fix label Dec 4, 2026
Comment thread .github/workflows/coverage.yml Dismissed
Comment thread .github/workflows/coverage.yml Resolved
Comment thread .github/workflows/ack.yml Resolved
Comment thread .github/workflows/ack-pr.yml Resolved
Comment thread .github/workflows/ack.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread .github/workflows/coverage.yml Resolved
Comment thread .github/workflows/coverage.yml Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Comment thread test/test_ack_workflows.py Resolved
Comment thread .github/workflows/ack-update.yml Resolved
Guard legacy auto-merge by bot type, disambiguate compatibility workflow naming, test the direct ACK source-path default, and record the scoped Sonar control review.

Related: AAP-103650

Assisted-by: OpenAI Codex
@sudhirverma
sudhirverma merged commit 5c30159 into main Dec 4, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in 🧰 devtools project board Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants