Add --dry-run flag to release command #24

Closed
opened 2026-04-30 00:24:40 +02:00 by heiko · 0 comments
Owner

Summary

Add a --dry-run flag to gogogo release that shows what would happen without actually building or uploading anything.

Motivation

Currently there is no way to validate configuration, target resolution, or commit expansion without performing the full build+upload cycle. This makes it hard to debug config issues or verify CI pipelines without side effects.

Expected behavior

When gogogo release --dry-run is invoked, the tool should:

  1. Resolve the commit reference (expand @, +, latest as usual)
  2. Load and validate the config (.gogogo.conf)
  3. Print a summary of what would happen:
    • Module being built
    • Resolved commit/tag
    • Target OS/arch pairs
    • Commands to be built
    • Upload destination (API URL, owner, repo)
  4. Exit without creating temp dirs, running go build, or making any API calls

Implementation hints

  • The flag should be added in internal/cli/ on the release command
  • Pass it through to internal/cmd/release.Run (e.g. as a field on the options struct)
  • The three phases in Run (resolveCommit, loadConfig, execute) already provide natural cut points — dry-run can stop before execute or enter execute in a display-only mode
  • Consider structured output (JSON) as a follow-up, but plain text is fine for v1
## Summary Add a `--dry-run` flag to `gogogo release` that shows what would happen without actually building or uploading anything. ## Motivation Currently there is no way to validate configuration, target resolution, or commit expansion without performing the full build+upload cycle. This makes it hard to debug config issues or verify CI pipelines without side effects. ## Expected behavior When `gogogo release --dry-run` is invoked, the tool should: 1. Resolve the commit reference (expand `@`, `+`, `latest` as usual) 2. Load and validate the config (`.gogogo.conf`) 3. Print a summary of what *would* happen: - Module being built - Resolved commit/tag - Target OS/arch pairs - Commands to be built - Upload destination (API URL, owner, repo) 4. Exit without creating temp dirs, running `go build`, or making any API calls ## Implementation hints - The flag should be added in `internal/cli/` on the `release` command - Pass it through to `internal/cmd/release.Run` (e.g. as a field on the options struct) - The three phases in `Run` (`resolveCommit`, `loadConfig`, `execute`) already provide natural cut points — dry-run can stop before `execute` or enter `execute` in a display-only mode - Consider structured output (JSON) as a follow-up, but plain text is fine for v1
heiko closed this issue 2026-05-02 00:17:12 +02:00
Sign in to join this conversation.
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#24
No description provided.