-
Notifications
You must be signed in to change notification settings - Fork 307
Add timeout for wait approval #1386
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fc698d2
Add config for set timeout on wait approval
sanposhiho a391566
Return failure when timeout
sanposhiho c5f82fd
Fix comment
sanposhiho b733c0e
Use Duration instead of int64
sanposhiho cc58dc2
Fix error message
sanposhiho 7790acc
Move default value definition
sanposhiho a07728e
Move comment
sanposhiho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ func TestTerraformDeploymentConfig(t *testing.T) { | |
| Name: model.StageWaitApproval, | ||
| WaitApprovalStageOptions: &WaitApprovalStageOptions{ | ||
| Approvers: []string{"foo", "bar"}, | ||
| Timeout: defaultWaitApprovalTimeout, // set default timeout value when nothing sets on config | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit WaitApprovalStageOptions: &WaitApprovalStageOptions{
Approvers: []string{"foo", "bar"},
// Use defaultWaitApprovalTimeout on unset timeout value for WaitApprovalStage.
Timeout: defaultWaitApprovalTimeout,or remove this comment and place it to implement source at L137 |
||
| }, | ||
| }, | ||
| { | ||
|
|
||
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.
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, should move to the top of this file.
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.
For this I'm still debating. I'm trying to figure out where to define the default values.
Currently most of all default values are populated at the pakcages where they are used. We have not debated this point until now, but I followed that rule because this current design can hide the way how to use each configuration field and leave it to each package that uses them.
But on the dark side, it can't guarantee that all field is populated when it parsed. Happy to hear your thoughts.
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.
Got it, I think I'm okay with this convention 👍 What I mentioned here is, should we move this default value to the top of this file and make it const, currently it's been used before declared make it hard to read.
For the point of "where to define the default value", I think we should debate and address it by another PR. 😁
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.
I am fine with these things. To be honest I was thinking about where to define and how to configure the default value of our config. And I think all of them should be defined in the
configpackage (as public consts) and loaded when the configuration is parsed. So the comment about the default value is the same in that package too. The docs refer to them too.It would be nice if we can define the default value by go tag (as JSON tag). There are some libs for doing that thing but still not found a good enough one.
Let me make a PR for this issue.
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.
👍 👍 👍
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.
Okay, let's debate about all of them on another PR.
@sanposhiho Could you address it if no objection to 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.
I've just caught up on this conversation. OK, move the default value to the top 👍