Skip to content

Commit

Permalink
Add warning on some CLI commands that orbs cannot be deleted once the…
Browse files Browse the repository at this point in the history
…y are created
  • Loading branch information
rlegan committed Apr 20, 2023
1 parent 66c2bfe commit d03951c
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 d03951c

Please sign in to comment.