Skip to content

ci: mark releases before 1.0.0 as prereleases - #126

Merged
uniqueg merged 3 commits into
devfrom
ci/prerelease-before-1.0
Oct 21, 2026
Merged

uniqueg merged 3 commits into
devfrom
ci/prerelease-before-1.0

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Releases are marked as GitHub pre-releases until 1.0.0. The release
workflow derived a single prerelease flag (tags ending in aN, bN or
rcN) that decided the GitHub pre-release label, the latest Docker image
and the GitHub "Latest" release. It is now split:

  • prerelease (gh release create --prerelease=): aN/bN/rcN tags or
    major version 0.
  • stable (Docker latest tag, step latest): no aN/bN/rcN suffix,
    i.e., what prerelease == false meant before. Images of 0.x releases are
    tagged exactly as before.
  • GitHub "Latest" (--latest=): as before (latest output), but forced to
    false for pre-releases, so --latest=true is never combined with
    --prerelease=true. Reruns (gh release edit) now set both
    --prerelease= and --latest=, as on create.

chart_version is unchanged. The README "Versioning and releases" section
is updated accordingly.

Resulting behaviour

Tag GitHub pre-release Docker latest GitHub "Latest"
v0.3.0 (highest stable on main) yes yes no (--latest=false)
v0.2.1 (not the highest) yes no no
v0.4.0rc1 yes no no
v1.0.0rc1 yes no no
v1.0.0 (highest stable on main) no yes yes (--latest=true)
v1.0.1 (not the highest, e.g., after v1.1.0) no no no (--latest=false)

GitHub never marks a pre-release as "Latest" (the REST API: "Drafts and
prereleases cannot be set as latest"); gh itself does not validate the
combination and would send make_latest=true with prerelease=true, so
the workflow now avoids it. With --latest=false, GitHub leaves the
"Latest" release where it is; the repository has no releases yet, so until
1.0.0 there is no "Latest" release at all.

Verification

  • actionlint 1.7.7 (release binary, checksum verified; not configured in
    the repository): no findings, before and after the change.
  • Two review rounds (adversarial + quality each); fixed: README
    ("highest stable release on main", a/b/rc tags vs. GitHub
    pre-releases), workflow header comment, and --prerelease= on the rerun
    gh release edit, so reruns apply the current policy.
  • The flag logic, extracted into a script, gives the expected stable,
    prerelease, --latest and (unchanged) chart_version values for
    v0.15.0, v0.15.1rc1, v0.3.0a2, v0.0.1, v1.0.0, v1.0.0rc1,
    v1.2.3b1, v10.0.0.
  • pre-commit hooks that apply to the changed files (check-yaml, trailing
    whitespace, end of file): pass; ruff, mypy, semgrep, ast-grep and the
    tests are unaffected (workflow and README changes only).
  • Sourcery: one finding (alpha/beta chart versions misdocumented as
    X.Y.Z-rc1), fixed in the README.
  • CI: all checks pass (including codecov; the image publish job is skipped
    for pull requests).

Declined review findings

  • Quality review (low): the LATEST=false override reassigns an env
    variable in the Create release step instead of a separate output of the
    latest step. Declined: kept minimal and commented; the latest step
    (and its output) is about the image, the override only about GitHub.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 2 commits October 21, 2026 12:57
Split the release flag in two: `prerelease` (GitHub pre-release) is
now also true for all releases with major version 0, while the new
`stable` flag (no alpha, beta or release candidate suffix) decides
whether the image is tagged `latest`, as `prerelease` did before.
Images of 0.x releases are thus tagged exactly as before. The
GitHub release is only marked "Latest" if it is no pre-release, so
`--latest=true` is never combined with `--prerelease=true`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address review findings: on reruns, `gh release edit` now also sets the
pre-release flag, so existing releases follow the current policy. The
workflow header and README describe which tags update the `latest`
image and which are GitHub pre-releases without overloading
"pre-release".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The release workflow now independently classifies GitHub pre-release status and Docker stability: all 0.x releases are GitHub pre-releases, while only non-alpha/beta/RC releases can promote Docker latest. GitHub Latest is prevented from being assigned to pre-releases, reruns synchronize both release flags, and the README documents the updated behavior.

Sequence diagram for release creation and rerun flags

sequenceDiagram
    participant Workflow
    participant GitHub
    participant Docker

    Workflow->>Workflow: Parse release tag
    Workflow->>Workflow: Compute stable and prerelease
    Workflow->>Workflow: Determine latest
    Workflow->>Docker: Publish version image
    opt highest stable release
        Workflow->>Docker: Publish latest image
    end
    alt Existing GitHub release
        Workflow->>GitHub: gh release upload
        Workflow->>GitHub: gh release edit --prerelease= --latest=
    else New GitHub release
        Workflow->>GitHub: gh release create --prerelease= --latest=
    end
Loading

Flow diagram for release classification and publishing

flowchart TD
    Tag[Release tag] --> Version[Validate and parse version]
    Version --> Pre[Detect alpha beta or RC suffix]
    Version --> Major[Check major version]
    Pre --> Stable[stable=false]
    Major --> Zero[major is 0]
    Zero --> Prerelease[prerelease=true]
    Pre --> Prerelease
    Stable --> LatestImage[Docker latest only for highest stable release]
    Prerelease --> GitHubPre[GitHub pre-release]
    GitHubPre --> LatestGuard[GitHub Latest=false]
    LatestImage --> Publish[Publish release image and GitHub release]
    LatestGuard --> Publish
Loading

File-Level Changes

Change Details Files
Separate GitHub pre-release classification from Docker image stability and propagate both values through the release job.
  • Mark alpha, beta, and release-candidate tags, plus every major-version-0 release, as GitHub pre-releases.
  • Keep stable releases—including 0.x releases—as candidates for the Docker latest image.
  • Use the stable classification when determining whether the release is the highest stable tag on main.
.github/workflows/release.yaml
Ensure GitHub release creation and reruns apply valid and consistent prerelease and latest flags.
  • Force GitHub latest to false whenever prerelease is true.
  • Pass both flags when editing an existing release during reruns.
  • Retain existing highest-release behavior for the GitHub Latest designation.
.github/workflows/release.yaml
Document the revised release and Docker tagging policy.
  • Define Docker latest as the highest stable, non-alpha/beta/RC release on main.
  • Document that all pre-1.0.0 releases are GitHub pre-releases while stable 0.x releases can still update the latest image.
README.md
.github/workflows/release.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8cb21d0) to head (19f889f).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #126   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          775       775           
=========================================
  Hits           775       775           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 21, 2026 11:11

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="README.md" line_range="656" />
<code_context>
-GitHub pre-releases, with chart version `X.Y.Z-rc1`, and never update `latest`.
+PyPI. Tags of alpha, beta and release candidate versions (e.g., `vX.Y.Zrc1`,
+also `aN` and `bN`) get chart version `X.Y.Z-rc1` and never update the `latest`
+image. These and, until 1.0.0, all other releases are GitHub pre-releases
+(never marked as the latest release).
 Images of commits on `dev` are published by the [CI workflow][checks-workflow]
