Skip to content

Commit

Permalink
Merge pull request #909 from CircleCI-Public/DEVEX-893-add-warning-on…
Browse files Browse the repository at this point in the history
…-some-cli-commands-that-orbs-cannot-be-deleted-once-they-are-created

Add warning on some CLI commands that orbs cannot be deleted once they are created
  • Loading branch information
rlegan authored Apr 24, 2023
2 parents 8a362b1 + d03951c commit a588835
Showing 1 changed file with 12 additions and 0 deletions.
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.")
}

0 comments on commit a588835

Please sign in to comment.