Skip to content

Conversation

@asim-reza
Copy link
Contributor

Issue

Unknown field checks are not enabled for ProwJob configuration. #26368

Description

Prow's checkconfig tool is responsible for presubmit validation of ProwJob configuration. It has an optional check for unknown fields in ProwJob config that can be enabled with --warnings=unknown-fields-all. We currently do not have this check enabled.
As a result it is possible to add configuration that is not recognized by Prow, causing it to be silently ignored. Common examples of this are typos in a field name and incorrect indentation.

What was done

All errors in the configs were fixed (of which there were alot) ....

docker run -i --rm -v "${PWD}:${PWD}" -w "${PWD}" gcr.io/k8s-prow/checkconfig:v20220905-8bcebc6376 --config-path=config/prow/config.yaml --job-config-path=config/jobs --plugin-config=config/prow/plugins.yaml --strict --warnings=mismatched-tide-lenient --warnings=tide-strict-branch --warnings=needs-ok-to-test --warnings=validate-owners --warnings=missing-trigger --warnings=validate-urls --warnings=unknown-fields --warnings=duplicate-job-refs --warnings=unknown-fields-all

was used to perform the tests

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 6, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @asim-reza. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 6, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @asim-reza!

It looks like this is your first PR to kubernetes/test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added area/config Issues or PRs related to code in /config area/jobs area/release-eng Issues or PRs related to the Release Engineering subproject sig/node Categorizes an issue or PR as relevant to SIG Node. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 6, 2022
@asim-reza
Copy link
Contributor Author

@cjwagner @alexander-demichev @aramase

There were 2 errors I didnt know what to do about
1- "msg":"deprecated field: maintainers_id is configured for repo_milestone, maintainers_team should be used instead" <--- wasnt sure about the scope of this and what to change to.... and wasnt sure if I could just remove the maintainers_id and it would be assigned automatically

2- "msg":"error unmarshaling config/jobs/kubernetes/sig-cloud-provider/gcp/registry/default.yaml: error unmarshaling JSON: while decoding JSON: json: unknown field \"buildImageRegistry\" <---- This is a file that has a list of values set in the env.... the file isn't a config file so maybe there should be a way to ommit some files from the check... if there is I wasnt sure how to

@asim-reza
Copy link
Contributor Author

@cjwagner @alexander-demichev @aramase

There were 2 errors I didnt know what to do about 1- "msg":"deprecated field: maintainers_id is configured for repo_milestone, maintainers_team should be used instead" <--- wasnt sure about the scope of this and what to change to.... and wasnt sure if I could just remove the maintainers_id and it would be assigned automatically

2- "msg":"error unmarshaling config/jobs/kubernetes/sig-cloud-provider/gcp/registry/default.yaml: error unmarshaling JSON: while decoding JSON: json: unknown field \"buildImageRegistry\" <---- This is a file that has a list of values set in the env.... the file isn't a config file so maybe there should be a way to ommit some files from the check... if there is I wasnt sure how to

If someone can point me to how to fix these 2 I'll get right on it and that should fix all of the errors!!
-Cheers

@asim-reza
Copy link
Contributor Author

@cjwagner @alexander-demichev @aramase

-P.S sorry for the XXL size 😆

@matthyx
Copy link
Contributor

matthyx commented Sep 6, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 6, 2022
@asim-reza
Copy link
Contributor Author

/test pull-test-infra-verify-lint

@k8s-ci-robot k8s-ci-robot added area/provider/gcp Issues or PRs related to gcp provider sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. labels Sep 6, 2022
@asim-reza
Copy link
Contributor Author

all unknown field errors fixed 🎊 🎊 🎊 🎊 🎊
{"component":"checkconfig","file":"k8s.io/test-infra/prow/cmd/checkconfig/main.go:252","func":"main.main","level":"info","msg":"checkconfig passes without any error!","severity":"info","time":"2022-09-06T12:52:47Z"}

the config/jobs/kubernetes/sig-cloud-provider/gcp/registry/default.yaml was changed to config/jobs/kubernetes/sig-cloud-provider/gcp/registry/default.txt as it was being read raw anyways and was passed to an environment variable

and the maintainers_id was commented out of
repo_milestone

@chaodaiG
Copy link
Contributor

chaodaiG commented Sep 6, 2022

Please create a separate PR that adds a duplicate of pull-test-infra-prow-checkconfig, configure the duplicate optional: true, always_run: false, and add --warnings=unknown-fields-all, so that this PR can be validated by Prow

@asim-reza
Copy link
Contributor Author

@chaodaiG

Please create a separate PR that adds a duplicate of pull-test-infra-prow-checkconfig, configure the duplicate optional: true, always_run: false, and add --warnings=unknown-fields-all, so that this PR can be validated by Prow

The PR is created #27389 ... Should I close this one?

@chaodaiG
Copy link
Contributor

chaodaiG commented Sep 6, 2022

@chaodaiG

Please create a separate PR that adds a duplicate of pull-test-infra-prow-checkconfig, configure the duplicate optional: true, always_run: false, and add --warnings=unknown-fields-all, so that this PR can be validated by Prow

The PR is created #27389 ... Should I close this one?

no, #27389 should not be created on top of this PR, create it base off of master branch, and duplicate the config checking job instead of modifying it in place, I'll leave comment there

@chaodaiG
Copy link
Contributor

chaodaiG commented Sep 6, 2022

@chaodaiG
Copy link
Contributor

chaodaiG commented Sep 6, 2022

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Sep 6, 2022
@asim-reza
Copy link
Contributor Author

Need help with this unit test fail.., I have combed through my changes over and over again... cant find whats causing it

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/provider/azure Issues or PRs related to azure provider area/prow/bump Updates to the k8s prow cluster area/testgrid sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 7, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2022
@asim-reza
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: asim-reza
Once this PR has been reviewed and has the lgtm label, please assign cpanato, spiffxp for approval by writing /assign @cpanato, spiffxp in a comment. For more information see:The Kubernetes Code Review Process.

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

@asim-reza asim-reza force-pushed the unknown-fields-fix branch 2 times, most recently from 4390903 to 4e4c6f2 Compare September 7, 2022 08:23
@asim-reza
Copy link
Contributor Author

/test pull-test-infra-unit-test

@k8s-ci-robot
Copy link
Contributor

@asim-reza: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-test-infra-unit-test 4e4c6f2 link true /test pull-test-infra-unit-test

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.

@asim-reza
Copy link
Contributor Author

Unit test wouldnt resolve so created a clean PR

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 area/jobs area/provider/azure Issues or PRs related to azure provider area/provider/gcp Issues or PRs related to gcp provider area/prow/bump Updates to the k8s prow cluster area/release-eng Issues or PRs related to the Release Engineering subproject area/testgrid cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/release Categorizes an issue or PR as relevant to SIG Release. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants