Skip to content

Conversation

@nghialv
Copy link
Member

@nghialv nghialv commented Nov 17, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@nghialv nghialv changed the title Ensure that Piped use QUICK_SYNC for deployment triggered on OUT_OF_SYNC Ensure Piped uses QUICK_SYNC for deployment triggered on OUT_OF_SYNC Nov 17, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.88%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/trigger/trigger.go Trigger.checkRepoCandidates 0.00% 0.00% +0.00%

@nakabonne
Copy link
Member

web-test seems to be failed 👁️

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.88%. This pull request decreases coverage by -0.03%.

File Function Base Head Diff
pkg/app/piped/trigger/trigger.go Trigger.checkRepoCandidates 0.00% 0.00% +0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for javascript is 84.24%. This pull request does not change code coverage.

@nghialv
Copy link
Member Author

nghialv commented Nov 17, 2021

Thanks. I have just fixed the test.

@nakabonne
Copy link
Member

Nice
/lgtm

Comment on lines +219 to +222
// Avoid triggering multiple deployments for the same application in the same iteration.
if _, ok := triggered[app.Id]; ok {
continue
}
Copy link
Member

@khanhtc1202 khanhtc1202 Nov 17, 2021

Choose a reason for hiding this comment

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

Looks like the trigger which comes first has a higher priority than the one of the same application which comes after. I'm okay with that but since those candidates come from different kinds (onCommand, onCommit, onOutOfSync, etc), maybe we need a better way to choose which one should have a higher priority based on the c.Kind or something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I understand your feeling. 👍
Tbh, I was thinking about that. One way I was planned to use is sorting the candidate list in this function by kind, but after the second thought, I decided to do nothing because the passing list could be controlled by the caller. The caller can sort in the order it wants.
Maybe in the future, when we have more kinds we can add some kind of priority field to the candidate struct to decide.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, let's keep it as is and make changes to use ordering later.

@khanhtc1202
Copy link
Member

Nice work 👍
/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.

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.

5 participants