Skip to content

Run autoharness jobs only in the merge queue - #738

Merged
feliperodri merged 5 commits into
model-checking:mainfrom
Tianshu-Huang:ci-autoharness-merge-queue
Nov 2, 2026
Merged

feliperodri merged 5 commits into
model-checking:mainfrom
Tianshu-Huang:ci-autoharness-merge-queue

Conversation

@Tianshu-Huang

Copy link
Copy Markdown

Problem

Five CI jobs (autoharness, metrics, list, analyzer, build JSON) run on every PR push and take about five runner-hours. Every PR waits on them. #730 asks to run them only before merging.

Fix

Add if: merge_group || workflow_dispatch to those five jobs.

Autoharness is a required check, so it cannot be skipped as a whole job: a skipped job loses the (ubuntu-latest) part of its name and the required check never turns green. So for that job the if: is on each step. The job still runs, does nothing, and passes in seconds.

Testing

On my fork, a manual run passed all 16 jobs (run), and a PR skipped the five jobs with the two autoharness required checks green (PR). Did not test merge_group.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@Tianshu-Huang
Tianshu-Huang requested a review from a team as a code owner October 23, 2026 21:45
@feliperodri feliperodri added the Maintenance Maintenance related issues for the challange label Oct 25, 2026
Running autoharness only in the merge queue means a contributor's first
autoharness result arrives after the PR is queued, and a failure ejects it
hours later. workflow_dispatch does not help contributors: it needs write
access and runs on a branch of this repo, not on a fork's PR.

Add the run-autoharness label as a third way to run the autoharness and
metrics jobs: while it is on a PR they run on every push. Adding any label
now triggers the workflow, so the partitions skip label events (they already
ran for that commit) and the autoharness jobs ignore labels other than
run-autoharness.
@feliperodri feliperodri added the run-autoharness Run the autoharness and Kani metrics jobs on this PR before it reaches the merge queue label Oct 30, 2026
@feliperodri feliperodri self-assigned this Oct 30, 2026

@feliperodri feliperodri left a comment

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.

Approving. I pushed two commits on top so contributors can ask for an autoharness run before the merge queue: adding the run-autoharness label runs autoharness and the metrics jobs on the PR, on every push while the label stays. workflow_dispatch doesn't cover this, because it needs write access and runs on a branch of this repo, not on a fork's PR.

Adding any label now triggers the workflow, so the partitions skip label events (they already ran for that commit), and the autoharness jobs ignore labels other than run-autoharness.

Tested on this PR:

  • Push without the label: both autoharness checks pass in seconds with their steps skipped; List, Analyzer, Metrics and Build JSON are skipped; the partitions run (run).
  • run-autoharness added: autoharness runs Run Kani Verification, and Metrics, List and Analyzer run; the partitions skip (run).
  • The merge-queue path gets tested when this PR goes through the queue; I'll check that autoharness actually runs there.

Thanks @Tianshu-Huang!

@feliperodri
feliperodri enabled auto-merge October 31, 2026 00:18
Adding a label started a new run of kani.yml on the same commit, and GitHub
reads required checks from the latest run. That run skipped the partitions
(and, for other labels, the autoharness jobs), so the required checks went
back to "expected" and the PR could not enter the merge queue.

kani.yml no longer reacts to labels. kani-autoharness-request.yml runs on
labeled/synchronize/reopened and, when the PR has run-autoharness, calls
kani.yml with autoharness: true, which runs only the autoharness and metrics
jobs. Its checks are prefixed with the caller job name, so they never
collide with the required ones.
@feliperodri

Copy link
Copy Markdown
Member

Correction to my review: the first version of the label trigger blocked merging. Adding a label started a new run of kani.yml on the same commit, and GitHub reads required checks from the latest run. That run skipped the partitions, so they went back to "expected" (enqueuePullRequest: "4 of 10 required status checks are expected").

Fixed in a6df330: kani.yml no longer reacts to labels. The new kani-autoharness-request.yml runs on labeled/synchronize/reopened and, when the PR has run-autoharness, calls kani.yml with autoharness: true, which runs only autoharness and the metrics jobs. Its checks are named autoharness / …, so they never collide with the required ones. On this commit, the normal Kani run is running the partitions with autoharness skipped, and the request workflow is running autoharness, Metrics, List and Analyzer.

@feliperodri
feliperodri added this pull request to the merge queue Nov 2, 2026
Merged via the queue into model-checking:main with commit 7141021 Nov 2, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance Maintenance related issues for the challange run-autoharness Run the autoharness and Kani metrics jobs on this PR before it reaches the merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants