Skip to content

build: version the meta package semantically - #31

Merged
uniqueg merged 6 commits into
devfrom
build/meta-semver
Nov 1, 2026
Merged

uniqueg merged 6 commits into
devfrom
build/meta-semver

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Switches the meta distribution foca-plugins from calendar to semantic
versions, per the maintainer's decision in #26, and prepares its first
release train, 0.1.0.

  • docs/releasing.md: the meta version rules (major: a pin's major bump
    or a removed plugin; minor: an added plugin or a pin's minor bump;
    patch: only patch bumps; stays 0.x while the plugins are 0.x, where
    major-level changes bump the minor version), with an example; tag
    example foca-plugins-v0.2.0.
  • meta/pyproject.toml: version 0.1.0 (pins are already
    foca-plugin-generic-routing-random==0.1.0 and
    foca-plugin-tes-routing-distance==0.1.0); uv.lock re-locked.
  • meta/CHANGELOG.md: ## 0.1.0 with intro, pins and Features (these
    become the release notes).
  • README.md, docs/installing.md, meta/README.md (the PyPI
    description): no more "nothing released"; semantic versions; install
    examples with 0.1.0.
  • MAINTAINERS.md: PyPI state, plus a to-do: the plugins' publishers were
    created with the environment's old name pypi and must name release
    before their next releases; the pending foca-plugins publisher must
    name release before its tag.
  • release.yml: comments only (the prerelease rule 0.* already covers
    the meta distribution: 0.1.0 becomes a GitHub pre-release).
  • Tests: the repo fixture sets the meta version to META_VERSION, so
    the tests no longer depend on the version of the next release.

Full review (tests changed, release workflow touched): adversarial and
quality reviewers, 2 rounds.

Verification

  • coverage run --source scripts,docs -m pytest tests: 78 passed, 100%
    coverage

  • pre-commit run --all-files (ruff, mypy, semgrep, ast-grep, gitleaks,
    actionlint, package conventions): passed

  • python -m scripts.checks check: passed; uv build --all-packages
    then python -m scripts.checks dist dist: passed
    (foca_plugins-0.1.0 wheel and sdist)

  • Release dry run on this commit: python -m scripts.release release foca-plugins-v0.1.0 gives meta / foca-plugins / 0.1.0;
    notes foca-plugins-v0.1.0 prints the 0.1.0 section; previous is
    empty (first meta release: the commits list falls back to meta/)

  • mkdocs build --strict: passed

  • CI: all checks passed (after merging dev with the Dependabot update
    build(deps-dev): Bump the python-dependencies group across 1 directory with 4 updates #33 and the Sourcery fixes)

  • Sourcery: 2 findings fixed (version rules for metadata changes;
    re.escape of expected messages)

Note: #32 (FOCA 0.19 support) will bump the plugins, so the 0.1.0 train
will pin the new plugin versions; it is tagged only after #32.

Declined review findings

  • Docs describe 0.1.0 as the first release train before it is on PyPI
    (low): the tag follows right after this merge.
  • No check that the meta version matches the pin changes (low): the rules
    are applied by hand in the release PR, as now documented.

Closes #26

🤖 Generated with Claude Code

uniqueg and others added 4 commits October 31, 2026 19:00
The fixture repo sets the meta version to META_VERSION, so that tests
no longer break when a release changes the version, and use semantic
versions instead of calendar ones.

Part of #26

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The meta distribution foca-plugins switches from calendar to semantic
versions (rules in docs/releasing.md) and prepares its first release
train, 0.1.0, pinning foca-plugin-generic-routing-random 0.1.0 and
foca-plugin-tes-routing-distance 0.1.0. Docs updated for the released
plugins.

Closes #26

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Spell out the 0.x rule for removed plugins, drop the placeholder
changelog entry, flag the PyPI publishers still named after the old
environment and build the meta tags of the tests from META_VERSION.

Part of #26

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg marked this pull request as ready for review October 31, 2026 18:23
@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR converts the foca-plugins meta distribution from calendar to semantic versioning, prepares its first 0.1.0 release train and documentation, marks all pre-1.0 packages as GitHub prereleases, and makes release-related tests independent of the production version.

Flow diagram for semantic release train versioning

flowchart LR
    Pins["Pinned plugin changes"] --> Rules["Semantic versioning rules"]
    Rules --> Version["foca-plugins 0.1.0"]
    Version --> Tag["foca-plugins-v0.1.0"]
    Tag --> Release["GitHub release"]
    Release --> PreRelease["Pre-release because version is 0.x"]
Loading

File-Level Changes

Change Details Files
Defines semantic-version rules for the foca-plugins release train and updates release metadata for the initial 0.1.0 train.
  • Replaces calendar-version guidance with pin-driven major, minor, and patch rules, including 0.x behavior and semantic tag examples.
  • Sets the meta package to 0.1.0 and refreshes the lockfile.
  • Adds the 0.1.0 changelog entry with pinned plugins, extras, and release-note features.
docs/releasing.md
meta/pyproject.toml
meta/CHANGELOG.md
uv.lock
Aligns user-facing documentation and maintainer guidance with the published experimental plugins and first release train.
  • Updates installation examples and package descriptions to use semantic version 0.1.0.
  • Documents the current extras and clarifies that stable and WES selections remain empty.
  • Records PyPI publisher state and required environment-name corrections before future releases.
README.md
docs/installing.md
meta/README.md
MAINTAINERS.md
Updates release workflow documentation and prerelease behavior for semantic-versioned meta packages.
  • Changes examples from calendar tags to semantic tags.
  • Treats every package below 1.0.0, including foca-plugins, as a GitHub prerelease.
.github/workflows/release.yml
Decouples repository test fixtures from the production meta package version while migrating release tests to semantic versions.
  • Introduces a fixture-only META_VERSION and helper to rewrite the copied meta package version.
  • Updates checks, artifact, tag, changelog, and release-command tests to use the independent fixture version.
tests/conftest.py
tests/helpers.py
tests/test_checks.py
tests/test_release.py

Possibly linked issues


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 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a5b8fd2) to head (87b0bf4).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #31   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          551       551           
  Branches        71        71           
=========================================
  Hits           551       551           
Flag Coverage Δ
foca-plugin-generic-example-noop 100.00% <ø> (ø)
foca-plugin-generic-routing-random 100.00% <ø> (ø)
foca-plugin-tes-routing-distance 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@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 2 issues

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

## Individual Comments

### Comment 1
<location path="docs/releasing.md" line_range="32-33" />
<code_context>
+  of [cloud-components](https://github.com/elixir-cloud-aai/cloud-components).
+  Each release is a release train: its extras pin plugin versions exactly,
+  and its `foca` requirement declares the FOCA versions that the train was
+  tested with. Its version follows from the changes of the pins since the
+  previous train:
+    - **major:** a pinned plugin gets a major version bump, or a plugin is
+      removed from the train;
</code_context>
<issue_to_address>
**Metadata changes lack version rules**

When a release changes the FOCA requirement or a plugin’s maturity without changing its pinned version, the policy assigns version bumps only for pin changes, but changing the declared FOCA range or moving a plugin between `[experimental]` and `[all]` also changes the published package metadata. Maintainers have no defined version bump for those changes, leaving users on stale dependency constraints or extras, or forcing an arbitrary version choice.

Define how changes to the FOCA requirement and plugin maturity affect the meta distribution’s version.
</issue_to_address>

### Comment 2
<location path="tests/test_release.py" line_range="37" />
<code_context>
-        ("foca-plugins-v2026.11.0", "has version '2026.10.0.dev0' on this commit"),
+        ("foca-plugins-0.2.0", "is no tag"),
+        ("foca-plugins-v0.2.0-dev0", "is no tag"),
+        ("foca-plugins-v0.3.0", f"has version '{META_VERSION}' on this commit"),
         ("foca-plugin-generic-example-noop-v0.1.0", "is never published"),
     ],
</code_context>
<issue_to_address>
**Malformed version diagnostic passes**

When the mismatch diagnostic contains non-period separators that match the unescaped dots in `META_VERSION`, `test_release_refused` passes `message` to `pytest.raises(match=message)` as a regex, so periods in `META_VERSION` match arbitrary characters. A malformed mismatch diagnostic such as `0x2x0Ydev0` therefore passes, and the test misses incorrect version reporting.

Escape the expected message with `re.escape(message)` before passing it to `pytest.raises(match=...)`.
</issue_to_address>

Linked issues

#26 build: version the meta package semantically · 3 of 5 met · 2 to check by hand

# Requirement Status Notes
1 Use semantic versions for the meta package and document the major, minor, and patch rules. ✅ Met The versioning rules, including how removals and plugin major bumps affect the train, are documented in docs/releasing.md.
2 Keep the meta package at 0.x while pinned plugins are 0.x, with breaking changes bumping the minor version. ✅ Met The 0.x behavior and an example are included in docs/releasing.md.
3 Update release documentation, maintainer notes, package version, README, and any checks or tests that expect calendar versions. ✅ Met meta/pyproject.toml is set to 0.1.0; the relevant docs and tests are updated, and no calendar-version expectation remains in scripts/.
4 Release foca-plugins 0.1.0 with the two specified plugin pins. 👀 Check by hand (external system) Check PyPI after the release tag is pushed to confirm foca-plugins 0.1.0 is published with both plugin distributions at 0.1.0.
5 Turn the pending foca-plugins trusted publisher into a regular publisher using the release environment. 👀 Check by hand (external system) Check the PyPI trusted-publisher configuration to confirm it names the release environment and is active.

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and the meta package’s version changes to 0.1.0, and the release workflow will label any 0.x package version as a GitHub pre-release. If a train built from this version is published with the wrong version or metadata, reverting the repository will not remove that published artifact, though a later train can correct it.

Blocking findings: docs/releasing.md:33, tests/test_release.py:37


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

Comment thread docs/releasing.md Resolved
Comment thread tests/test_release.py Resolved
uniqueg and others added 2 commits November 1, 2026 01:31
Also escape the expected messages of refused tags in the tests.

Part of #26

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 8814a96 into dev Nov 1, 2026
35 checks passed
@uniqueg
uniqueg deleted the build/meta-semver branch November 1, 2026 00:50
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.

build: version the meta package semantically

1 participant