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

WIP : CI Signal Policy Violation: A DashboardTab config MUST CONTAIN an alert contact email address. #19286

Closed
wants to merge 2 commits into from

Conversation

RobertKielty
Copy link
Member

@RobertKielty RobertKielty commented Sep 21, 2020

Some WIP on CI Signal Alert Policy enforcement

CI Signal Policy Violation: A DashboardTab config MUST CONTAIN an alert contact email address.

Fixes #18599

@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 Sep 21, 2020
@k8s-ci-robot k8s-ci-robot added area/config Issues or PRs related to code in /config sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Sep 21, 2020
@dims
Copy link
Member

dims commented Sep 23, 2020

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from dims September 23, 2020 20:33
@RobertKielty
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: RobertKielty
To complete the pull request process, please assign dims after the PR has been reviewed.
You can assign the PR to them by writing /assign @dims in a comment when ready.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot
Copy link
Contributor

@RobertKielty: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-test-infra-bazel 63e3353 link /test pull-test-infra-bazel

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@RobertKielty
Copy link
Member Author

RobertKielty commented Oct 23, 2020

@spiffxp @BenTheElder @kubernetes/ci-signal when y'all get a chance can you review this?

I just fixed up the PR so that it is go fmt'd properly 🙄 apols for my numptyness!

Can't remember why I marked this as WIP?

Is this change useful/correct as-is or do we need to do more on this?

The following run (on my feature branch) looks like ...

Test output in config_tests.txt on the below local invocation is available for review here

$ bazel test //config/tests/testgrids:go_default_test > config_tests.txt
Loading: 
Loading: 0 packages loaded
Analyzing: target //config/tests/testgrids:go_default_test (0 packages loaded, 0 targets configured)
INFO: Analyzed target //config/tests/testgrids:go_default_test (1 packages loaded, 1230 targets configured).

INFO: Found 1 test target...
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[1,270 / 1,271] Testing //config/tests/testgrids:go_default_test; 1s linux-sandbox
FAIL: //config/tests/testgrids:go_default_test (see /home/rkielty/.cache/bazel/_bazel_rkielty/47d03368e29206548a86533381c34b95/execroot/io_k8s_test_infra/bazel-out/k8-fastbuild/testlogs/config/tests/testgrids/go_default_test/test.log)
[1,270 / 1,271] 1 / 1 tests, 1 failed; Testing //config/tests/testgrids:go_default_test; 7s linux-sandbox
INFO: From Testing //config/tests/testgrids:go_default_test:
Target //config/tests/testgrids:go_default_test up-to-date:
  bazel-bin/config/tests/testgrids/linux_amd64_race_stripped/go_default_test
INFO: Elapsed time: 13.867s, Critical Path: 8.16s
INFO: 1 process: 1 linux-sandbox.
INFO: Build completed, 1 test FAILED, 2 total actions
INFO: Build completed, 1 test FAILED, 2 total actions

No need for any of ^^^ that you can see the tests run on this PR.

@RobertKielty
Copy link
Member Author

Copy link
Member

@spiffxp spiffxp left a comment

Choose a reason for hiding this comment

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

Some suggestions

Comment on lines +506 to +507
// WIP See policy description on GH Issue #18599
func TestJobsMustHaveTestGridAlertsSetup(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

So the policy in #18599 is for all prow.k8s.io jobs, which is a subset of jobs that have results on testgrid.k8s.io:

  • I would rename this to something like TestKubernetesProwInstanceJobsMustHaveTestgridAlerts
  • you could also consider folding this into TestKubernetesProwInstanceJobsMustHaveMatchingTestgridEntries above
  • iterating over dashboard -> tab is fine, but you should skip tabs whose testgroup isn't known to come from the kubernetes prow instance (see prowGcsPrefix usage above)

for _, dashboard := range cfg.Dashboards {
for _, dashboardtab := range dashboard.DashboardTab {
if dashboardtab.GetAlertOptions() == nil {
t.Errorf("FAIL : %s : CI Signal Policy Violation: A DashboardTab config MUST CONTAIN an alert contact email address.", dashboardtab.GetName())
Copy link
Member

@spiffxp spiffxp Nov 3, 2020

Choose a reason for hiding this comment

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

We should also consider how to do progressive enforcement. Adding a test that fails everything right away is going to block unrelated work.

  • for previous policies, I named the tests Should instead of Must, and did t.Logf instead of t.Errorf (you can also see something like this in TestReleaseBlockingJobsMustHaveTestgridDescriptions below
  • we could also consider using a list of legacy exemptions, then setting a goal of driving that down to zero (see usage of noPresubmitsInTestgridPrefixes above)

Copy link
Member

Choose a reason for hiding this comment

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

Dashboard tab names are not unique. Consider instead logging dashboard/tab (see TestReleaseBlockingJobsMustHaveTestgridDescriptions for an example)

Comment on lines +518 to +520
// WIP subtest version - no real advantage ideally I would have liked subtests
// to register as counted failures. AFAIK no idiomatic golang test way of
// getting subtest stats.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not 100% clear on this either, don't have time to dig in. However I feel like you could gather stats and log them if you'd like ("x / y failing policy") I also think test-case-per-dashboard means hundreds or thousands of tests, which probably wouldn't make sense unless each test covered all policies.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 2, 2021
@RobertKielty
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 17, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 18, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 17, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues or PRs related to code in /config cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes CI Policy: all prow.k8s.io jobs must have testgrid alerts configured
5 participants