Skip to content
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

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

chaodaiG
Copy link
Contributor

@chaodaiG chaodaiG commented Nov 8, 2021

…y slice

Resolving comment: #24168 (comment).

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 8, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/prow Issues or PRs related to prow sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Nov 8, 2021
@chaodaiG
Copy link
Contributor Author

chaodaiG commented Nov 8, 2021

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

@chaodaiG
Copy link
Contributor Author

chaodaiG commented Dec 1, 2021

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) {
Copy link
Member

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?

Copy link
Contributor Author

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

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/prow/crier Issues or PRs related to prow's crier component and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 3, 2021
@chaodaiG chaodaiG marked this pull request as ready for review December 6, 2021 17:43
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 6, 2021
@chaodaiG
Copy link
Contributor Author

chaodaiG commented Dec 6, 2021

/cc @cjwagner

@k8s-ci-robot k8s-ci-robot requested a review from cjwagner December 6, 2021 17:44
@k8s-ci-robot k8s-ci-robot added area/config Issues or PRs related to code in /config area/prow/bump Updates to the k8s prow cluster labels Dec 6, 2021
Copy link
Member

@petr-muller petr-muller left a 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

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2021
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@chaodaiG
Copy link
Contributor Author

chaodaiG commented Dec 7, 2021

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 7, 2021
@k8s-ci-robot k8s-ci-robot merged commit 151f4db into kubernetes:master Dec 7, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Dec 7, 2021
@chaodaiG chaodaiG deleted the slack-report-bool branch December 8, 2021 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/config Issues or PRs related to code in /config area/prow/bump Updates to the k8s prow cluster area/prow/crier Issues or PRs related to prow's crier component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants