Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Support RC releases without promoting floating Docker tags (#5905)

Sure Admin (bot)16a66846c4a0
diff --git a/.github/workflows/ios-testflight.yml b/.github/workflows/ios-testflight.yml
index 542af973f8..2566d22b7f 100644
--- a/.github/workflows/ios-testflight.yml
+++ b/.github/workflows/ios-testflight.yml
@@ -44,7 +44,7 @@ jobs:
exit 0
fi
version="${GITHUB_REF#refs/tags/v}"
- if [[ ! "$GITHUB_REF" == refs/tags/v* || ! "$version" =~ ^[2-9][0-9]{3}\.[1-9][0-9]?\.[1-9][0-9]?(-alpha)?$ ]]; then
+ if [[ ! "$GITHUB_REF" == refs/tags/v* || ! "$version" =~ ^[2-9][0-9]{3}\.[1-9][0-9]?\.[1-9][0-9]?(-alpha|-rc\.(0|[1-9][0-9]*))?$ ]]; then
echo "eligible=false" >> "$GITHUB_OUTPUT"
exit 0
fi
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 1a7c5cd84a..0be59c838c 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -105,13 +105,14 @@ jobs:
fi
if [[ -n "$selected_tag" ]]; then
version="${selected_tag#refs/tags/v}"
- [[ "$version" =~ ^[2-9][0-9]{3}\.[1-9][0-9]?\.[1-9][0-9]?(-alpha)?$ ]] || exit 1
+ [[ "$version" =~ ^[2-9][0-9]{3}\.[1-9][0-9]?\.[1-9][0-9]?(-alpha|-rc\.(0|[1-9][0-9]*))?$ ]] || exit 1
base="${version%%-*}"
[[ "$(date -u -d "${base//./-}" +%Y.%-m.%-d)" == "$base" ]] || exit 1
fi
stable=false; alpha=false; compatibility=""
[[ "$version" == *-* ]] || stable=true
- [[ "$version" != *-alpha ]] || alpha=true
+ # Release candidates share alpha deployment/compatibility, not floating tags.
+ [[ "$version" != *-alpha && "$version" != *-rc.* ]] || alpha=true
channel=stable
[[ "$alpha" != true ]] || channel=alpha
if [[ "$GITHUB_EVENT_NAME" == push && "$GITHUB_REF" == refs/tags/* && "$version" == 2026.* && "$channel" == "$COMPATIBILITY_CHANNEL" ]]; then
@@ -134,7 +135,7 @@ jobs:
echo "type=raw,value=$version"
[[ -z "$compatibility" ]] || echo "type=raw,value=$compatibility"
[[ "$stable" != true ]] || echo 'type=raw,value=stable'
- [[ "$alpha" != true ]] || echo 'type=raw,value=latest'
+ [[ "$version" != *-alpha ]] || echo 'type=raw,value=latest'
else
echo "type=raw,value=sha-$(git rev-parse HEAD)"
if [[ "$GITHUB_EVENT_NAME" == schedule ]]; then
@@ -357,7 +358,7 @@ jobs:
deploy_demo:
- name: Deploy alpha to Render demo
+ name: Deploy alpha or RC to Render demo
if: needs.prepare.outputs.release == 'true' && needs.prepare.outputs.alpha == 'true'
needs: [prepare, merge]
diff --git a/docs/hosting/docker.md b/docs/hosting/docker.md
index 4bc4f78192..a970c62319 100644
--- a/docs/hosting/docker.md
+++ b/docs/hosting/docker.md
@@ -517,6 +517,9 @@ We recommend using one of the following images, but you can pin your app to what
- `ghcr.io/we-promise/sure:latest` (latest `alpha`)
- `ghcr.io/we-promise/sure:stable` (latest release)
+Release candidates require an explicit version tag such as `2026.11.30-rc.1`;
+they do not update either `latest` or `stable`.
+
By default, your app _will NOT_ automatically update. Take a backup first (see below), then run:
```bash
diff --git a/docs/releases/versioning.md b/docs/releases/versioning.md
index b14db87524..07dcc17aad 100644
--- a/docs/releases/versioning.md
+++ b/docs/releases/versioning.md
@@ -58,21 +58,27 @@ digests may have been built before that check, but named images and charts have
## Version names
-Use unpadded `YYYY.M.D-alpha` for alpha releases and `YYYY.M.D` for stable releases.
+Use unpadded `YYYY.M.D-alpha` for alpha releases, `YYYY.M.D-rc.N` for
+release candidates (N is a nonnegative integer without leading zeroes), and
+`YYYY.M.D` for stable releases. All use the actual UTC release date.
-**Floating Docker channel promotion is temporarily paused.** Neither release
-updates `latest` or `stable` while we validate the CalVer rollout. Existing channel
-tags are left pointing to their previous images; they are not deleted. Test using
-explicit CalVer image tags (or the temporary versioned compatibility aliases).
-Re-enabling channel promotion requires a separate workflow change after validation.
-Nightly tags and release/deployment jobs are unchanged.
-There are no numbered canonical prereleases, beta/RC tags or hotfix suffixes.
-Only the temporary legacy compatibility alias keeps its old numbered format.
+Alpha releases publish their exact versioned Docker image and update `latest`,
+never `stable`. RC releases publish version-specific tags only: neither `latest`
+nor `stable` moves. Both use the alpha Render deployment path and are marked as
+GitHub prereleases. Stable releases update `stable` and use the stable deployment
+path. The GitHub prerelease checkbox does not override the tag-based workflow classification.
-The date distinguishes releases: publish at most one alpha and one stable per
-UTC day. A retry reuses the same tag and commit; a different release uses a new
-date, not an incremented suffix or a moved tag. Cut release branches as usual;
-daily fixes do not create new ones.
+During the compatibility window, RC releases also use `COMPATIBILITY_CHANNEL:
+alpha`. Advance `COMPATIBILITY_VERSION` to an unused legacy alias before each new
+release (or clear it); an existing alias pointing to another commit blocks
+publication. RC identity remains intact in the image, Helm appVersion and Android
+version name; iOS uses the numeric date, as it does for alpha.
+
+Publish at most one alpha and one stable per UTC day; numbered RCs allow multiple
+candidates on that date. A retry reuses the same tag and commit; a new candidate
+increments N without moving an existing tag. Beta, numbered alpha and hotfix
+suffixes remain unsupported. Cut release branches as usual; daily fixes do not
+create new ones.
## January
diff --git a/test/workflows/mobile_release_workflow_test.rb b/test/workflows/mobile_release_workflow_test.rb
index 93d945ca85..fb3ea8f2f0 100644
--- a/test/workflows/mobile_release_workflow_test.rb
+++ b/test/workflows/mobile_release_workflow_test.rb
@@ -4,8 +4,8 @@ require "tmpdir"
require "yaml"
class MobileReleaseWorkflowTest < ActiveSupport::TestCase
- test "Android preserves alpha identity while iOS uses the numeric version" do
- %w[2026.10.31-alpha 2026.10.31].each do |version|
+ test "Android preserves prerelease identity while iOS uses the numeric version" do
+ %w[2026.10.31-alpha 2026.10.31-rc.1 2026.10.31].each do |version|
{ "build-android" => version, "build-ios" => "2026.10.31" }.each do |job, name|
result = resolve("flutter-build", job, ref: "v#{version}")
assert_equal "#{version}\n", result[:metadata]
@@ -46,10 +46,10 @@ class MobileReleaseWorkflowTest < ActiveSupport::TestCase
end
test "automatic TestFlight accepts only canonical calendar tags" do
- %w[v2026.10.31 v2026.10.31-alpha v2028.2.29-alpha].each do |ref|
+ %w[v2026.10.31 v2026.10.31-alpha v2028.2.29-alpha v2026.11.30-rc.1 v2026.11.30-rc.10].each do |ref|
assert eligible?("push", "refs/tags/#{ref}"), ref
end
- %w[v0.7.7-alpha.2 v2026.10.31-beta v2026.10.31-rc.1 v2026.10.31-alpha.2
+ %w[v0.7.7-alpha.2 v2026.10.31-beta v2026.10.31-rc.01 v2026.10.31-rc v2026.10.31-alpha.2
v2026.02.1 v2026.2.29 v2026.4.31 v2026.13.1 vgarbage].each do |ref|
assert_not eligible?("push", "refs/tags/#{ref}"), ref
end
diff --git a/test/workflows/release_workflow_test.rb b/test/workflows/release_workflow_test.rb
index 7e1e29d59c..a61a1e5818 100644
--- a/test/workflows/release_workflow_test.rb
+++ b/test/workflows/release_workflow_test.rb
@@ -21,20 +21,43 @@ class ReleaseWorkflowTest < ActiveSupport::TestCase
end
end
- test "alpha and stable releases publish only their matching floating channel" do
+ test "alpha and stable promote their channel while RCs publish only versioned tags" do
with_repo do |dir|
- %w[2026.11.2-alpha 2026.11.2].each do |version|
+ %w[2026.11.2-alpha 2026.11.2-rc.0 2026.11.2-rc.1 2026.11.2-rc.10 2026.11.2].each do |version|
success, output = resolve(dir, version)
assert success, version
assert_includes output, "release=true"
assert_includes output, "type=raw,value=#{version}"
- channel, other_channel = version.end_with?("-alpha") ? %w[latest stable] : %w[stable latest]
- assert_includes output, "type=raw,value=#{channel}"
- assert_not_includes output, "type=raw,value=#{other_channel}"
+ tags = output.split("image_tags<<RELEASE_TAGS\n", 2).last.split("RELEASE_TAGS", 2).first.lines.map(&:strip)
+ if version.include?("-rc.")
+ assert_equal [ "type=raw,value=#{version}", "type=raw,value=0.7.7-alpha.3" ], tags
+ else
+ channel, other_channel = version.end_with?("-alpha") ? %w[latest stable] : %w[stable latest]
+ assert_includes tags, "type=raw,value=#{channel}"
+ assert_not_includes tags, "type=raw,value=#{other_channel}"
+ end
end
end
end
+ test "RC uses alpha compatibility and deployment gates without floating channel promotion" do
+ with_repo do |dir|
+ success, output = resolve(dir, "2026.11.30-rc.1")
+ assert success, output
+ assert_includes output, "alpha=true\n"
+ assert_includes output, "stable=false\n"
+ assert_includes output, "compatibility_version=0.7.7-alpha.3\n"
+ success, output = resolve(dir, "2026.11.30-rc.1", extra_env: { "COMPATIBILITY_CHANNEL" => "stable", "COMPATIBILITY_VERSION" => "0.7.7" })
+ assert success, output
+ assert_includes output, "compatibility_version=\n"
+ end
+ jobs = workflow.fetch("jobs")
+ assert_equal "needs.prepare.outputs.release == 'true' && needs.prepare.outputs.alpha == 'true'", jobs.fetch("deploy_demo").fetch("if")
+ assert_equal "needs.prepare.outputs.release == 'true' && needs.prepare.outputs.stable == 'true'", jobs.fetch("deploy_app").fetch("if")
+ release = jobs.fetch("release").fetch("steps").find { |step| step["name"] == "Create GitHub Release" }
+ assert_equal "${{ needs.prepare.outputs.stable != 'true' }}", release.fetch("with").fetch("prerelease")
+ end
+
test "Docker metadata disables automatic latest tagging" do
metadata = workflow.fetch("jobs").fetch("build").fetch("steps").find { |step| step["id"] == "meta" }.fetch("with")
assert_equal "latest=false", metadata.fetch("flavor")
@@ -69,9 +92,9 @@ class ReleaseWorkflowTest < ActiveSupport::TestCase
end
end
- test "invalid dates and all canonical suffixes other than alpha are rejected" do
+ test "invalid dates and unsupported canonical suffixes are rejected" do
with_repo do |dir|
- %w[2026.11.02 2026.11.0 2026.2.29 2026.4.31 2026.10.28-hotfix.1 2026.10.28-1 2026.10.30-alpha.2 2026.10.30-alpha.0 2026.10.30-beta 2026.10.30-rc.1 2026.10.30-daily 2026.10.30-nightly].each do |version|
+ %w[2026.11.02 2026.11.0 2026.2.29 2026.4.31 2026.10.28-hotfix.1 2026.10.28-1 2026.10.30-alpha.2 2026.10.30-alpha.0 2026.10.30-beta 2026.10.30-rc 2026.10.30-rc.01 2026.10.30-rc.-1 2026.10.30-rc.x 2026.10.30-daily 2026.10.30-nightly].each do |version|
assert_not resolve(dir, version).first, version
end
end
@@ -110,7 +133,7 @@ class ReleaseWorkflowTest < ActiveSupport::TestCase
workflow_sha = git!(dir, "rev-parse", "HEAD").strip
git!(dir, "commit", "--allow-empty", "-m", "selected commit")
selected_sha = git!(dir, "rev-parse", "HEAD").strip
- %w[2026.11.2 2026.11.2-alpha].each do |version|
+ %w[2026.11.2 2026.11.2-alpha 2026.11.2-rc.1].each do |version|
git!(dir, "tag", "-a", "v#{version}", "-m", "release")
[ "v#{version}", "refs/tags/v#{version}" ].each do |selected_ref|
success, output = resolve(dir, version, event: "workflow_dispatch", ref: "refs/heads/main",