Skip to content

Conversation

@nghialv
Copy link
Member

@nghialv nghialv commented Nov 11, 2021

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Allow triggering deployment when application is at out-of-sync state

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

@nakabonne
Copy link
Member

Test TestLambdaDeploymentConfig seems to be failed

@ono-max
Copy link
Member

ono-max commented Nov 12, 2021

When I tried to this change in my local environment (missing .pipe.yaml), I got a lot of notification in Slack at once as follows:

Screen Shot 2021-11-12 at 14 05 28

Should we sleep between notification?

@nghialv
Copy link
Member Author

nghialv commented Nov 15, 2021

When I tried to this change in my local environment (missing .pipe.yaml), I got a lot of notification in Slack at once as follows:

Nice catch!

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.04%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/app/piped/planpreview/builder.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go reportMostRecentlyTriggeredDeployment -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go determiners.Determiner -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommandDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnOutOfSyncDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go NewOnCommitDeterminer -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommitDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkRepoCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommandCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listOutOfSyncCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommitCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggered -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggerFailed -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.findTriggerApps 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.Run 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.updateRepoToLatest 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportMostRecentlyTriggeredDeployment 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.getNotification 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go NewDeterminer 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.ShouldTrigger 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.shouldTriggerOnCommit 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommands 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.syncApplication 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.listApplications 0.00% -- +-0.00%

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.04%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/app/piped/planpreview/builder.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go reportMostRecentlyTriggeredDeployment -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go determiners.Determiner -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommandDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnOutOfSyncDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go NewOnCommitDeterminer -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommitDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkRepoCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommandCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listOutOfSyncCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommitCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggered -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggerFailed -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.findTriggerApps 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.Run 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.updateRepoToLatest 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportMostRecentlyTriggeredDeployment 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.getNotification 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go NewDeterminer 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.ShouldTrigger 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.shouldTriggerOnCommit 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommands 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.syncApplication 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.listApplications 0.00% -- +-0.00%

@nakabonne
Copy link
Member

/lgtm

// Whether to exclude application from triggering target
// when application is at OUT_OF_SYNC state.
// Default is true.
Disabled bool `json:"disabled,omitempty" default:"true"`
Copy link
Member

Choose a reason for hiding this comment

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

nits, with this default:"true" labels on boolean type value, even if users explicitly set spec.input.trigger.onOutOfSync.Disable: false, they still can not enable trigger new deployment on out of sync.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, what do you mean?
Why " they still can not enable trigger new deployment on out of sync"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I got your point. The "defaults" lib is configuring that field to be true whenever its value is false, doesn't matter if it was specified explicitly or not. So its final value always will be true, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, so I think we may need *bool for this case 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. *bool or defined a new Bool type for that case. Let me fix it. Nice catch!

Copy link
Member

Choose a reason for hiding this comment

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

btw, other places (such as autoRollback configuration) have this issue as well, so addressing that issue by a separated PR is fine, but I just want to explicitly mention it to ensure everyone aware of that issue.

Copy link
Member

Choose a reason for hiding this comment

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

Right. *bool or defined a new Bool type for that case. Let me fix it. Nice catch!

Thanks, will fix other places by separated PR later 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

@khanhtc1202 I have added a TODO to this PR. And let me fix all of those things by a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

🙆‍♀️

@pipecd-bot pipecd-bot removed the lgtm label Nov 15, 2021
@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. Remove deprecated appCfg.TriggerPaths configuration.

https://github.com/pipe-cd/pipe/blob/12396182979ad9287880d483f882b9c81ad519a5/pkg/app/piped/trigger/determiner.go#L136-L139

This was created by todo plugin since "TODO:" was found in 1239618 when #2777 was merged. cc: @nghialv.

2. Find a better way to skip the CANCELLED error log while shutting down.

https://github.com/pipe-cd/pipe/blob/12396182979ad9287880d483f882b9c81ad519a5/pkg/app/piped/trigger/trigger.go#L209-L212

This was created by todo plugin since "TODO:" was found in 1239618 when #2777 was merged. cc: @nghialv.

3. Ensure that the given value will not be overridden by the default one.

https://github.com/pipe-cd/pipe/blob/12396182979ad9287880d483f882b9c81ad519a5/pkg/config/deployment.go#L94-L97

This was created by todo plugin since "TODO:" was found in 1239618 when #2777 was merged. cc: @nghialv.

4. Add a field to control the trigger frequency.

https://github.com/pipe-cd/pipe/blob/12396182979ad9287880d483f882b9c81ad519a5/pkg/config/deployment.go#L96-L99

This was created by todo plugin since "TODO:" was found in 1239618 when #2777 was merged. cc: @nghialv.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.04%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/app/piped/planpreview/builder.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/trigger/deployment.go reportMostRecentlyTriggeredDeployment -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go determiners.Determiner -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommandDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnOutOfSyncDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go NewOnCommitDeterminer -- 0.00% +0.00%
pkg/app/piped/trigger/determiner.go OnCommitDeterminer.ShouldTrigger -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkRepoCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommandCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listOutOfSyncCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.listCommitCandidates -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggered -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.notifyDeploymentTriggerFailed -- 0.00% +0.00%
pkg/app/piped/trigger/trigger.go loadDeploymentConfiguration -- 0.00% +0.00%
pkg/app/piped/planpreview/builder.go builder.findTriggerApps 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.triggerDeployment 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.Run 0.00% 0.00% +0.00%
pkg/app/piped/trigger/trigger.go Trigger.updateRepoToLatest 0.00% 0.00% +0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportMostRecentlyTriggeredDeployment 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.reportDeploymentFailed 0.00% -- +-0.00%
pkg/app/piped/trigger/deployment.go Trigger.getNotification 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go NewDeterminer 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.ShouldTrigger 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go Determiner.shouldTriggerOnCommit 0.00% -- +-0.00%
pkg/app/piped/trigger/determiner.go loadDeploymentConfiguration 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommands 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.checkNewCommits 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.syncApplication 0.00% -- +-0.00%
pkg/app/piped/trigger/trigger.go Trigger.listApplications 0.00% -- +-0.00%

@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.

@pipecd-bot pipecd-bot merged commit a50cc23 into master Nov 15, 2021
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.

6 participants