A self-improving RLM agent for coding workflows and long-running autonomous tasks.
Rust
fix the nightly refresh on green beta releases (#3239)
kta2fa2d8ea60d
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 486bf6befc..d6a22dc02b 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -917,7 +917,21 @@ jobs:# refuses to clobber a newer rolling beta.json (re-runs of older tags).nightly-refresh:needs: promote- if: contains(github.ref_name, '-')+ # THE GATE IS EXPLICIT (the promote precedent: an `if` without a status+ # function is auto-prefixed with success(), and GitHub's default needs+ # gate skips every job downstream of a skipped job in the dependency+ # chain). On a -beta* tag the two stable-route build jobs skip themselves+ # by their own gates; they are promote's needs and therefore this job's+ # TRANSITIVE needs, so the bare `if: contains(github.ref_name, '-')` that+ # lived here skipped the refresh on every+ # green beta promote since the flow went live - the rolling `nightly`+ # release never materialized (releases/tags/nightly 404s) while the+ # per-tag prereleases and the R2 beta.json published and the payload+ # uploaded inside the same green promote. The explicit form admits+ # exactly the one healthy state: a green promote - the only producer of+ # the nightly-refresh-payload artifact - on a -beta* tag. A failed,+ # skipped, or cancelled promote leaves the refresh skipped.+ if: ${{ !cancelled() && needs.promote.result == 'success' && contains(github.ref_name, '-') }}name: rolling nightly release refresh (the nightly channel's discoverable base)concurrency:group: rolling-nightly-refresh@@ -934,6 +948,13 @@ jobs:- name: Refresh the rolling nightly releaseenv:GH_TOKEN: ${{ github.token }}+ # gh resolves the repo from the git remote - absent: this job never+ # checks out - or GH_REPO, and never from GITHUB_REPOSITORY, so+ # without this row every `gh release ...` call below dies with+ # "failed to run git: not a git repository" (probe-pinned: the gate+ # fix alone let the job run and its first gh call failed exactly+ # so).+ GH_REPO: ${{ github.repository }}run: |set -euo pipefail# The rolling update channel distributes tarballs only. Per-tagdiff --git a/crates/pa-core/tests/release_channel_manifest.rs b/crates/pa-core/tests/release_channel_manifest.rsindex 01675dba62..8ed1f75f06 100644--- a/crates/pa-core/tests/release_channel_manifest.rs+++ b/crates/pa-core/tests/release_channel_manifest.rs@@ -76,6 +76,8 @@ struct Step {run: Option<String>,#[serde(default)]with: Option<With>,+ #[serde(default)]+ env: Option<BTreeMap<String, String>>,}#[derive(serde::Deserialize)]@@ -301,8 +303,17 @@ fn the_rolling_nightly_refresh_is_a_serialized_job() {.expect("the nightly-refresh job exists");assert_eq!(refresh.r#if.as_deref(),- Some("contains(github.ref_name, '-')"),- "only -beta* tags refresh the rolling nightly release"+ Some(+ "${{ !cancelled() && needs.promote.result == 'success' \+&& contains(github.ref_name, '-') }}",+ ),+ "the refresh gate is the explicit result form (the promote precedent): \+ an `if` without a status function is auto-prefixed with success(), and \+ the default needs gate skips every job downstream of a skipped job in \+ the dependency chain - on a -beta* tag the two stable-route build jobs \+ are skipped, and as promote's needs they are the refresh's transitive \+ needs, so the bare form skipped the refresh on every green beta \+ promote while the payload uploaded inside the same promote");// The refresh is the workflow's only shared mutable state, so it alone// serializes (a queued refresh superseded by a newer tag is harmless:@@ -317,7 +328,27 @@ fn the_rolling_nightly_refresh_is_a_serialized_job() {"the refresh serializes in its own group");assert!(refresh.needs.is_some(), "the refresh needs the promote job");- let run = step(refresh, "Refresh the rolling nightly release")+ // The refresh step's gh calls are repo-relative (gh release view /+ // download / upload / create) and this job never checks out: gh resolves+ // the repo from the git remote or GH_REPO - never from GITHUB_REPOSITORY+ // - so the GH_REPO row is load-bearing. Probe-pinned: with the gate+ // fixed but GH_REPO absent, the job's first gh call fails with+ // "failed to run git: not a git repository".+ let refresh_step = step(refresh, "Refresh the rolling nightly release");+ let refresh_env = refresh_step+ .env+ .as_ref()+ .expect("the refresh step declares env");+ assert_eq!(+ refresh_env.get("GH_REPO").map(String::as_str),+ Some("${{ github.repository }}"),+ "the refresh step pins the repo for gh (no checkout, no git remote)"+ );+ assert!(+ refresh_env.contains_key("GH_TOKEN"),+ "the refresh step carries the workflow token"+ );+ let run = refresh_step.run.as_deref().expect("the refresh step runs a script");