Skip to content

Fixes 36405: Fail the release bump when a version pattern matches nothing - #36407

Closed
shrabantipaul-collate wants to merge 4 commits into
mainfrom
shrabantipaul-collate/release-bump-fail-on-missed-match
Closed

shrabantipaul-collate wants to merge 4 commits into
mainfrom
shrabantipaul-collate/release-bump-fail-on-missed-match

Conversation

@shrabantipaul-collate

@shrabantipaul-collate shrabantipaul-collate commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #36405

make update_all RELEASE_VERSION=x.y.z now bumps every file it names, and fails instead of exiting 0 when a version pattern matches nothing.

  • update_docker_tag also matches the image: ${VAR:-docker.getcollate.io/...} form the MySQL quickstart compose has used since Feature #21971: Session Management in Multiple Server Pods #26314. Before, it skipped that file.
  • update_openapi_version accepts any version string, including 2.0.0-SNAPSHOT. Before, it only matched a plain X.Y.Z, which main never carries.
  • regex_sub takes required=True, and every OSS release pattern passes it. update_docker_tag also fails if any OpenMetadata image line keeps its old tag. Its default stays lenient because Collate's release bump imports it and expects some of its patterns to match nothing on a release branch.
  • update_all and its three loop targets run under set -e. They used to chain steps with ;, so a failure only counted if it hit the very last file, and the release workflow committed a half-bumped branch.

Why: the 2.1.0 cut left the MySQL quickstart on 1.12.0-SNAPSHOT images and the OpenAPI version on 2.0.0-SNAPSHOT, and nothing reported it. The values on 2.1 are fixed in #36408, which also carries this commit so the 2.1.1 bump works.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • make update_all RELEASE_VERSION=9.8.7 (with mvn stubbed) rewrites every version line in all 10 files it names, including the MySQL quickstart images and the OpenAPI version.
  • A drifted file for each target (OpenAPI title, pyproject version line, compose registry, ARG RI_VERSION) makes make update_all exit non-zero with matched nothing.
  • The ${VAR:-image} form keeps its closing brace. A compose file with no OpenMetadata image, or one with an image line in another shape, fails the bump, including the usual X.Y.Z-SNAPSHOT → X.Y.Z cut, where the old tag starts with the new one.

Unit tests

  • Added scripts/test_update_version.py (11 tests). python3 -m pytest -q scripts/test_update_version.py → 11 passed.
  • Against origin/main's update_version.py, all 11 fail. Against origin/main's Makefile, the 4 drift tests fail.
  • Coverage % not measured: this is a standalone release script outside the Java, UI and ingestion coverage tooling.
  • New workflow .github/workflows/release-version-bump-tests.yml runs this file on PRs that touch the Makefile, the script, its test or any file the bump rewrites. It passed on this PR: https://github.com/open-metadata/OpenMetadata/actions/runs/40651490786

Backend integration tests

  • Not applicable (no backend API changes). plan_local_java_tests.py: no Java tests impacted.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes). The selector maps the four changed files to the PR smoke set only because they aren't in the impact map. It wasn't run locally because that needs the UI dependencies and a running stack.

Manual testing performed

  1. Ran the Python steps of make update_all with RELEASE_VERSION=2.2.0 on main: all 10 files bumped, versus 8 with the current script.
  2. Ran them with RELEASE_VERSION=2.1.1 on a 2.1 checkout: all 10 files bumped, versus 8 with the current script, which leaves the MySQL quickstart and the OpenAPI version behind.
  3. Ran Collate's scripts/test_collate_update_version.py (it imports regex_sub) against this update_version.py: 10 passed.

UI screen recording:

Not applicable — release tooling only, no UI.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: three passes against REVIEW.md, final at d69c602. Bot review (gitar, greptile): fixed the stale-line check, which matched :2.1.0 inside :2.1.0-SNAPSHOT, and added the decision record (0941f2e). Pass 1 🔴: update_all chained steps with ;, so a missed pattern still exited 0. Fixed with set -e and the 4 drift tests. Pass 3 🔴: no CI job runs scripts/test_update_version.py. Fixed with the new workflow above (61e6a42). Pass 3 nit: a partly bumped compose file still passed. Fixed by checking every image line, with a test.

  • Decision check: adds docs/decisions/2026-10-28-regex-sub-stays-lenient-by-default.md. Collate imports regex_sub and relies on its keyword names and lenient default.

  • I have added a test that covers the exact scenario we are fixing.

