Skip to content

feat: ability to create releases without uploading them#715

Open
banjoh wants to merge 2 commits intomainfrom
evansmungai/sc-137535/replicated-release-create-output-dir-to-stage
Open

feat: ability to create releases without uploading them#715
banjoh wants to merge 2 commits intomainfrom
evansmungai/sc-137535/replicated-release-create-output-dir-to-stage

Conversation

@banjoh
Copy link
Copy Markdown
Member

@banjoh banjoh commented May 5, 2026

Summary

Adds two new flags to replicated release create so 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 .replicated config flow, or the raw release JSON payload for --yaml/--yaml-file/--chart
    flows) at the given path and preserve them after the command completes.

The two flags are orthogonal: typical usage is --no-upload --output-dir ./out to stage artifacts for inspection, while --output-dir on 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 getToolVersion helper in cli/cmd/lint.go flagged while editing nearby code.

Refs: sc-137535

Signed-off-by: Evans Mungai <evans@replicated.com>
Comment thread cli/cmd/lint.go
// 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 {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an unused function I cleaned up

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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.

Comment thread cli/cmd/release_create.go
}
if r.args.createReleasePromoteRequired {
return errors.New("--no-upload cannot be used with --required (no release is uploaded)")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0ef7018. Configure here.

Comment thread cli/cmd/release_create.go Outdated
Signed-off-by: Evans Mungai <evans@replicated.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants