feat: ability to create releases without uploading them#715
feat: ability to create releases without uploading them#715
Conversation
Signed-off-by: Evans Mungai <evans@replicated.com>
| // internally by the release lint command. | ||
|
|
||
| // getToolVersion extracts a tool version from config, defaulting to "latest" if not found. | ||
| func getToolVersion(config *tools.Config, tool string) string { |
There was a problem hiding this comment.
This was an unused function I cleaned up
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0ef7018. Configure here.
| } | ||
| if r.args.createReleasePromoteRequired { | ||
| return errors.New("--no-upload cannot be used with --required (no release is uploaded)") | ||
| } |
There was a problem hiding this comment.
Unreachable --no-upload --required validation check and misleading test
Medium Severity
The createReleasePromoteRequired check inside the createReleaseNoUpload block (line 521) is unreachable dead code. To reach it, createReleasePromote must be empty (to pass the check at line 515) and createReleasePromoteRequired must be true — but that exact combination already triggers the earlier guard at line 509 ("--required can only be used with --promote"), returning before the --no-upload block is entered. The test TestNoUploadRejectsRequired masks this by also setting createReleasePromote: "Unstable", which causes the --promote check at line 515 to fire first, making the assertion match "--no-upload cannot be used with --promote" — identical to TestNoUploadRejectsPromote.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 0ef7018. Configure here.
Signed-off-by: Evans Mungai <evans@replicated.com>


Summary
Adds two new flags to
replicated release createso a release can be built locally and inspected (or fed into another command) without uploading it to the vendor portal:--no-upload: build the release locally and skip the API upload (and any promotion). Rejects--promote/--ensure-channel/--required.--output-dir <path>: stage the release artifacts (packaged charts + collected manifests for the.replicatedconfig flow, or the raw release JSON payload for--yaml/--yaml-file/--chartflows) at the given path and preserve them after the command completes.
The two flags are orthogonal: typical usage is
--no-upload --output-dir ./outto stage artifacts for inspection, while--output-diron its own keeps a copy of what was uploaded.Online mode is still required — the command continues to resolve the app type via the API even with
--no-upload. Going fully offline is out of scope here.Also drops an unused
getToolVersionhelper incli/cmd/lint.goflagged while editing nearby code.Refs: sc-137535