-
Notifications
You must be signed in to change notification settings - Fork 302
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
Use Task group to filter on list tasks instead of StartedBy #258
Conversation
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 mostly good. I have a small comment. Can you also confirm that Tasks that have already been started using the "started by" field continue to show up with this change?
@@ -120,7 +120,18 @@ func CollectTasksWithStatus(entity ProjectEntity, status string, filterLocal boo | |||
result := []*ecs.Task{} | |||
|
|||
err := entity.Context().ECSClient.GetTasksPages(request, func(respTasks []*ecs.Task) error { | |||
result = append(result, respTasks...) | |||
// Filter the results by task.Group | |||
if entity.EntityType() == "task" && filterLocal { |
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 you use a const for comparison instead of
"task"
? Also, it'd make more sense forEntityType()
to return an enum instead of a string (https://github.com/aws/amazon-ecs-cli/blob/master/ecs-cli/modules/cli/compose/entity/entity.go#L42) -
Can you update the comment for
CollectTasksWithStatus
to reflect this change as well? Right now,filterLocal
is only mentioned in the context ofstartedBy
// express or implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
|
||
package entityType |
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 can just be type
. enitity.entityType
stutters.
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.
type is used in go, don't think I can name it as type, but I can name it as types. What do you think? Right now is entityType.Type, but with the change it'll be types.EntityType
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.
types
is fine. You can just name it types.Type
?
yes, I've tested using running |
closes #97
Testing
Tasks:
Service: