Implement BuildPipelineSyncStages for k8s multi sync #5596
Merged
Conversation
ffjlabo
commented
Feb 21, 2025
| @@ -0,0 +1,125 @@ | |||
| // Copyright 202 The PipeCD Authors. | |||
Member
Author
There was a problem hiding this comment.
borrowed these code from k8s plugin
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5596 +/- ##
==========================================
+ Coverage 26.24% 26.26% +0.02%
==========================================
Files 472 474 +2
Lines 50428 50475 +47
==========================================
+ Hits 13234 13259 +25
- Misses 36134 36153 +19
- Partials 1060 1063 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
7337551 to
4e93517
Compare
Warashi
reviewed
Feb 25, 2025
Member
Warashi
left a comment
There was a problem hiding this comment.
Almost LGTM. I commented on nits.
| return a.Index - b.Index | ||
| }).Index | ||
|
|
||
| // we copy the predefined stage to avoid modifying the original one. |
Member
There was a problem hiding this comment.
There seems to be no predefined stage and no copy.
Suggested change
| // we copy the predefined stage to avoid modifying the original one. |
Comment on lines
+24
to
+28
| // StageK8sSync represents the state where | ||
| // all resources should be synced with the Git state. | ||
| StageK8sMultiSync string = "K8S_MULTI_SYNC" | ||
| // StageK8sRollback represents the state where all deployed resources should be rollbacked. | ||
| StageK8sMultiRollback string = "K8S_MULTI_ROLLBACK" |
Member
There was a problem hiding this comment.
It might be forgotten to change the comment.
Suggested change
| // StageK8sSync represents the state where | |
| // all resources should be synced with the Git state. | |
| StageK8sMultiSync string = "K8S_MULTI_SYNC" | |
| // StageK8sRollback represents the state where all deployed resources should be rollbacked. | |
| StageK8sMultiRollback string = "K8S_MULTI_ROLLBACK" | |
| // StageK8sMultiSync represents the state where | |
| // all resources should be synced with the Git state. | |
| StageK8sMultiSync string = "K8S_MULTI_SYNC" | |
| // StageK8sMultiRollback represents the state where all deployed resources should be rollbacked. | |
| StageK8sMultiRollback string = "K8S_MULTI_ROLLBACK" |
Comment on lines
+115
to
+116
| t.Run(tt.name, func(t *testing.T) { | ||
| actual := BuildPipelineStages(tt.input) |
Member
There was a problem hiding this comment.
It's nice to have t.Parallel() here.
Suggested change
| t.Run(tt.name, func(t *testing.T) { | |
| actual := BuildPipelineStages(tt.input) | |
| t.Run(tt.name, func(t *testing.T) { | |
| t.Parallel() | |
| actual := BuildPipelineStages(tt.input) |
|
|
||
| type deployTargetConfig struct{} | ||
|
|
||
| var _ sdk.StagePlugin[config, deployTargetConfig] = (*plugin)(nil) |
Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does:
as title.
I checked the behavior with planning pipeline sync. It is ok to fail the execution because I don't implement its logic.
Why we need it:
Which issue(s) this PR fixes:
Part of #5006
Does this PR introduce a user-facing change?: