Skip to content

ci: standardize the reusable-workflow caller job id (it is the branch-protection prefix)#5

Open
ywatanabe1989 wants to merge 1 commit into
mainfrom
ci/standardize-caller-job-ids
Open

ci: standardize the reusable-workflow caller job id (it is the branch-protection prefix)#5
ywatanabe1989 wants to merge 1 commit into
mainfrom
ci/standardize-caller-job-ids

Conversation

@ywatanabe1989

Copy link
Copy Markdown
Contributor

Do this before any further migrations, or we mint a problem that gets expensive fast.

The problem

The caller job id is not cosmetic. GitHub names a reusable-workflow calls status check:

"<caller job id> / <job name inside the reusable workflow>"

So the caller job id IS the required-status-check prefix. A repo that names the job test emits test / pytest-matrix-on-ubuntu-py3.11; one that names it pytest-matrix emits pytest-matrix / pytest-matrix-on-ubuntu-py3.11. Different names in different repos means one protection list can never serve the ecosystem — every repo needs a bespoke list, hand-read off a real PR, forever.

This README was the source of the divergence

Its example told every caller to name the job call:

jobs:
  call:                                    # <- becomes "call / pytest-matrix-on-ubuntu-py3.11"
    uses: scitex-ai/.github/.github/workflows/<name>.yml@main

Repos duly invented their own. scitex-writers open migration (scitex-ai/scitex-writer#284) uses test and install-check.

The good news — measured, not assumed

I checked the caller job id of every repo that already calls pytest-matrix.yml. 12 of 13 already use pytest-matrix (scitex-plt, scitex-ssh, scitex-dict, scitex-ui, socialia, scitex-repro, scitex-os, scitex-io, scitex-genai, scitex-dsp, crossref-local, scitex-gists). So this PR ratifies the de-facto convention rather than imposing a new one — it is a no-op for every migrated repo. The only outlier is scitex-writer#284, which is still unmerged, so fixing it costs nothing now.

I also corrected my own first draft here: I had proposed audit as the canonical id for quality-audit.yml, but the repos already migrated use quality-audit. Canonizing my invention would have forced pointless churn. The table below is what is actually deployed.

Changes

  • README: fix the misleading example; pin the canonical job id per reusable workflow with the exact resulting check name (read off the reusables, not guessed).
  • workflow-templates/pytest-matrix.yml: canonical caller stub, so the shape is copied, not invented. Also surfaces under Actions → New workflow in every org repo.
  • pytest-matrix.yml: state the rule in the reusable itself, where an editor will see it.
  • Document the migration rule as RECONCILE, not blanket-flip.
reusable workflow caller job id resulting status check
pytest-matrix.yml pytest-matrix pytest-matrix / pytest-matrix-on-ubuntu-py3.{11,12,13}
import-smoke.yml import-smoke import-smoke / import-smoke-on-ubuntu-py3-12
quality-audit.yml quality-audit quality-audit / audit
rtd-sphinx-build.yml docs-sphinx docs-sphinx / docs-sphinx

Reconcile, do not blanket-flip

Migrating renames a repos checks, so protection must be reconciled in the same change or the repo goes green-but-unmergeable (mergeStateStatus: BLOCKED, every check passing, no error anywhere — verified on scitex-config#23 and scitex-dict#24). But it is not always a flip: an audit of all 71 repos found 33 already have protection set to the post-migration names and need no change at all. Read the emitted names off a real PR, compare against each protected branch (main and develop — they drift), and make them agree.

scitex-dev is called out by name in the README: its protection was deliberately reverted to the bare names as an interim to unblock merges, so it must be flipped to the prefixed names when it migrates. That cost is written down so nobody rediscovers it the hard way.

Relationship to #4

Independent — #4 touches only auto-merge-to-develop.yml and cla.yml. No conflict. #4s dispatch gate is cleared (the org pool now dispatches; scitex-ci too).

…-protection prefix)

The caller's job id is not cosmetic: GitHub names a reusable-workflow call's
status check '<caller job id> / <job name in the reusable>'. So the job id IS
the required-status-check prefix. Repos that pick their own emit check names no
other repo emits, and one protection list can no longer serve the ecosystem —
each repo needs a bespoke list, hand-read off a real PR, forever.

This README was the source of the divergence: its example told every caller to
name the job 'call'. Repos duly invented their own (scitex-writer's open
migration uses 'test' -> 'test / pytest-matrix-on-ubuntu-py3.11', while
scitex-config and scitex-dict emit 'pytest-matrix / ...').

- Fix the README example and pin the canonical job id per reusable workflow,
  with the exact resulting check name (read off the reusables, not guessed).
- Add workflow-templates/pytest-matrix.yml as the canonical caller stub, so the
  shape is copied rather than invented (it also appears under Actions -> New
  workflow in every repo).
- State the rule in pytest-matrix.yml itself, where an editor will see it.
- Document the migration rule as RECONCILE, not blanket-flip: 33 repos already
  have protection set to the post-migration names and need no change; others
  still carry the pre-migration names and do. Note scitex-dev by name — its
  protection was deliberately reverted to the bare names as an interim, so it
  must be flipped back to the prefixed names when it migrates.
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