Skip to content

Commit 1b270d7

Browse files
committed
ci(release-plz): run the auth refresh soak only on an armed crates line
The long soak ran on every push matching release-plz.yml's path filter, even when the stack-* crates line is not armed and release-crates is skipped anyway. Give it the same crates-armed gate as release-crates. It still runs before release-crates' preflight asks crates.io whether any version is unpublished, so a failed soak also holds stack-kms and stack-encrypt. Moving that preflight into its own job would let the soak run only for an unpublished stack-auth, but release-crates would then need a status function to run past a skipped soak, which the soak gate test forbids on the publish job. Left as is. eql-pipeline-armed.test.mjs pins exactly which jobs the switch gates; it now lists the soak beside the publish job.
1 parent f5cd428 commit 1b270d7

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎.github/workflows/release-plz.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,14 @@ jobs:
225225
id: armed
226226
run: node scripts/eql-pipeline-armed.mjs crates
227227

228+
# Gated on the switch so an unarmed line spends nothing on the soak. It
229+
# still runs on every armed push, before release-crates' preflight decides
230+
# whether any crate is unpublished, so a failed soak holds stack-kms and
231+
# stack-encrypt too.
228232
auth-refresh-soak:
229233
name: Auth refresh cancellation soak before publishing
234+
needs: [crates-armed]
235+
if: needs.crates-armed.outputs.armed == 'true'
230236
runs-on: ubuntu-latest
231237
timeout-minutes: 60
232238
env:

‎scripts/__tests__/auth-refresh-soak-ci.test.mjs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ describe('auth refresh cancellation soak gates', () => {
4040
expect(
4141
gate.steps.find((step) => step.name === 'Long seeded soak').run,
4242
).toBe('mise run test:soak:stack-auth')
43-
expect(gate.if).toBeUndefined()
43+
// Only an armed line runs the soak; release-crates needs the same switch,
44+
// so a skipped soak never stands in front of a publish.
45+
expect(gate.needs).toEqual(['crates-armed'])
46+
expect(gate.if).toBe("needs.crates-armed.outputs.armed == 'true'")
47+
expect(release.jobs['release-crates'].if).toBe(gate.if)
4448
expect(release.jobs['release-crates'].needs).toContain('auth-refresh-soak')
4549
// No status function bypasses the implicit success() dependency check.
4650
expect(release.jobs['release-crates'].if).not.toMatch(

‎scripts/__tests__/eql-pipeline-armed.test.mjs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ describe('every EQL publish job reads it', () => {
163163
*/
164164
const CRATES_PACKAGE = '@cipherstash/auth'
165165
const CRATES_WORKFLOW = '.github/workflows/release-plz.yml'
166-
const CRATES_GATED_JOBS = [`${CRATES_WORKFLOW} / release-crates`]
166+
// The publish job, and the auth refresh soak it needs: an unarmed line has
167+
// nothing to publish, so it has nothing to soak either.
168+
const CRATES_GATED_JOBS = [
169+
`${CRATES_WORKFLOW} / auth-refresh-soak`,
170+
`${CRATES_WORKFLOW} / release-crates`,
171+
]
167172

168173
describe('the stack-* crates line', () => {
169174
it('keys on the @cipherstash/auth entry', () => {
@@ -212,7 +217,7 @@ describe('the stack-* crates line', () => {
212217
}
213218
})
214219

215-
it('is computed by release-plz.yml and gates exactly the crates publish job', () => {
220+
it('is computed by release-plz.yml and gates exactly the crates publish job and its soak', () => {
216221
const job = readWorkflow(CRATES_WORKFLOW)?.jobs?.['crates-armed']
217222
const runsIt = (job?.steps ?? []).some((step) =>
218223
String(step?.run ?? '').includes('scripts/eql-pipeline-armed.mjs crates'),

0 commit comments

Comments
 (0)