-
Notifications
You must be signed in to change notification settings - Fork 204
Add ability to disable auto trigger deployment on git change #2714
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
Conversation
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
| SealedSecrets []SealedSecretMapping `json:"sealedSecrets"` | ||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| TriggerPaths []string `json:"triggerPaths,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep both of fields to avoid breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see, then mark it as deprecated and remove it later 👍 Lets me address this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by 6591559
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better update our docs as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do it by a separated PR 🙏
|
Code coverage for golang is
|
|
This should fix #2245 |
pkg/config/deployment.go
Outdated
| // Regular expression can be used. | ||
| Paths []string `json:"paths,omitempty"` | ||
| // Control trigger new deployment on Git change or not. | ||
| DisableAutoDeployOnChange bool `json:"disableAutoDeployOnChange,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
triggerOnChange: true
triggerOnSyncCommand: true
triggerOnChain: trueor
onChange: true
onSyncCommand: true
onChain: trueor
on:
- GIT_CHANGE
- SYNC_COMMAND
- CHAINor
onChange:
disabled: true
onSyncCommand:
disabled: true
onChain:
disabled: true
otherConfig: fooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point; let me carefully think about this 👍 At a glance, I believe (3) is best for our deployment chain implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Let take the time to think about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added another option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's too many (but I liked it) 😄
|
/hold |
6591559 to
cbd67d8
Compare
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
Code coverage for golang is
|
|
/hold cancel |
|
Code coverage for golang is
|
|
Code coverage for golang is
|
pkg/config/deployment.go
Outdated
|
|
||
| type OnCommitConfig struct { | ||
| // Control trigger new deployment on Git change or not. | ||
| Disable bool `json:"disable,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Disabled" because we are using the same format at other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Do we need the Config suffix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed by b9bc4cc
| SealedSecrets []SealedSecretMapping `json:"sealedSecrets"` | ||
| // List of directories or files where their changes will trigger the deployment. | ||
| // Regular expression can be used. | ||
| // Deprecated: use Trigger.Paths instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs in dev should be updated too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do in a separated PR 🙆♀️
pkg/config/deployment.go
Outdated
|
|
||
| type OnCommitConfig struct { | ||
| // Control trigger new deployment on Git change or not. | ||
| Disable bool `json:"disable,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Do we need the Config suffix?
pkg/app/piped/trigger/determiner.go
Outdated
| func (d *Determiner) ShouldTrigger(ctx context.Context, app *model.Application) (bool, error) { | ||
| // Flag `ignoreUserConfig` set to `true` will force check changes and use it to determine | ||
| // the application deployment should be triggered or not, regardless of the user's configuration. | ||
| func (d *Determiner) ShouldTrigger(ctx context.Context, app *model.Application, ignoreUserConfig bool) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving ignoreUserConfig to Determiner while initializing it? In that way, we can keep this function simple as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, lets me adopt that 🙆♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed by 8dffc8d
|
Code coverage for golang is
|
|
The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use Details1. Add logic to determine trigger or not based on other configuration than onCommit.This was created by todo plugin since "TODO:" was found in 8dffc8d when #2714 was merged. cc: @khanhtc1202.2. Remove deprecated
|
|
Code coverage for golang is
|
|
Great! |
|
This small step is the first step of a great walk. Well done 👍 |
What this PR does / why we need it:
Sample configuration for this looks like
Besides, we can also configure watching paths via
spec.trigger.onCommit.Pathsfield, the previousspec.triggerPathsis marked as deprecated and will be removed later.Which issue(s) this PR fixes:
Fixes #2245
Does this PR introduce a user-facing change?: