Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(release-cut): report a tag that never gets published (#949)

Ruben Lütkefdeb4282459e
diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml
index 66e33f07bf..888ac9bc1e 100644
--- a/.github/workflows/release-cut.yml
+++ b/.github/workflows/release-cut.yml
@@ -75,6 +75,8 @@ jobs:
checks: read
outputs:
version: ${{ steps.bump.outputs.version || steps.resume.outputs.version }}
+ # The public v* tag exists from here on (pushed now or by an earlier run).
+ tagged: ${{ steps.tag.outcome == 'success' }}
env:
# Reads and dispatches use GITHUB_TOKEN. Each write step overrides
# GH_TOKEN with a bot token minted right before it: an installation
@@ -309,6 +311,48 @@ jobs:
--repo "$GITHUB_REPOSITORY" --tag "v$V"
--sha "$(git rev-parse HEAD)" --wait-minutes 150
+ # The tag is immutable, but everything after it can still fail: a flaky tag
+ # CI run, a publisher (for example a new advisory in the publish-time
+ # dependency audit) or finalization. The version then stays an unpublished
+ # draft that no updater sees, and nothing retries it (v3.1.0, v4.0.0 and
+ # v4.1.0 stayed drafts this way, unnoticed). Say so in one issue per version,
+ # with the recovery steps.
+ stranded:
+ name: report a stranded tag
+ needs: [cut, publish]
+ if: always() && needs.cut.outputs.tagged == 'true' && needs.publish.result != 'success'
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ permissions:
+ issues: write
+ steps:
+ - name: Open or update the stranded release issue
+ env:
+ GH_TOKEN: ${{ github.token }}
+ V: ${{ needs.cut.outputs.version }}
+ PUBLISH_RESULT: ${{ needs.publish.result }}
+ RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ run: |
+ title="Release v$V is tagged but not published"
+ body="Release cut $RUN_URL pushed the immutable tag \`v$V\`, but publishing ended with \`$PUBLISH_RESULT\`. The GitHub Release stays a draft, so the in-app updater and the installers do not see v$V.
+
+ To recover (docs/ci-pipeline.md):
+ 1. Find the red run: tag CI (\`gh run list --workflow ci.yml --branch v$V\`) and the publishers Release to PyPI, Desktop installers and Sign installer (\`gh run list --branch v$V\`).
+ 2. A flaky failure: \`gh run rerun <run id> --failed\`, tag CI first, then each failed publisher. A rerun reuses the original build artifacts.
+ 3. Finalize: rerun the failed \`publish GitHub Release\` job of the Release cut run, or \`gh workflow run release-finalize.yml --ref main -f tag=v$V\`.
+ 4. If a publisher cannot pass for this commit (a real test failure, or a new advisory in the dependency audit), fix main and cut the next patch release instead. v$V then stays a draft.
+
+ Close this issue once v$V is published or superseded."
+ # Search narrows the list; the exact title decides (v4.1.0 vs v4.1.1).
+ existing="$(gh issue list --repo "$GITHUB_REPOSITORY" --state open --search "\"$title\" in:title" \
+ --json number,title --jq "map(select(.title == \"$title\")) | .[0].number // empty")"
+ if [ -n "$existing" ]; then
+ gh issue comment "$existing" --repo "$GITHUB_REPOSITORY" --body "$body"
+ else
+ gh issue create --repo "$GITHUB_REPOSITORY" --title "$title" --body "$body"
+ fi
+ echo "::error::v$V is tagged but not published; recovery steps are in the issue \"$title\"."
+
# Read-only proof that what users now download installs: assets, checksums,
# build provenance and the signed wrapper on Linux, Windows and macOS. Called
# from here because a release published with GITHUB_TOKEN fires no `release`
diff --git a/docs/ci-pipeline.md b/docs/ci-pipeline.md
index 6d3f2f75b7..652c880cfe 100644
--- a/docs/ci-pipeline.md
+++ b/docs/ci-pipeline.md
@@ -470,6 +470,10 @@ A release happens **only** when the maintainer asks for one.
this same uploader, so a publisher retry cannot revert visibility to draft.
Re-run failed jobs with their original build artifacts to recover a partial
upload; a full rebuild with different bytes requires an explicit decision.
+ When a release cut pushed its tag but publishing did not succeed, its
+ `stranded` job opens (or comments on) the issue "Release vX.Y.Z is tagged
+ but not published" with these recovery steps, so a draft behind a public
+ tag never goes unnoticed.
The in-app updater follows `releases/latest`; draft releases remain hidden.
* **Two names per installer.** Every native installer is published as
`Dodaios-*` and, with identical bytes, under its earlier `PersonalJarvis-*`
diff --git a/tests/unit/ci/test_release_cut_workflow.py b/tests/unit/ci/test_release_cut_workflow.py
index 461ec2b190..42a1c599ac 100644
--- a/tests/unit/ci/test_release_cut_workflow.py
+++ b/tests/unit/ci/test_release_cut_workflow.py
@@ -37,6 +37,8 @@ gh() {
'run list') printf '123\n' ;;
'run view') printf '\n' ;;
'run watch') return "$WATCH_EXIT" ;;
+ 'issue list') printf '%s\n' "$OPEN_ISSUE" ;;
+ 'issue create'|'issue comment') return 0 ;;
api\ *) printf '%s\n' "$GATE_STATE" ;;
*) return 2 ;;
esac
@@ -164,6 +166,53 @@ _DISPATCH = "Dispatch the publishing workflows on the tag"
_PUBLISHERS = "python scripts/ci/release_assets.py dispatch --repo example/project --tag v1.2.3"
+def _release_cut_jobs() -> dict:
+ root = Path(__file__).resolve().parents[3]
+ workflow = yaml.safe_load((root / ".github/workflows/release-cut.yml").read_text("utf-8"))
+ return workflow["jobs"]
+
+
+def test_a_tag_that_does_not_get_published_is_reported():
+ # v3.1.0, v4.0.0 and v4.1.0 stayed drafts behind a pushed tag, unnoticed (#522).
+ jobs = _release_cut_jobs()
+ assert jobs["cut"]["outputs"]["tagged"] == "${{ steps.tag.outcome == 'success' }}"
+ stranded = jobs["stranded"]
+ assert stranded["needs"] == ["cut", "publish"]
+ condition = stranded["if"]
+ # always(): the report must run when publish failed, was skipped or cancelled.
+ assert condition.startswith("always()")
+ assert "needs.cut.outputs.tagged == 'true'" in condition
+ assert "needs.publish.result != 'success'" in condition
+ assert stranded["permissions"] == {"issues": "write"}
+
+
+_STRANDED = "Open or update the stranded release issue"
+_STRANDED_ENV = {"PUBLISH_RESULT": "failure", "RUN_URL": "https://example.test/runs/77"}
+
+
+def test_a_stranded_tag_opens_an_issue_with_the_recovery_steps(tmp_path):
+ result, commands = _exercise(
+ tmp_path, [_STRANDED], job_id="stranded", OPEN_ISSUE="", **_STRANDED_ENV
+ )
+ assert result.returncode == 0, result.stdout + result.stderr
+ trace = "\n".join(commands)
+ assert "gh issue create --repo example/project --title Release v1.2.3 is tagged" in trace
+ assert "gh issue comment" not in trace
+ assert "gh run rerun <run id> --failed" in trace
+ assert "release-finalize.yml --ref main -f tag=v1.2.3" in trace
+ assert "::error::v1.2.3 is tagged but not published" in result.stdout
+
+
+def test_a_second_failure_for_the_same_tag_comments_on_the_open_issue(tmp_path):
+ result, commands = _exercise(
+ tmp_path, [_STRANDED], job_id="stranded", OPEN_ISSUE="42", **_STRANDED_ENV
+ )
+ assert result.returncode == 0, result.stdout + result.stderr
+ trace = "\n".join(commands)
+ assert "gh issue comment 42 --repo example/project" in trace
+ assert "gh issue create" not in trace
+
+
@pytest.mark.parametrize("token_is_bot", ["true", "false"])
def test_landing_always_dispatches_ci_for_the_merge_commit(tmp_path, token_is_bot):
# A bot merge's push run can be dropped from the main-push group while it