R58 Release only a commit whose CI on the main branch passed on the first attempt

Off by default

Release only a commit whose CI run for its push to the main branch succeeded on its first attempt.

Reason

A run that passed only when run again may have passed with whatever made it fail the first time still there, so its success does not show that the commit is sound (Art. VII §2). Whether a release goes ahead at all is decided by rule 32; this rule decides which commit it may be, from the result as actually looked up (Art. VII §1(2)).

Verification

What counts as a release is set by rule 32. The run in question is the one that the push of the commit to the main branch started, of the workflow whose result the repository takes as CI’s verdict on a commit (where a pull request must pass a check, the workflow that holds that check). Before releasing, the agent looks up that run and its attempt number: it complies when the run concluded in success on attempt 1. When there is no such run, the run was cancelled, it did not succeed, or its attempt number is above 1, the agent does not release that commit; it waits while the run has not finished, or releases a later commit of the main branch that complies. Running CI again at release time does not replace that run.

Where no CI runs on pushes to the main branch, this rule asks nothing.

Violated when an agent releases a commit whose run does not meet the condition above.

Provisions of the constitution it cites

Relations

Parent
R276 CI and Releases
Requires
none
Conflicts with
none

Metadata

ID
58
Revision
5
Kind
rule
Status
trial
Slug
release-first-green-commit
Default level
project
Constitution revisions
>=1
Check
builtin
Default
off
Uses
Instructions instructions
Original language
English en
Translations
Chinese zh