</code_context>
<issue_to_address>
**Alpha chart versions are misdocumented**

When a reader uses an alpha or beta tag to find or refer to its packaged chart, the release workflow preserves the suffix when building `chart_version`, so `vX.Y.ZaN` and `vX.Y.ZbN` produce chart versions `X.Y.Z-aN` and `X.Y.Z-bN`; the README instead tells readers to expect `X.Y.Z-rc1`, so they look for the wrong chart package.

Document the suffix-specific chart versions: `-aN`, `-bN`, and `-rcN`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and if the pre-1.0.0 classification is wrong, GitHub will publish those releases as pre-releases, affecting how they are presented and which release GitHub treats as latest; the Docker latest image is still controlled separately. Reverting the workflow will not change releases already published, but their status can be corrected manually.

Blocking findings: README.md:656


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread README.md Resolved
Address Sourcery review: alpha and beta tags get chart versions
`X.Y.Z-aN` and `X.Y.Z-bN`, not `X.Y.Z-rc1`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 753c6d9 into dev Oct 21, 2026
11 checks passed
@uniqueg
uniqueg deleted the ci/prerelease-before-1.0 branch October 21, 2026 11:18
uniqueg added a commit that referenced this pull request Oct 21, 2026
* fix(api): reject user ID groups in permissions

PUT and DELETE /services/{serviceId}/permissions/groups matched the
user permission routes with the user ID "groups": they granted or
revoked a role of a user "groups", and that stray owner then satisfied
the last-owner check. Both now return 404, like the group path with an
empty group (.../permissions/groups/), and store nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(helm): disable service links in pods

Kubernetes injects <SERVICE>_PORT and similar variables for each
Service in the namespace. FOCA reads MONGO_PORT, so a Service named
mongo (e.g., of another release) made the app crash-loop with an
invalid MongoDB URI. Neither pod uses these variables.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: silence keep_group_subjects warning in dev

FOCA warned on every Docker Compose start that keep_group_subjects has
no effect, as config.dev.yaml set no group_mapping. An empty mapping
keeps the behavior (no admins, group claim values as subjects) without
the warning.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: keep FOCA minors out of Dependabot image bumps

Dependabot bumped the FOCA base image in the Dockerfile and the foca
pin in requirements.txt separately, so a base image with a new FOCA
minor would get the old FOCA reinstalled on top. Minor and major
updates of the base image are now ignored; FOCA minors are bumped by
hand in both files.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: pin Helm in CI and release workflow

Both workflows used whatever Helm the runner image had. They now install
Helm v3.22.1, the version the runners had at the time, with
azure/setup-helm (pinned by commit, like the other actions).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: run actionlint in pre-commit

actionlint checks the workflows, and their scripts with shellcheck where
it is installed, as on GitHub-hosted runners. It would have caught
workflow mistakes such as those in the version logic of #126.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: check roles after DELETE of groups path

Also format the new dev overlay test as ruff does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test: seed a groups role before DELETE

The DELETE of .../permissions/groups returned 404 also without the
guard, as no role of a user groups existed. Now one is stored first,
and must be kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant