fix(release): gitea_release_plan ignores current_version's tag and includes already-released commits #28
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom
gitea_release_planwithcurrent_version: "0.7.40-dsh.7"proposes a major bump tov1.0.0and includes commits that are already released on that tag, e.g. the package rename shipped in0.7.40-dsh.4. The next intended release is 0.8.Repro
Tags including
v0.7.40-dsh.7exist (gitea_tags list), andgit log v0.7.40-dsh.7..masteris much smaller than the 50 commits reported.Observed vs expected
current_versiononly feeds the bump arithmetic. Released commits contaminate the changelog and force a false major bump.from_tag, start atv<current_version>(or requirefrom_tagand say so). Plan should read the commits after the current release and propose a minor bump for the current work.Root cause
lib/release-generator.js(buildReleasePlan):currentVersionis never used to derive a range;fromTag/toTagare only honoured when both are provided.Proposed fix
When
current_versionis supplied andfrom_tagis not, resolvev<current_version>and comparefromTag...HEAD(or toto_tag); fail clearly if the tag cannot be resolved. Keep the existing explicit-range behaviour. Add a test with a fake client asserting the derived range and the resulting bump.Acceptance: the live call above proposes
0.8.x(minor) and lists only post-v0.7.40-dsh.7commits; a missing tag produces a clear error.Duplicate check
Searched
release(state all) — #12 covered publishing, no release-plan issue exists.Layer
dsh-gitea plugin/tool.
Fixed in
b74ca23(PR #43).gitea_release_plannow derives the rangev<current_version>...<repo-default-branch>whenfrom_tagis absent, honours explicitfrom_tag/to_tag, and returns a clear error when the tag cannot be resolved instead of silently replaying the last 50 commits.Live:
current_version:"0.7.40-dsh.7"→Release Plan: v0.8.0 (minor bump from v0.7.40-dsh.7), 13 post-tag commits, no already-released package-rename commit.Tests:
test/release-package.test.mjs.