Skip to content

🌱 Skip heavy CI jobs on refresh-only pull request heads #19276

Closed

Description

@clubanderson

Problem

Every hive App base refresh of a pull request ("Merge branch 'v5' into ...", authored by the App and signed by GitHub) is a new head, so every pull_request workflow reruns: about 16 workflows and 38 runner-minutes per refresh. 133 refreshes landed in 48 hours. The heaviest jobs on such a head are the Docker multi-arch build (about 8.7 minutes), FOSSA (about 6.8 minutes) and Mutation (about 3.2 minutes), and none of them can find anything new when the PR content did not change.

Proposal

Detect a refresh-only head inside the jobs (not with trigger paths: filters, so required contexts still attach to every head) and skip only the heavy jobs:

  • the new head is a GitHub-verified two-parent merge authored by the hive App, with the previous head as one parent and a base-branch commit (the merge-base) as the other, mirroring HeadIsBaseRefreshOf in src/pkg/github/pr_decision_base_refresh.go;
  • its three-dot diff against the base is identical, blob for blob, to the previous head's;
  • the same workflow already passed on the previous head (walking back through at most 5 earlier verified refreshes when the previous run was cancelled);
  • the base delta touches no go.mod/go.sum, other dependency manifest, Dockerfile, src/deploy/, workflow or action definition, or the detector itself.

When all hold: skip the docker.yml build jobs (the required gate still reports success), the FOSSA scan steps and the Mutation run, each with a skipped: refresh-only head step summary. build-and-test, test shards and coverage keep running. Any doubt or lookup failure runs everything.

Acceptance

  • Helper under .github/scripts/ (not src/scripts/, which is pinned by TRUSTED_SCRIPTS_TREE), with a fixture test wired into CI.
  • Rule documented in the CI docs.

Activity

  1. self-assigned this
    on Nov 19, 2026
  2. clubanderson commented on Nov 19, 2026

    @clubanderson
    MemberAuthor

    Claiming: working on this now, PR to follow.

  3. clubanderson commented on Nov 19, 2026

    @clubanderson
    MemberAuthor

    PR: #19277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions