-
Notifications
You must be signed in to change notification settings - Fork 391
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
chore(cli): env delete should not proceed when it is used in any pipelines #5246
Conversation
🍕 Here are the new binary sizes!
|
Codecov Report
@@ Coverage Diff @@
## mainline #5246 +/- ##
============================================
- Coverage 69.79% 69.78% -0.01%
============================================
Files 296 296
Lines 44513 44544 +31
Branches 286 286
============================================
+ Hits 31068 31087 +19
- Misses 11942 11952 +10
- Partials 1503 1505 +2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm ship it boss
return fmt.Errorf("get pipeline %s: %w", pipeline.ResourceName, err) | ||
} | ||
for _, stage := range info.Stages { | ||
if strings.TrimPrefix(stage.Name, deploy.StageFullNamePrefix) == o.name { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the most durable way we can find this out? Do we stick the manifest in the pipeline metadata?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good question. We've never changed our naming pattern for this and I am making it more durable by extracting deploy.StageFullNamePrefix
.
Do we stick the manifest in the pipeline metadata?
Unfortunately we don't do that for manifest :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we don't do that for manifest :(
Maybe we should! (later)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
getter.EXPECT().GetPipeline("mockResourceName").Return(&codepipeline.Pipeline{ | ||
Stages: []*codepipeline.Stage{ | ||
{ | ||
Name: "DeployTo-test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test having the name hardcoded helps with the durability too because it should catch any breaking name change 👍
@@ -188,6 +188,10 @@ func (o *deleteAppOpts) Ask() error { | |||
// It removes all the services from each environment, the environments, the pipeline S3 buckets, | |||
// the pipeline, the application, removes the variables from the config store, and deletes the local workspace. | |||
func (o *deleteAppOpts) Execute() error { | |||
if err := o.deletePipelines(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a comment why it needs to go first? or just in the Execute()
description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the function comment. I think it's pretty obvious. Deleting the pipelines in the middle (previous impl) should be more confusing because nothing depends on a pipeline.
…lines (aws#5246) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.