Skip to content

ci: three tiers (quick, queue, full) and a nightly full scan of develop - #2162

Merged
HuiJun merged 6 commits into
developfrom
ci/three-tiers-nightly-full-scan
Nov 12, 2026
Merged

HuiJun merged 6 commits into
developfrom
ci/three-tiers-nightly-full-scan

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

CI runs in three tiers now, so the merge queue stops paying for the race detector over the examples/ sweeps and the whole corpus on every landing, while the full scan keeps a home on a schedule and on release. PR 3 of the three-PR plan ("Load once, check many" and the construct-cover subset are the sibling PRs).

Event Tier Race detector Corpus the examples/ sweeps walk Go test job name
A push to a pull request quick (as today) none whole Go tests (…)
merge_group queue every shard but the sweep shards construct-cover subset (OPENSYSML_CORPUS_SUBSET=construct-cover) Go queue tests (…)
Label ci:full, an unclaimed path, workflow_dispatch of pr.yml, the nightly full scan full (today's full tier) every shard whole Go race tests (…)
  • scripts/race-shard.sh --sweeps prints the shards that hold the examples/ sweeps, one per line: export-corpus export-settled export-examples corpus-roundtrip corpus-apijson. make test-queue SHARDS=… (new) and pr.yml read that list; nothing hard-codes it. export-library is not a sweep shard: its one test (TestLibraryFilesComeBackFromTheGraphAlone) walks the bundled libraries, not examples/, so the subset cannot shrink it and dropping -race would only lose coverage (the brief listed it; the test says otherwise). grpc and translate are not sweep shards either: tests/grpc's element-properties agreement shares its shard with internal/frontend/grpc (a concurrent server) and internal/translate/export's symbol-structure sweep shares its package with the writers, so both keep -race in the queue tier rather than dropping the race detector from race-prone tests. Splitting those two sweeps into shards of their own is PR 1's natural move once the sweeps are consolidated; they then join --sweeps.
  • scripts/ci-changed-areas.sh decides the tier from the event (CI_EVENT), the label (CI_FULL_LABEL) and the paths; CI_TIER=quick|queue|full forces it (a dispatch's tier input). A merge-group commit is always queue, including over an unclaimed path (the pull request already ran full on that push).
  • pr.yml gains workflow_dispatch (input tier, default full; the ref is the dispatched ref, so the Build and test check lands on the commit tested). .github/workflows/full-scan.yml runs at 12:07 UTC — the hour with the fewest pr.yml runs in the last week (12, against 50–57 at the busy hours) — checks out develop, asks scripts/ci-verified-tree.py --sha <head> --full-tier, and dispatches pr.yml --ref develop -f tier=full only when the head has no full-tier run yet. It dispatches rather than workflow_calls: a called workflow's check runs take the caller's job name, and verify-tree looks for Build and test and Go race tests (…) by name.
  • scripts/ci-verified-tree.py: a develop push (CircleCI build-test, --branch develop from CIRCLE_BRANCH) accepts a queue-tier or full-tier GitHub run; a main push (--branch main) accepts only a full-tier run, since a tag may rely on main's build-test; --tag accepts only a full-tier run or a green CircleCI build-test of main; --full-tier (the nightly's question) accepts only a full-tier run. The docstring says which caller accepts which and why. CircleCI's go-race-test, go-coverage and the release workflow are untouched: no subset, no dropped -race, so a push to main and an unverified tag still run everything.
  • Policy change the maintainer chose: the apijson-differential job (Derived-property differential reproduces its baseline, 18–25 min) skips the queue tier — the merge group's diff is the one the PR push already ran it over — and .github/workflows/pr.yml leaves apijson_pattern, so a workflow-only PR no longer runs the 20-minute job for nothing (ci(pr): every pull-request push runs the quick tier; the -race suite runs in the merge queue #2154 and this PR did). It still runs on a PR push whose diff can move the baseline and under the full tier (nightly, ci:full, unclaimed path, dispatch); a stale baseline on develop is re-recorded through ci:rebaseline (.github/workflows/rebaseline.yml). Test cases: writer change on a PR push → apijson, same diff under merge_group → none, under ci:full/schedule/workflow_dispatch → apijson; pr.yml-only PR push → none.
  • The static job's two whole-corpus round-trip gate steps (RDF, api-json) take the subset under the queue tier too; every other gate there runs in both queue and full.
  • tests/hygiene: the merge-group workflow tests follow the new shape (CI_EVENT/CI_FULL_LABEL/CI_TIER, the three make targets per tier, the pull_request-keyed concurrency group); new tests hold --sweeps to by-test-name race shards and make test-queue to reading it, pr.yml's dispatch input, full-scan.yml's dispatch, and the job-name prefixes ci-verified-tree.py reads.
  • Docs: CONTRIBUTING.md "GitHub Actions" (the tier table, where the full scan runs, what the queue tier does not do), docs/project/releasing.md, docs/project/nightly.md, AGENTS.md.

Shared contract notes. Unchanged: OPENSYSML_CORPUS_SUBSET (unset = whole corpus), tests/corpus/testdata/construct_cover.txt, scripts/race-shard.sh --sweeps. One detail for PR 2: pr.yml sets OPENSYSML_CORPUS_SUBSET to the empty string on the two static-job gate steps outside the queue tier (a YAML env key cannot be omitted conditionally), so the tests must treat an empty value as unset. Until PR 2 lands the variable is ignored, so the queue tier is safe to ship first; until PR 1 lands --sweeps prints today's shard names.

How it was verified

Measured from the GitHub API (job minutes = sum of non-skipped job durations):

Run Event / tier Jobs Job-minutes Wall
43117401714 (develop, #2154) merge_group / full 42 397 66 min
43106628831 (develop, #2143) merge_group / full 42 437 68 min
43108494609 (#2154 push) pull_request / quick 19 130 39 min

The five sweep shards cost 96 job-minutes under -race in both full runs (export-corpus 34, export-settled 20–21, corpus-apijson 16–20, export-examples 12, corpus-roundtrip 11–14). Race-free over the whole corpus the same tests took ~15 job-minutes in the quick run (grouped, including setup), so five separate race-free jobs are ~20–25 job-minutes before PR 2 and ~16 once the subset (89 of 920 files) cuts the test time to setup cost. The static job's two round-trip gates drop ~4 more minutes under the subset. Queue tier estimate: ~315–335 job-minutes (–20% to –23%) per landing; the longest job is unchanged (rest, 24–34 min, then graph 23–26), so wall time on an idle pool stays ~35 min and the saving shows as less contention for the 20 slots. The full tier's job-minutes and wall are unchanged; it now runs once a night on develop plus on ci:full, instead of on every landing.

Gates run on this head:

  • scripts/ci-changed-areas-test.sh — all cases, with the new ones (including the apijson-per-tier cases above): pull_request → quick, pull_request+ci:full → full, merge_group → queue (also over an unclaimed path), schedule → full, workflow_dispatch → full, unclaimed → full on a pull request, forced CI_TIER=queue.
  • python3 scripts/ci-verified-tree-test.py — 20 tests (queue-tier run verifies --branch develop, not --branch main, not a tag, not --full-tier; a full-tier run beside a queue one verifies each).
  • go test -count=1 ./tests/hygiene — green, including the updated merge-group tests and the new TestSweepShardsAreByNameRaceShards, TestPRWorkflowAcceptsADispatchedTier, TestFullScanDispatchesTheFullTierOnAnUnprovenHead, TestVerifiedTreeReadsTheGoTestJobNames.
  • make test-quick SHARDS=graph — ok (395 s); make test-queue SHARDS=corpus-roundtrip — takes the sweep branch (Running Go tests, shard corpus-roundtrip over the construct-cover corpus subset…, no -race), ok; make -n test-queue SHARDS="export-corpus graph" shows graph taking the -race branch.
  • scripts/race-shard.sh --sweeps, scripts/race-shard.sh graph, the usage line; GH_TOKEN=… python3 scripts/ci-verified-tree.py --sha <develop head> with and without --full-tier/--tag against the live API (develop's head reads verified … (full tier) from today's merge-queue run).
  • actionlint on pr.yml (only the two pre-existing shellcheck notes) and full-scan.yml (clean); gofmt -l, go vet ./tests/hygiene, python3 scripts/changelog.py check, python3 scripts/check-doc-links.py, python3 scripts/check-doc-ids.py.

Not exercised here: a real merge_group run under the new tier and the first scheduled dispatch; both are the merge of this PR and the following night.

Checklist

  • make test and make lint pass locally (the shards and gates above; no Go production code changes)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (none moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

The merge queue runs the queue tier: every shard under -race but the examples/ sweeps (scripts/race-shard.sh --sweeps, make test-queue), which run race-free over the construct-cover subset. The full tier (everything under -race over the whole corpus) runs on ci:full, an unclaimed path, workflow_dispatch and nightly over develop's head (full-scan.yml, skipping a head that already has one). scripts/ci-verified-tree.py accepts a queue-tier run for develop's CircleCI build-test skip and only a full-tier run (or main's build-test) for a tag.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits November 12, 2026 01:04
…main's needs the full tier

A tag accepts a green build-test of main as proof, so main's own skip must rest on a full-tier run; verify-tree passes CIRCLE_BRANCH as --branch.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 4 findings. Devin automatically fixed all 4 findings.

Fixed by Devin (4)
  • Queue-only evidence certifies release commits — verify-tree now passes CIRCLE_BRANCH as --branch; only develop accepts a queue-tier run, main's build-test (which a tag may rely on) needs the full tier. Tests and docs updated.
  • Oversized nightly workflow comment — full-scan.yml introduction cut to two lines; the dispatch-vs-workflow_call note moved to a two-line step comment.
  • Oversized tier introduction comment — pr.yml tier introduction cut to two lines, separated from the existing header by a blank line.
  • Oversized tier selection comment — ci-changed-areas.sh tier comment cut to two lines, separated from the existing header by a blank line.

View findings in Devin Review · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 3 commits November 12, 2026 01:11
…e queue tier

Its one test walks the bundled libraries, which the construct-cover subset cannot shrink.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
The apijson area is true only under the full tier (nightly, ci:full, an unclaimed path, a dispatch): a writer change on a pull-request push or in the merge queue no longer runs the 18-25 minute job; a stale baseline is re-recorded through ci:rebaseline.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ow-only changes, runs on pushes as before

The merge group's diff is the one the pull request's push already ran it over, and a pr.yml-only change cannot move the baseline; the full tier (nightly, ci:full) reproduces it, a stale one is re-recorded through ci:rebaseline.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun added this pull request to the merge queue Nov 12, 2026
Merged via the queue into develop with commit 66a5582 Nov 12, 2026
31 checks passed
@HuiJun
HuiJun deleted the ci/three-tiers-nightly-full-scan branch November 12, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant