-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow Slack states to report to be optional, while still respect empt… #24280
Conversation
Skipping CI for Draft Pull Request. |
Just an idea, this is probably the best place I could find to insert this logic. However, not feeling great injecting something almost "hacky" by working around the issue. Please let me know if there is a better solution to this |
Follow up #24168 (comment), @alvaroaleman , any thoughts? |
// `JobStatesToReport: nil`, which prevents a prowjob from overriding global Slack | ||
// report configuration(ref: https://github.com/kubernetes/test-infra/issues/22888#issuecomment-881513368). | ||
// Use a boolean instead so that we can use `omitempty`. | ||
func setReportDefault(spec *prowapi.ProwJobSpec) { |
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.
This doesn't do anything, because a non-pointer bool field with omitempty
will be omitted in the serializiation when the value is false
as that is the default for an unititialized boolean.
I think we need to make it a pointer field to differentiate uninitialized
from false
and also have an else
block in the second condition here that sets it to true
?
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.
good point, updated the PR, as well as some unit tests
c140bf1
to
822801e
Compare
/cc @cjwagner |
822801e
to
eba7aa3
Compare
eba7aa3
to
ce05fcd
Compare
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.
/hold
Holding for Alvaro/Cole
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, chaodaiG, petr-muller The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
…y slice
Resolving comment: #24168 (comment).