Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning on some CLI commands that orbs cannot be deleted once they are created #909

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cmd/orb.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ func processOrb(opts orbOptions) error {
}

func publishOrb(opts orbOptions) error {
orbInformThatOrbCannotBeDeletedMessage()
path := opts.args[0]
ref := opts.args[1]
namespace, orb, version, err := references.SplitIntoOrbNamespaceAndVersion(ref)
Expand Down Expand Up @@ -794,6 +795,8 @@ func validateSegmentArg(label string) error {
}

func incrementOrb(opts orbOptions) error {
orbInformThatOrbCannotBeDeletedMessage()

ref := opts.args[1]
segment := opts.args[2]

Expand Down Expand Up @@ -822,6 +825,8 @@ func incrementOrb(opts orbOptions) error {
}

func promoteOrb(opts orbOptions) error {
orbInformThatOrbCannotBeDeletedMessage()

ref := opts.args[0]
segment := opts.args[1]

Expand Down Expand Up @@ -1104,6 +1109,8 @@ func initOrb(opts orbOptions) error {
var err error
fmt.Println("Note: This command is in preview. Please report any bugs! https://github.com/CircleCI-Public/circleci-cli/issues/new/choose")

orbInformThatOrbCannotBeDeletedMessage()

fullyAutomated := 0
prompt := &survey.Select{
Message: "Would you like to perform an automated setup of this orb?",
Expand Down Expand Up @@ -1734,3 +1741,8 @@ func stringifyDiff(diff gotextdiff.Unified, colorOpt string) string {
color.NoColor = oldNoColor
return strings.Join(lines, "\n")
}

func orbInformThatOrbCannotBeDeletedMessage() {
fmt.Println("Once an orb is created it cannot be deleted. Orbs are semver compliant, and each published version is immutable. Publicly released orbs are potential dependencies for other projects.")
fmt.Println("Therefore, allowing orb deletion would make users susceptible to unexpected loss of functionality.")
}