GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(cli): implement ask for task run by Louise15926 · Pull Request #1036 · aws/copilot-cli

This repository was archived by the owner on Jun 22, 2026. It is now read-only.

Conversation

@Louise15926

@Louise15926 Louise15926 commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

This PR has two major changes: 1. add ask to task run; 2. add a required flag for task-family name, update validate and ask correspondingly

Related #702

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Lou1415926 and others added 27 commits June 4, 2020 11:10
@Lou1415926
add task command
7599107
@Lou1415926
feat(cli) add validate for task run
cef29bc
@Lou1415926
Merge branch 'master' of github.com:aws/amazon-ecs-cli-v2 into task-run
914563f
@Lou1415926
chore: refactor task run code
de6ffd7
@Lou1415926
Merge pull request #1 from Louise15926/task-run
a0ccc0f
Add validate to task run
@Lou1415926
chore: fix typo
3d0d0f6
@Lou1415926
chore: fix indentation
7e6dffd
@Lou1415926
chore: fix indentation
156d704
@Lou1415926
Merge branch 'master' of github.com:Louise15926/amazon-ecs-cli-v2
ca53d67
@Lou1415926
update regex for image name
029c9c7
@Lou1415926 @bvtujo
Address feedback
c31d917
Co-authored-by: Austin Ely <[email protected]>
@Lou1415926
address feedback
fb823c2
@Lou1415926
Merge branch 'master' of github.com:Louise15926/amazon-ecs-cli-v2
d9cb07a
@Lou1415926
address feedback
33cba57
@Lou1415926
Merge branch 'master' of github.com:aws/amazon-ecs-cli-v2
88e22eb
@Lou1415926
address feedback and fix typo
29fd0e8
@Lou1415926
fix error message
e3a95a7
@Lou1415926
Merge branch 'master' of github.com:aws/amazon-ecs-cli-v2
34bd968
@Lou1415926
Merge branch 'master' of github.com:aws/amazon-ecs-cli-v2
d13e17a
@Lou1415926
remove task command from main
2c68796
@Lou1415926
Merge branch 'master' of github.com:aws/amazon-ecs-cli-v2
a6c7034
@Lou1415926
add ask for task run
902d4ef
@Lou1415926
add a required flag for task family name
53aec00
@Lou1415926
modify prompt messages
6dd753f
@Lou1415926
fix bug
91359a0
@Lou1415926
change test cases name
b4f143e
@Lou1415926
minor fix
08e1d80
@Louise15926
Louise15926 requested review from bvtujo, iamhopaul123 and piradeepk June 19, 2020 19:03
@Louise15926
Louise15926 requested a review from a team as a code owner June 19, 2020 19:03
iamhopaul123
iamhopaul123 approved these changes Jun 19, 2020
View reviewed changes

@iamhopaul123 iamhopaul123 left a comment

Copy link
Copy Markdown
Contributor

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.

Looks really good to me! Just one small suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Lou1415926
Merge branch 'master' into master
774e566
piradeepk
piradeepk reviewed Jun 22, 2020
View reviewed changes
Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

piradeepk
piradeepk reviewed Jun 22, 2020
View reviewed changes
Comment thread internal/pkg/cli/flag.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

piradeepk
piradeepk reviewed Jun 22, 2020
View reviewed changes
Comment thread internal/pkg/cli/task_run_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

piradeepk
piradeepk reviewed Jun 22, 2020
View reviewed changes
Comment thread internal/pkg/cli/task_run_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Louise15926 Louise15926 added the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 22, 2020
Lou1415926 added 4 commits June 22, 2020 16:07
@Lou1415926
address feedback
5a82d66
@Lou1415926
Merge branch 'master' of github.com:Louise15926/amazon-ecs-cli-v2
1a1e97a
@Lou1415926
Merge branch 'master' into master
c3d2bbe
@Lou1415926
Merge branch 'master' of github.com:Louise15926/amazon-ecs-cli-v2
c7df8c2
bvtujo
bvtujo reviewed Jun 22, 2020
View reviewed changes

@bvtujo bvtujo left a comment

Copy link
Copy Markdown
Contributor

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.

