publish: warn before build when --replace finds no existing release ai:claude-sonnet-4-6 #66

Merged
heiko merged 2 commits from dev into master 2026-05-22 00:33:24 +02:00
Owner

When --replace is set but no Forgejo release exists for the tag yet,
gogogo now warns before starting the build rather than after a full
(wasted) build.

Changes

  • warnIfNothingToReplace: pre-build check that calls GetReleaseByTag
    when --replace is active and all network guards pass; logs a warning
    and continues as a fresh publish
  • warnedReplaceNoop field suppresses the redundant post-build
    "had no effect" warning when the pre-build check already fired
  • newForgejoCli injectable var: both the pre-build check and
    publishRelease now share the same client construction path, making
    both testable without a live server
  • Two unit tests: TestWarnIfNothingToReplace_WarnsWhenNoRelease and
    TestWarnIfNothingToReplace_SilentWhenReleaseExists

What is NOT blocked

Re-publishing to an existing release without --replace (e.g. adding a
new Debian revision) is unaffected — the check only fires when --replace
is explicitly set.

(co)authored by ai:claude-sonnet-4-6

When `--replace` is set but no Forgejo release exists for the tag yet, gogogo now warns before starting the build rather than after a full (wasted) build. ## Changes - `warnIfNothingToReplace`: pre-build check that calls `GetReleaseByTag` when `--replace` is active and all network guards pass; logs a warning and continues as a fresh publish - `warnedReplaceNoop` field suppresses the redundant post-build "had no effect" warning when the pre-build check already fired - `newForgejoCli` injectable var: both the pre-build check and `publishRelease` now share the same client construction path, making both testable without a live server - Two unit tests: `TestWarnIfNothingToReplace_WarnsWhenNoRelease` and `TestWarnIfNothingToReplace_SilentWhenReleaseExists` ## What is NOT blocked Re-publishing to an existing release without `--replace` (e.g. adding a new Debian revision) is unaffected — the check only fires when `--replace` is explicitly set. (co)authored by ai:claude-sonnet-4-6
Add warnIfNothingToReplace: before starting the build, check Forgejo for
an existing release when --replace is set. If nothing is there yet, log a
warning and continue rather than wasting a full build to discover it post-facto.

Suppress the redundant post-build "had no effect" warning when the pre-build
check already reported it (warnedReplaceNoop field).

Also introduce newForgejoCli injectable var so both the pre-build check and
publishRelease use the same construction path, making both testable without a
live server.
heiko merged commit b2d8fcadf9 into master 2026-05-22 00:33:24 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
heiko/gogogo!66
No description provided.