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

Add the ability to force the sync strategy via SYNC_APPLICATION command #1264

Merged
merged 7 commits into from Dec 16, 2020

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented Dec 16, 2020

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1165

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.77%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/planner/kubernetes/pipeline.go buildQuickSyncPipeline -- 85.71% +85.71%
pkg/app/piped/planner/kubernetes/kubernetes.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/kubernetes/pipeline.go buildPipeline 85.71% -- -85.71%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.77%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/planner/kubernetes/pipeline.go buildQuickSyncPipeline -- 85.71% +85.71%
pkg/app/piped/planner/kubernetes/kubernetes.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/kubernetes/pipeline.go buildPipeline 85.71% -- -85.71%

@cakecatz
Copy link
Contributor

cakecatz commented Dec 16, 2020

@nghialv We need to modify syncApplication like this to put syncStrategy on the request.

https://github.com/pipe-cd/pipe/blob/sync/pkg/app/web/src/api/applications.ts#L97-L105

export const syncApplication = async ({
  applicationId,
  syncStrategy, // added
}: SyncApplicationRequest.AsObject): Promise<
  SyncApplicationResponse.AsObject
> => {
  const req = new SyncApplicationRequest();
  req.setApplicationId(applicationId);
  req.setSyncStrategy(syncStrategy); // added
  return apiRequest(req, apiClient.syncApplication);
};

@nghialv
Copy link
Member Author

nghialv commented Dec 16, 2020

@cakecatz Right. I added them.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.77%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/planner/kubernetes/pipeline.go buildQuickSyncPipeline -- 85.71% +85.71%
pkg/app/piped/planner/kubernetes/kubernetes.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/kubernetes/pipeline.go buildPipeline 85.71% -- -85.71%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.77%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/planner/kubernetes/pipeline.go buildQuickSyncPipeline -- 85.71% +85.71%
pkg/app/piped/planner/kubernetes/kubernetes.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/kubernetes/pipeline.go buildPipeline 85.71% -- -85.71%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for javascript is 81.29%. This pull request increases coverage by 0.03%.

File Base Head Diff
src/modules/applications.ts 85.71% 86.00% +0.29%
src/fixtures/dummy-deployment.ts 100.00% 100.00% +0.00%
src/api/applications.ts 28.21% 29.11% +0.91%

@cakecatz
Copy link
Contributor

/lgtm

Copy link
Member

@nakabonne nakabonne left a comment

Choose a reason for hiding this comment

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

Left a comment about the strategy name, but looks pretty neat

@@ -88,11 +88,18 @@ message Deployment {
int64 updated_at = 102 [(validate.rules).int64.gte = 0];
}

enum SyncStrategy {
NONE = 0;
Copy link
Member

Choose a reason for hiding this comment

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

NONE is a bit confusable to me. I feel like it would be better to use AUTO or UNDEFINED or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice. AUTO looks good.

@pipecd-bot pipecd-bot removed the lgtm label Dec 16, 2020
@nakabonne
Copy link
Member

/lgtm

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 33.77%. This pull request decreases coverage by -0.04%.

File Function Base Head Diff
pkg/app/piped/planner/kubernetes/pipeline.go buildQuickSyncPipeline -- 85.71% +85.71%
pkg/app/piped/planner/kubernetes/kubernetes.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/kubernetes/pipeline.go buildPipeline 85.71% -- -85.71%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for javascript is 81.29%. This pull request increases coverage by 0.03%.

File Base Head Diff
src/fixtures/dummy-deployment.ts 100.00% 100.00% +0.00%
src/api/applications.ts 28.21% 29.11% +0.91%
src/modules/applications.ts 85.71% 86.00% +0.29%

@khanhtc1202
Copy link
Member

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

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 2477ae2 into master Dec 16, 2020
@pipecd-bot pipecd-bot deleted the sync branch December 16, 2020 09:24
@pipecd-bot pipecd-bot mentioned this pull request Dec 16, 2020
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.

Add the ability to force sync strategy via SYNC_APPLICATION command
5 participants