Skip to content
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

Reimplement ECS Sync with EXTERNAL deployment controller #2007

Merged
merged 5 commits into from
May 27, 2021
Merged

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented May 26, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Related to #1568

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.90%. This pull request does not change code coverage.

@pipecd-bot pipecd-bot added size/L and removed size/M labels May 26, 2021
@khanhtc1202 khanhtc1202 changed the title [WIP] ECS Sync with EXTERNAL deployment controller refinement Reimplement ECS Sync with EXTERNAL deployment controller May 26, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.90%. This pull request does not change code coverage.

if err != nil {
return nil, fmt.Errorf("failed to get primary task set of service %s: %w", *service.ServiceName, err)
}
taskSets := output.Services[0].TaskSets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check to ensure the Services slice is not empty.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on 4b5761b 🙏

return &taskSet, nil
}
}
return nil, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not found should be an error as we always do.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on 8808feb 🙏

Comment on lines 145 to 148
prevPrimaryTaskSet, err := client.GetPrimaryTaskSet(ctx, *service)
if err != nil {
in.LogPersister.Errorf("Failed to create ECS task set %s: %v", *serviceDefinition.ServiceName, err)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel it more readable to move this part to L162 as related things get close together.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, we will get the newly promoted (to primary) task set since we called UpdateServicePrimaryTaskSet at L158 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will 👍
makes sense, never mind

@nakabonne
Copy link
Member

LGTM except for the not found error part mentioned by nghialv
/lgtm

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.90%. This pull request does not change code coverage.

@pipecd-bot pipecd-bot removed the lgtm label May 27, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.90%. This pull request does not change code coverage.

@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Support update other properties of service.

https://github.com/pipe-cd/pipe/blob/8808feb81ca5eafb6b84b585fb4701a0dbba5d9b/pkg/app/piped/cloudprovider/ecs/client.go#L105-L108

This was created by todo plugin since "TODO:" was found in 8808feb when #2007 was merged. cc: @khanhtc1202.

2. Support tags for registering task definition.

https://github.com/pipe-cd/pipe/blob/8808feb81ca5eafb6b84b585fb4701a0dbba5d9b/pkg/app/piped/cloudprovider/ecs/client.go#L128-L131

This was created by todo plugin since "TODO:" was found in 8808feb when #2007 was merged. cc: @khanhtc1202.

3. Find better way to get those 2 values instead of set it via service def.

https://github.com/pipe-cd/pipe/blob/8808feb81ca5eafb6b84b585fb4701a0dbba5d9b/pkg/app/piped/cloudprovider/ecs/client.go#L149-L152

This was created by todo plugin since "TODO:" was found in 8808feb when #2007 was merged. cc: @khanhtc1202.

@nghialv
Copy link
Member

nghialv commented May 27, 2021

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit fa87633 into master May 27, 2021
@pipecd-bot pipecd-bot deleted the ecs-sync branch May 27, 2021 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants