Skip to content

fix: pre-release review findings for 0.3.0 - #193

Merged
uniqueg merged 14 commits into
devfrom
fix/pre-release-findings
Oct 23, 2026
Merged

uniqueg merged 14 commits into
devfrom
fix/pre-release-findings

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the findings of the second pre-release review of 0.3.0 (at dev f4a8acd):

  • M1, FOCA requirement: the 0.3.0 notes, deployment/README.md and the $comment of deployment/values.schema.json now state the FOCA 0.17 / foca-common 0.2.0 requirements, including which images the chart needs for named entries and spec patches. The notes list the config changes of FOCA 0.17 (named entries, spec patches, atomic configured policies). What only build: require FOCA 0.17.0 and foca-common 0.2.0 #179 can fill in (the chart changes of foca-common 0.2.0, and whether the chart still renders the same resources) is marked TODO(#179), so the release workflow's TODO gate blocks the release until then. build: require FOCA 0.17.0 and foca-common 0.2.0 #179's checklist now lists these items, the values schema copy and the chart doc links.
  • M2, gates after the tag: docs/development.md runs the version, pin, notes TODO and chart README checks before tagging, and says that a failing check after the tag (e.g. the image scan) needs a new patch version. A new CI job "Check release readiness" runs the pin and TODO checks for the version in CITATION.cff while it has no tag. On pull requests it reports warnings. On pushes to dev it reports errors, so the CI run that the release workflow requires fails. It is not a required check, and publishing doesn't need it.
  • Pin check: scripts/check_release_pins.py now also catches:
    • FOCA images in any FROM stage, after \ continuations, with a registry or variable in front, and in --from=/from=;
    • chart dependencies without a version or a chart repository (e.g. file://), and a quoted dependencies key;
    • build-system.requires and dependency-groups;
    • PEP 440 local versions (+gabc1234), as in proTES's copy.
    • a Dockerfile whose only FOCA image is in --from= (no FOCA base image).
  • Wheel contents: a test builds the wheel from a copy of the sources and checks the package data, including api/patches/login-for-reads.yaml.
  • 409 under the readers recipe: docs/access-control.md and the notes now cover three points, with no change to the 409 contract:
    • registration stays open, and the 409 for duplicates names the registered service;
    • how to restrict register-services;
    • owners and maintainers can still probe via updates, so admins should review the roles on services.
  • Weekly scan Docker Hub org: already fixed by ci: sign and tag only the scanned image digest #192 (vars.DOCKERHUB_ORG || 'elixircloud').

Verification

  • pre-commit run --all-files (ruff, ruff format, mypy, semgrep, gitleaks, actionlint, ast-grep): passed
  • coverage run -m pytest against mongomock, with Helm 3.22.1 for the chart tests: 1098 passed, coverage 100%
  • mkdocs build --strict: passed
  • helm lint deployment: passed
  • python scripts/check_release_pins.py: exits 1 with only the 2 expected dev pins (FOCA git reference and dated base image, to be replaced in build: require FOCA 0.17.0 and foca-common 0.2.0 #179)
  • The new CI step, run locally with version: "0.3.0" added to CITATION.cff: warnings and exit 0 for pull_request, errors and exit 1 for push. Without a version it is skipped.
  • Mutation check: dropping api/patches/*.yaml from the package data makes the wheel test fail.
  • Reviewer subagents: round 1 (adversarial + quality) and round 2 (adversarial). Findings were fixed.
  • CI: all checks passed on the final head (including the new "Check release readiness", skipped as CITATION.cff has no version yet)
  • Sourcery: 2 findings fixed (the readiness job now checks the tagged commit itself; only FROM lines count as the FOCA base image), threads resolved; Sourcery approved. No Copilot review was requested.

Declined review findings

  • Splitting find_dev_pins into smaller helpers (quality, low): optional refactoring that doesn't change behaviour.
  • Resolving build arguments (ARG BASE=... / FROM ${BASE}) in the pin check (adversarial round 2, low): the line-based check doesn't evaluate the Dockerfile. The docstring now states this limit.
  • Failing when a chart has no dependencies (adversarial round 1, low): a chart without dependencies is valid in general. The quoted-key case that caused it is fixed.

Open questions

None.

Closes #189

🤖 Generated with Claude Code

uniqueg and others added 12 commits October 23, 2026 05:19
The pin check missed some development pins: a FOCA dev image in a later
stage of the Dockerfile (or with options such as --platform, or without
a tag), chart dependencies without a version or with a repository other
than a chart repository (e.g. file://), and build requirements and
dependency groups of pyproject.toml. Check all of them, with tests.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tests run on an editable install, which reads data files from the
source tree, and the wheel check of CI only looks for any API spec. Build
the wheel from a copy of the sources in a test and check that it contains
the base config, the files it references and the patches for deployments
(e.g. the login-for-reads patch).

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Release 0.3.0 requires FOCA 0.17 (named specs and policies, spec
patches) and foca-common 0.2.0, but the notes, the chart README and the
values schema still named FOCA 0.16 and foca-common 0.1.0. Correct them,
list the config changes of FOCA 0.17 in the notes, say which images the
chart needs for named entries and patches, and mark the chart changes of
foca-common 0.2.0 as TODO(#179), so that the release workflow's TODO
check blocks the release until #179 fills them in.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With reads restricted to some users, registration stays open, and its
409 for duplicates names the registered service, also to users who may
not read it. Say so in the access control docs and the 0.3.0 notes, and
show how to restrict registration (register-services) by name.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The documented release steps ran only the citation check before the
tag, but tags can't be moved or deleted, so a failing pin or notes check
in the release workflow would burn the version. Run the pin check and
the TODO check of the notes before tagging, too, say that a check that
fails after the tag (e.g. the image scan) needs a new patch version, and
describe the cases that the pin check now catches.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The wheel test shows the build's output if the build fails.
- The registration rule extends the readers.yaml overlay above instead
  of a second block with the same file name.
- The pin check skips only includes of dependency groups, not any
  entry that isn't a string.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pin check missed FOCA dev images after a line continuation, with
another registry or a variable in front, or in --from= of COPY and RUN
--mount, and read no dependencies if the chart's dependencies key was
quoted. Check these, with tests.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Restricting registration doesn't stop owners and maintainers from
  probing for services via updates: grant those roles only to users who
  may read services (access control docs and notes).
- Mark the claim that foca-common renders the same resources, and the
  values schema copy, as TODO(#179).
- Run the version and chart README checks before tagging, too.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The pin check finds FOCA images in a first --mount option (from=...)
  and in quoted mounts, ignores comment lines (also inside continued
  lines), and calls them FOCA images; build arguments aren't resolved,
  which its docstring now says.
- The access control docs and the notes say that owners grant roles on
  services, so admins review them when restricting reads, and that the
  permission rules can be restricted, too.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pin check and the TODO check of the curated notes ran only in the
release workflow, after the immutable tag exists. Run them in CI, too,
for the version in CITATION.cff while it has no tag: as warnings on pull
requests, and as errors on pushes to dev, which fail the CI run that the
release workflow requires for the release commit. The job is not a
required check and not needed for publishing dev images.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Requirements that name a PEP 440 local version (e.g. ==0.17.0+gabc1234,
a build of a commit) passed the pin check. Reject them, as proTES's copy
of the script does, with tests.

Refs #189

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

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7ce7a07) to head (c863c28).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #193   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          917       959   +42     
=========================================
+ Hits           917       959   +42     

☔ 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 commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR closes the 0.3.0 pre-release findings by adding pre-tag release gates, broadening dependency/image/chart pin validation, documenting FOCA 0.17 and foca-common 0.2.0 compatibility plus access-control caveats, and verifying that required configuration patches are present in built wheels.

Sequence diagram for pre-tag release readiness checks

sequenceDiagram
    participant Maintainer
    participant PR as PullRequest
    participant CI as GitHubActions
    participant Pins as check_release_pins.py
    participant Notes as ReleaseNotes
    participant Tag as GitTag
    Maintainer->>PR: Update CITATION.cff version
    PR->>CI: pull_request event
    CI->>CI: Check version and existing tag
    CI->>Pins: Run check_release_pins.py
    CI->>Notes: Search release notes for TODO
    alt Pull request
        CI-->>PR: Report findings as warnings
    else Push to dev
        CI-->>PR: Report findings as errors
        CI-->>PR: Fail CI when checks fail
    end
    Maintainer->>Pins: Run release checks before tagging
    Maintainer->>Notes: Complete release notes
    Maintainer->>Tag: Push immutable version tag
    Tag->>CI: Trigger release workflow
Loading

Flow diagram for expanded release pin validation

flowchart TD
    Start["check_release_pins.py"] --> PyProject["Inspect pyproject.toml requirements"]
    PyProject --> Req["dependencies, dependency-groups, build-system.requires"]
    Req --> ReqResult["Reject direct, pre-release, or local versions"]
    Start --> Dockerfile["Inspect Dockerfile"]
    Dockerfile --> Images["Find FOCA images in FROM and from= stages"]
    Images --> ImageResult["Require release-tagged FOCA images"]
    Start --> Chart["Inspect deployment/Chart.yaml"]
    Chart --> Dependencies["Read chart dependency mappings"]
    Dependencies --> ChartResult["Require version and oci:// or https:// repository"]
    ReqResult --> Result["Emit pin findings"]
    ImageResult --> Result
    ChartResult --> Result
Loading

File-Level Changes

Change Details Files
Added pre-tag release-readiness validation in CI and documented a release process that runs pin, notes, citation, and chart-link checks before immutable tags are created.
  • Added PR-warning and dev-push-error CI behavior keyed to the untagged version in CITATION.cff.
  • Documented the consequences of post-tag failures and the required patch-version remediation.
  • Expanded the manual release checklist and linked the chart README validation.
.github/workflows/checks.yaml
docs/development.md
Strengthened release pin detection across Python requirements, Dockerfile image references, and Helm chart dependencies.
  • Detects pre-release, local-version, and direct-reference requirements in project, optional, dependency-group, and build requirements.
  • Checks every FOCA image reference across stages, continuations, registries, variables, --from, and mount sources.
  • Rejects missing or non-release chart versions and repositories that are not oci:// or https://, including quoted dependency keys.
  • Added focused regression coverage for the expanded parser and detection cases.
scripts/check_release_pins.py
tests/test_check_release_pins.py
docs/development.md
Updated 0.3.0 release and deployment documentation for FOCA 0.17, foca-common 0.2.0, and access-control behavior.
  • Documented named config entries, specification patches, atomic configured policies, and image compatibility requirements.
  • Added explicit TODO(#179) gates for unresolved foca-common chart behavior and schema/resource verification.
  • Clarified duplicate-registration 409 behavior, registration restrictions, and residual owner/maintainer probing risks.
  • Updated the deployment schema comment and chart documentation links/requirements.
docs/releases/0.3.0.md
deployment/README.md
deployment/values.schema.json
docs/access-control.md
Added an artifact-level wheel test to ensure runtime package data is included in built distributions.
  • Builds a wheel from a copied source tree using the project build tooling.
  • Inspects the wheel archive for all configuration-referenced files, including api/patches/login-for-reads.yaml.
  • Retains source-level package-data and pattern validation.
tests/test_config.py

Assessment against linked issues

Issue Objective Addressed Explanation
#189 Update the 0.3.0 release notes, chart README, and values schema to document the FOCA 0.17 and foca-common 0.2.0 requirements, FOCA 0.17 configuration changes, and release-time details marked TODO(#179). ✅
#189 Move release pin and notes checks before tagging, add pre-tag CI readiness checks, and extend the pin check to cover the specified Dockerfile, chart dependency, and Python requirement cases with tests. ✅
#189 Verify the login-for-reads patch ships in the wheel, document registration restrictions and duplicate-registration 409 behavior, and use the configurable Docker Hub organization in the weekly scan. ✅

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

@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=".github/workflows/checks.yaml" line_range="273-275" />
<code_context>
+              echo "No version in CITATION.cff: no release in preparation"
+              exit 0
+          fi
+          if git ls-remote --exit-code --tags origin "refs/tags/v${version}" > /dev/null; then
+              echo "v${version} is tagged: no release in preparation"
+              exit 0
+          fi
+          level=error
</code_context>
<issue_to_address>
**Bad release tags pass CI**

When the release tag is pushed before the readiness check runs, the readiness job exits 0 before checking pins and notes, so the release workflow accepts the skipped CI run and an immutable tag is created before release validation fails; the version then needs a patch release.

Ensure the release gate requires a completed, non-skipped readiness check instead of treating this successful exit as a pass.
</issue_to_address>

### Comment 2
<location path="scripts/check_release_pins.py" line_range="193" />
<code_context>
+        " ",
+        re.sub(r"(?m)^[ \t]*#.*\n", "", (root / "Dockerfile").read_text()),
+    )
+    images = list(BASE_IMAGE.finditer(dockerfile))
+    if not images:
+        pins.append("Dockerfile: no elixircloud/foca base image")
</code_context>
<issue_to_address>
**Missing FOCA base image passes**

When the Dockerfile uses a non-FOCA `FROM` image but references a release-tagged FOCA image only via `COPY --from=` or `RUN --mount=from=`, `BASE_IMAGE.finditer` treats `--from=` matches the same as `FROM` matches, so a Dockerfile with a non-FOCA base image and a released FOCA image used only by `COPY --from=` passes without the required FOCA base image. The release pin check then misses a Dockerfile regression.

Track base-image `FROM` matches separately and keep requiring at least one FOCA base image, while still validating FOCA images referenced through `--from=`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: .github/workflows/checks.yaml:275, scripts/check_release_pins.py:193


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

Comment thread .github/workflows/checks.yaml Resolved
Comment thread scripts/check_release_pins.py Resolved
uniqueg and others added 2 commits October 23, 2026 13:01
FOCA images in --from= counted as base images, so a Dockerfile with
another base image and a FOCA image only in COPY --from= passed the
"no elixircloud/foca base image" check. Count only FROM lines for it,
while still checking the tags of all FOCA images.

Refs #189

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The readiness job skipped all commits once the version in CITATION.cff
was tagged, also the tagged commit itself, e.g. if it was tagged before
the job ran. Skip only commits other than the one the tag points to.

Refs #189

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

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

Sourcery assessment

Approved.

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.

fix: pre-release review findings for 0.3.0

1 participant