Awesome progress! Can't wait to see the next one!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/validate.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread internal/pkg/cli/task_run.go
}
if err := o.askEnvName(); err != nil {
return err
}

@bvtujo bvtujo Jun 22, 2020

Copy link
Copy Markdown
Contributor

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.

Should we add an ask method for the number of tasks to run?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Louise15926 Louise15926 Jun 22, 2020

Copy link
Copy Markdown
Contributor Author

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 would basically make "number of tasks" a required field right? But it is (currently meant to be) an optional field which default value to 1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 22, 2020

Copy link
Copy Markdown
Contributor

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.

We can have default value for the prompt but +1 on that, since I think for most of cases the num will just be 1.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Lou1415926 and others added 4 commits June 22, 2020 18:02
@Lou1415926 @bvtujo
Update internal/pkg/cli/task_run.go
6b0c9df
address feedback

Co-authored-by: Austin Ely <[email protected]>
@Lou1415926
add AppEnvWithNoneSelector
f8eab62
@Lou1415926
address feedback
b69d9a2
@Lou1415926
rename count flag and task-group-name flag
9df9159
piradeepk
piradeepk approved these changes Jun 23, 2020
View reviewed changes

@piradeepk piradeepk left a comment

Copy link
Copy Markdown
Contributor

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.

Ship it! 💯 @Louise15926 this looks awesome!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@piradeepk
piradeepk requested a review from bvtujo June 23, 2020 19:31
@piradeepk piradeepk changed the title feat(cli): add ask to task run and add flag for task family name feat(cli): implement ask for task run Jun 23, 2020
@Lou1415926
Merge branch 'master' into master
690a694
bvtujo
bvtujo approved these changes Jun 23, 2020
View reviewed changes

@bvtujo bvtujo left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Awesome, this looks so good! I just had a few comments about unit test coverage of all the error cases, but feel free to remove the do-not-merge label once you've addressed those! The most important one to consider is what happens when the call to askEnvName returns "None" instead of an existing env.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/selector/selector.go Outdated
func (s *Select) EnvironmentWithNone(prompt, help, app string) (string, error) {
envs, err := s.retrieveEnvironments(app)
if err != nil {
return "", fmt.Errorf("get environments for app %s from metadata store: %w", app, err)

@bvtujo bvtujo Jun 23, 2020

Copy link
Copy Markdown
Contributor

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.

Can we add a unit test that will hit this error block?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Louise15926 Louise15926 Jun 23, 2020

Copy link
Copy Markdown
Contributor Author

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.

Good call..! I realized that EnvironmentWithNone and Environment wrap the error returned from retrieveEnvironments, which is from the same package. Is this wrapping necessary? I feel like I can just return "", err for line 147.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

piradeepk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@bvtujo bvtujo Jun 24, 2020

Copy link
Copy Markdown
Contributor

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.

I think this error can be passed through like you say instead of being wrapped.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread internal/pkg/cli/task_run.go
if err := o.askTaskGroupName(); err != nil {
return err
}
if err := o.askEnvName(); err != nil {

@bvtujo bvtujo Jun 23, 2020

Copy link
Copy Markdown
Contributor

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.

Can we add a unit test to mock this failure and ensure that the error is wrapped?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bvtujo bvtujo Jun 23, 2020

Copy link
Copy Markdown
Contributor

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.

Also on this method call, can we add a unit test which returns "None" to ensure that everything works as expected in the case that we have to check the default cluster?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Lou1415926 added 2 commits June 23, 2020 16:32
@Lou1415926
add unit tests to cover error blocks
f20d5b7
@Lou1415926
Merge branch 'master' of github.com:Louise15926/amazon-ecs-cli-v2
806ba76
@Louise15926 Louise15926 removed the do-not-merge Pull requests that mergify shouldn't merge until the requester allows it. label Jun 24, 2020
@mergify
mergify Bot merged commit 75d7715 into aws:master Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@bvtujo bvtujo bvtujo approved these changes
@iamhopaul123 iamhopaul123 iamhopaul123 approved these changes
@piradeepk piradeepk piradeepk approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@Louise15926 @bvtujo @piradeepk @iamhopaul123 @Lou1415926
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.