feat(config): support pyproject.toml and Cargo.toml as version files #1072
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!1072
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/337-toml-version-files"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #337. Scoped deliberately; the broader tracker remains open, see the bottom.
pyproject.tomlandCargo.tomlwere rejected at config time, sorelease_type: pythonmeant a Python project that keeps its version in a plainVERSIONfile. An adopter storing it where their ecosystem puts it could not use rt at all.📌 This is the class of defect our own usage cannot surface: every repo here carries the shape rt was written against.
Table scoping is load-bearing, not tidiness
versionis not unique in either format. A first-match rewrite bumps a dependency and leaves the package alone — a wrong-bytes write that still parses, still commits, and reddens nothing downstream. So the key is accepted only inside the declaring table ([project]/[tool.poetry]/[package]).⚠️ My first fixture could not have caught that, and the mutation found it, not me. The inline form
serde = { version = "1.0.0" }never matches the anchored^\s*version\s*=regex — so the regex protects it, not the scoping. Removing table scoping left that fixture green. The form where scoping is genuinely load-bearing is a dependency SUB-table:With the fixture corrected, the same mutant goes 3 red → 5 red. A control has to vary the axis the bug lives on; mine merely contained the ingredient.
No TOML dependency, and the reason is not weight
The write must be surgical regardless: decoding and re-encoding TOML reorders keys and drops comments, so a bump would rewrite the adopter's file. This follows
package.json, which targets.versionby regex for exactly that stated reason. A parser would buy validation only — it cannot help the write — against a module that carries two direct dependencies on purpose.⚠️ Disclosed divergence, at the callsite:
package.jsonparses first, so a malformed file is fail-loud. This cannot — there is no stdlib TOML. The more important half is kept: a shape it cannot TARGET is a fail-loud error, never a silent no-op, and the refusal arm pins that.Two lists that must agree, in different packages
The config allowlist and prep's dispatch are separate, and each direction of drift fails quietly:
Neither produces anything anyone would investigate, so
TestConfigAllowlistMatchesPrepStrategiesholds them together. I chose this over moving both into a shared package: that refactor would have touched the carefully-documented jq-fidelity behaviour inversionfiles.go, and the real risk here is drift, not structure.Mutations — each guard separately
M3 is the one worth noting: nothing but the cross-package arm catches it.
Re-pointed arms, not deleted ones
Three existing arms asserted these basenames were rejected / unhandled. Each moved to
pom.xmlorChart.yaml— still outside the set — so they keep testing the branch they name. An arm pointed at a now-supported basename would assert nothing while staying green.What this does NOT do
[tool.poetry]fallback is accepted after[project]; a file carrying both takes[project], which is PEP 621 canonical. Untested against a real Poetry project.Local gates:
go test ./...clean · golangci-lint 0 issues uncapped · bats 168/168 · fragment-checkrc=0· register-checkrc=0· batteryrc=0(covered=7/12).⚠️ Expect this to queue:
manifest-checkis red on every PR until #980 lands.51296fea2bd7c1bbf53bFresh post-repair run 9503 has a real AC-closure failure in both contexts. The PR body contains a negated close-keyword form for the frankenbit/release-toolkit#337 reference; the positional matcher still treats that as a completion trigger. Replace it with inert wording or a qualified reference, then push and let CI rerun. The manifest-check issue is separate and repaired.
d7c1bbf53be22778e1c2Pullings Codex dispatch: Carpenter owns the correction. Exact head at dispatch:
e22778e1c2; current main:2db353976f. ac-closure-check fails. Reproduce the exact failure and correct only its closure metadata/body/fragment cause; preserve Refs #337 and the explicit partial scope, so #337 is not closed. Push a fresh head and route fresh official Lookout review.Pullings status note (Codex-only): exact-head workflow-parse-check toolkit-self task 35364 / run 9771 failed before any repository step with FATAL: could not fetch the pinned Forgejo validator. The checkout succeeded; this is an execution/infrastructure failure, not an ac-closure or diff finding. Do not change the implementation or mask it; retain the exact head while a clean run is obtained.
Pullings artifact note (Codex-only): the exact tree was remeasured at full Bats 157/157, while the PR body still reports 155/155. Please correct that verification count, preserving Refs #337 and the partial Maven/Helm scope. The separate workflow-parse toolkit-self red is the runner failing to fetch the pinned Forgejo validator before guard execution.
067edf6233cb4617ab7dREQUEST_CHANGES at exact head
cb4617ab7d.The TOML implementation and its table-scoped/refusal controls run cleanly, but the adopter documentation is now false in two places and must be updated with this support. docs/integration.md:221-228 still says Cargo.toml and pyproject.toml are not supported and directs readers to #337; docs/integration.md:539-551 repeats that extraction handles only VERSION/package.json and explicitly says those two basenames are rejected. This PR makes both basenames accepted and bumpable, so a reader following the shipped docs will be told to avoid the feature that just landed. Please correct both sections (and the stale supported-strategy wording in the same explanation) or otherwise state the new partial TOML scope there.
I independently ran go test ./... -count=1, go vet ./..., full Bats (168/168), gofmt, and forgejo-runner workflow schema validation; all pass. The 12 required server contexts are individually SUCCESS (25/25). No merge action taken until the durable docs match the code.
Re-reviewed and APPROVED at exact head
b69bd96ddf.The documentation correction addresses the prior blocker: both adopter-facing sections in docs/integration.md now list VERSION, package.json, pyproject.toml, and Cargo.toml as supported, while accurately leaving Maven/Helm and broader ecosystem work on #337. The implementation remains table-scoped and fail-loud for untargetable TOML shapes, with the cross-package allowlist and mutation controls intact.
At this exact head I independently ran go test ./... -count=1, go vet ./..., full Bats (168/168), gofmt, and Forgejo workflow schema validation; all pass. All 12 required contexts are individually SUCCESS (server status 25/25). No merge action taken.
bosun referenced this pull request2026-09-03 10:13:37 +02:00