Repository navigation
ci(nightly-testing): guard the bump-branch steps when the nightly bump branch exists - #914
jessealama wants to merge 2 commits into
Conversation
|
🤖 Claude says: Narrowing Could you add a catch-all as the last step? - name: Send warning message on Zulip on any other failure
if: >-
(failure() || cancelled())
&& steps.latest_bump_branch.outcome != 'failure'
&& steps.bump_version.outcome != 'failure'with a generic "the bump job failed before reaching PR creation" body and a link to the run. Skipped steps are fine here, since a skipped step's Two things I noticed while reading, neither blocking:
|
|
@kim-em I've added a catch-all as the last step, with your condition as well as a generic message and link. It'll be worth keeping our eye on the message to make sure it's useful and doesn't become recurring spam. I also take your second point. Both scripts now record a Agreed the |
|
I'm somewhat inclined to not touch this, as it seems we could just go ahead and remove the "CSLib Status Updates" thread completely in favor of the |
|
I'm happy to drop this! I've also been watching the downstream-lean4 stuff and am happy to see things get consolidated. |
…eanprover#939) On a `workflow_run` event, `github.sha` is the head of the default branch, not the commit whose CI run failed. The failure message posted to Zulip therefore linked the wrong commit. Use `github.event.workflow_run.head_sha` instead, matching the run link, which already uses `workflow_run.id`. Pointed out by @kim-em in leanprover#914.
`Exception` is not defined in JavaScript, so this `throw` would raise a `ReferenceError` with a misleading message instead of the intended one. This is a latent bug: the path is only reached when no `bump/v4.x.0` branch exists, and no CI run appears to have actually hit it. Cslib inherited the same line from this workflow and is fixing it in leanprover/cslib#914.
`Exception` is not defined in JavaScript, so `throw new Exception` causes an unintended `ReferenceError` exception to be thrown. The error is reached only when the bump branch doesn't exist. I couldn't find any CI run that actually hit this issue. The JS code is problematic nonetheless and should be fixed. NB: CSLib has the same issue. A fix is in leanprover/cslib#914.
|
Converting to draft while we get acquainted with the new downsteam CI setup. I'll see whether the idea contained in this PR might apply in that setting. |
…p branch exists The "Exit if matching branch exists" step ran `exit 0`, which only ends that step, so the two following github-script steps ran unguarded. If no bump/v4.x.0 branch existed, the first of them threw and the `if: failure()` Zulip warning posted a misleading message about a toolchain pattern mismatch. Drop the no-op step and guard both fetch steps on the branch check, matching every later step. Post a dedicated Zulip warning when no bump/v4.x.0 branch is found, and only post the pattern-mismatch warning when the toolchain fetch step itself failed. Also replace `new Exception`, which is a ReferenceError in JavaScript, with `new Error`.
… reasons Narrowing the toolchain warning to `steps.bump_version.outcome == 'failure'` left every other step in the job (app token, checkout, tag update, Zulip status post, branch check, PR creation setup) with no notification at all. Add a final catch-all step that posts a generic warning with a link to the run whenever the job fails or is cancelled and neither of the two dedicated warnings fired. Both `latest_bump_branch` and `bump_version` can fail for several reasons, but their warnings named a single cause. Record a `reason` output at each failure point in the scripts and include it in the warning, and reword the step names and messages so they no longer claim more than the script actually determined.
c53bf09 to
265899e
Compare
The "Exit if matching branch exists" step did
exit 0, which only ends that step. Since a zero exit is a success, the job simply moved on and the subsequent steps ran. When nobump/v4.x.0branch existed, the first of them threw, and theif: failure()Zulip warning could post a misleading message about a toolchain pattern mismatch, but the real reason was the non-existence of the proper branch.This PR drops the no-op step and guards both fetch steps on the branch check, as other later step already are. Post a dedicated warning to Zulip when no
bump/v4.x.0branch is found, and only post the toolchain warning when the toolchain fetch step itself failed.Also replace
new Exception, which is aReferenceErrorin JavaScript, withnew Error.Exceptiondoesn't exist in JS. So, curiously, running this code caused a different kind of exception to be thrown (aReferenceErrorfor referring to something that doesn't exist), which ended up killing the step as intended, but for the wrong reason.