Skip to main content

Release the Web and Desktop Apps

Symptoms​

A commit on qubital-apps' main has run on staging, and the team agreed to ship it to the prod web app and the desktop apps.

Impact​

  • Prod web app (https://app.qubital.space): Northflank starts the new version and switches to it once it is ready. Open tabs get it at their next page load.
  • Desktop apps: an app started after the publish finds the update at start: a new major or minor version shows a notice and installs as soon as it has downloaded; a patch asks "Install on next launch" or "Install now". An app already running finds it within 4 hours, downloads it without a word and installs it when it quits. Tell the team before a major or minor.
  • The candidate's desktop apps talk to prod. Whoever tests them signs in to the prod backend, with prod data.

How it all works is in Web and Desktop Release.

Steps​

  1. Backend first, when the web needs a new API.

    1. Release the backend: Release the Backend to Prod.
    2. In a qubital-apps pull request, pin @startingquotechdivision/api-contract to that version in the catalog of pnpm-workspace.yaml, run pnpm install, and commit the bump on its own.
    3. Merge it, and wait for "ci: web app to staging" to deploy it.

    Even without a new API, the pin must be a prod contract: a plain X.Y.Z of the major prod runs, and not above it. A staging pin, 0.0.0-staging.<commit>, is refused. Check both:

    # The app's pin, on main
    git fetch origin && git show origin/main:pnpm-workspace.yaml | grep api-contract
    # What prod's backend runs: its latest release. It prints v6.2.0; the pin has no v: 6.2.0
    gh release view -R StartingQuoTechDivision/qubital-backend --json tagName --jq .tagName
  2. Check that staging is green. Actions → "ci: web app to staging": the newest run on main is green, and the team has checked the change on https://app.qubital-test.com.

  3. Pick the version. It must be above every release tag, every GitHub release (drafts included) and both feeds:

    curl -fsS "https://releases.qubital.space/latest.yml?check=$(date +%s)" | grep '^version:'
    curl -fsS "https://releases.qubital.space/latest-mac.yml?check=$(date +%s)" | grep '^version:'
    gh release list -R StartingQuoTechDivision/qubital-apps --limit 5

    A patch (6.0.3) for fixes, a minor (6.1.0) for new features, a major when the team decides on one. Write it without a v.

  4. Candidate dry run. Actions → "release: web and desktop" → Run workflow. GitHub shows each field by its description, not its name, and the fields always come in this order. The tables give each field's name, then the opening words of its label:

    FieldValue
    Use workflow frommain
    stage ("candidate: build and upload a release…")candidate
    version ("candidate: the version, X.Y.Z…")the version, such as 6.0.3
    commit ("candidate only: the full 40-character SHA…")empty
    dry_run ("candidate: run every check…")checked
    release_summary ("candidate only: optional…")empty

    The run is named release: candidate 6.0.3 (dry run). It checks everything and builds nothing. In the run's summary, every check writes a line; the first Commit line names the commit staging runs now. Copy its full SHA.

  5. Candidate. Run the workflow again:

    FieldValue
    Use workflow frommain
    stage ("candidate: build and upload a release…")candidate
    version ("candidate: the version, X.Y.Z…")the same version
    commit ("candidate only: the full 40-character SHA…")the full SHA from the dry run's first Commit line
    dry_run ("candidate: run every check…")unchecked
    release_summary ("candidate only: optional…")one to three sentences on what changed for users

    Giving the commit keeps this run, and any re-run of it, on the commit the dry run checked, even if staging deploys a newer one meanwhile. The Mac job takes longest: it waits on Apple's notarization. When the run is green, Releases holds a draft v6.0.3 with download links for testing.

  6. Test from the draft's links.

    • Web: the candidate's web image is the one staging ran for this commit. Test it on https://app.qubital-test.com while its /version.json names the commit.
    • Windows: install the .exe on a machine without Qubital (SmartScreen warns: "More info" → "Run anyway"), and once over the version installed now.
    • Mac: install the .dmg on an Apple silicon Mac and on an Intel Mac. Gatekeeper lets it open with no security warning.
    • In the desktop app (it talks to prod): sign in, join an office call with camera, microphone and screen share, and open a space.qubital.app:// link.
    • The notes: edit the draft's text if needed, but keep its first line and the heading "Downloads for testing": publish swaps them for "Live." and "Downloads". A draft whose first line was changed is published exactly as written.
  7. Publish dry run:

    FieldValue
    Use workflow frommain
    stage ("candidate: build and upload a release…")publish
    version ("candidate: the version, X.Y.Z…")the candidate's version
    commit ("candidate only: the full 40-character SHA…")empty
    dry_run ("candidate: run every check…")checked
    release_summary ("candidate only: optional…")empty

    Every label opens with its candidate part; its publish part follows, starting with "publish". Publish refuses a commit or a release_summary: it takes the candidate's commit, and its notes from the draft.

  8. Publish. The same fields, with dry_run unchecked. It deploys the web app, then puts the desktop update live, then tags the commit and publishes the release. The summary's Deploy line names the qubital-infra commit that deployed the web app: keep it for a rollback.

  9. If a step fails, read the failed step's error, fix the cause, then use Re-run all jobs. Never "Re-run failed jobs": every job refuses an attempt whose checks ran in an earlier one. For a wrong input, such as a mistyped version, start a new run instead: a re-run repeats the inputs.

    Job that failedWhat it leavesWhat to do
    Check the candidateNothing, or only the draftFix the cause, then re-run
    Copy the web image into the prod package, Build the Mac app, Build the Windows appThe draft and maybe the prod image tag; nothing on the feedRe-run: it reuses both
    Upload the candidateMaybe some files of the version on the feedRe-run. If the checks refuse with "The feed bucket already holds files of", the version is used up: delete the draft and build the next version
    Fill the draft releaseA complete candidate with the draft's first textDon't re-run (it is refused). Write the draft's text by hand from the run's summary
    Check the publishNothing changed by this attemptFix the cause, then re-run, or build a new candidate when the error says so
    Deploy the web app to prodBefore its deploy step, nothing. After it, prod's web app runs the new version, and the desktop update and the release are not liveRe-run to finish, or roll the web app back with a revert of the deploy commit the error names (Roll Back a Deploy)
    Put the desktop update liveThe web app live; maybe latest/ and latest.yml tooRe-run: each step writes the same again
    Tag and publish the releaseEverything live but the tag or the releaseRe-run. If GitHub refused the tag, first create it by hand as the error says, then re-run

    What a re-run can't finish. A check can turn false after the web deploy, for example a change to production/webapp.json's shared values, a new major of the backend's contract, or a merged change to .github/workflows. Then every re-run is refused at "Check the publish", while prod's web app runs the new version. Unless the error names a fix, such as the tag made by hand, roll the web app back, or build a new candidate whose publish replaces it.

    verify says superseded at "Deploy the web app to prod" when another commit to production/webapp.json went live first. Every re-run fails the same way. To finish: revert the deploy commit in qubital-infra, wait for the revert's verify, then "Re-run all jobs", which deploys again with a commit of its own.

    The tag by hand, when the error asks for it: the error names the tag and the full commit SHA, and at the tag step it prints the whole command. In a clone of qubital-apps, as someone allowed to change workflows (the workflow's own token isn't), replace the version and the commit:

    git fetch origin
    git tag -a v6.0.3 0123456789abcdef0123456789abcdef01234567 -m "Release 6.0.3"
    git push origin v6.0.3

    Then "Re-run all jobs", or run publish again: it finds the tag and goes on.

Verification​

  • Both runs are green, and Releases shows v6.0.3 as Latest.

  • Prod serves the commit, and the feeds serve the version:

    curl -fsS https://app.qubital.space/version.json
    curl -fsS "https://releases.qubital.space/latest.yml?check=$(date +%s)" | grep '^version:'
    curl -fsS "https://releases.qubital.space/latest-mac.yml?check=$(date +%s)" | grep '^version:'
  • Restart a desktop app: it finds the update.

An abandoned candidate​

When a candidate fails its tests, or the team drops it:

  1. Delete its draft: Releases → the draft v<version> → the trash icon → Delete this release. Publish then refuses every publish of that version.
  2. Take a higher version for the next candidate. Its versioned files stay on the feed and its image tag stays in qubital-webapp-prod; nothing points at them.
  3. If its publish had already deployed the web app, prod's web app still runs it: roll it back (Roll Back a Deploy), or publish a newer version, which replaces it.

A waiting candidate also blocks every lower one: publish takes only the highest candidate. So a candidate built above a waiting draft makes that draft unpublishable; delete it.

Escalation​

The team owner (Northflank, qubital-infra and repository owner).