Not changed here: docker/docker-compose-quickstart/docker-compose-rdf.yml has been on 1.8.0-SNAPSHOT since 1.8 because update_all never names it. Should it be added to update_dockerfile_version?

Related: open-metadata/openmetadata-collate#7924 fixes the Collate side of the same release cut.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issue remains from this review.

Summary

The PR makes release bumps fail when expected version patterns match nothing. It also fixes snapshot OpenAPI versions and overridable Docker image lines.

  • Release bumps update named versions and stop when a target is missed.
  • Pull requests run release-bump checks when version inputs change.

Reviews (3) · Last reviewed commit: "Run the release version bump tests in CI" · Reviewed by Greptile

…thing

update_docker_tag missed the ${VAR:-image} form the MySQL quickstart
compose uses, and update_openapi_version missed -SNAPSHOT versions, so
2.1 was cut with 1.12.0-SNAPSHOT quickstart images and a 2.0.0-SNAPSHOT
OpenAPI version. Both patterns now match, every release pattern must
match, and update_all stops at the first failure instead of exiting 0.
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@shrabantipaul-collate shrabantipaul-collate added the safe to test Add this label to run secure Github workflows on PRs label Oct 28, 2026
Comment thread scripts/update_version.py Resolved
Comment thread scripts/update_version.py Resolved
Comment thread scripts/update_version.py Resolved
@gitar-bot

gitar-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🟡 Medium risk · Making release-version substitutions mandatory and stopping make on failures could block releases when expected file patterns drift.

Release bump now fails instead of exiting 0 when a version pattern matches nothing, and update_all runs under set -e so a half-bumped branch can't be committed. update_docker_tag also covers the ${VAR:-image} quickstart form and the OpenAPI version accepts SNAPSHOT strings. Resolved the stale-tag check that missed SNAPSHOT lines and added a decision record for the cross-repo regex_sub default. No issues found.

✅ 2 closed
✅ Bug: Stale-tag check misses SNAPSHOT lines when bumping to the release tag

📄 scripts/update_version.py:77-85
The safety net counts a line as bumped if f":{tag}" appears anywhere in it, and that is a substring test. The normal release cut goes from X-SNAPSHOT to X. Take bumping to 2.1.0: a line the substitution regex skips (the quoted form in test_an_image_line_in_another_shape_fails_the_bump, for example) still reads ...:2.1.0-SNAPSHOT. That line contains :2.1.0, so it passes the check and the bump exits 0 with a stale image tag, which is the failure this PR is meant to prevent. The existing test only covers it because its old tag (2.0.0-SNAPSHOT) doesn't share a prefix with the new one. The fix is to match the tag up to a terminator (whitespace, }, a quote or end of line), and to add a test that bumps 2.1.0-SNAPSHOT to 2.1.0.

✅ Quality: Cross-repo regex_sub default contract has no decision record

📄 scripts/update_version.py:22-31 📄 scripts/update_version.py:54 📄 scripts/update_version.py:72 📄 scripts/update_version.py:115 📄 scripts/update_version.py:131
The PR keeps regex_sub's default lenient because another repository depends on it. The description says "Collate's release bump imports it and expects some patterns to match nothing on a release branch" (open-metadata/openmetadata-collate#7924). That makes the function's signature and default a contract with another repository. No record in docs/decisions/ covers the release bump. The record would say: "scripts/update_version.py::regex_sub keeps required=False as its default because openmetadata-collate's release bump imports it; every OSS release-bump pattern passes required=True, and update_all and its targets run under set -e, so any missed match fails the bump." Without that record, a later cleanup that flips the default to strict, or a new OSS pattern added without required=True, would contradict nothing in the tree.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release bump silently skips the MySQL quickstart image tags and the OpenAPI version

1 participant