-
Notifications
You must be signed in to change notification settings - Fork 268
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
Autoowners #115
Autoowners #115
Conversation
/hold dep. on kubernetes/test-infra#14191 |
/hold Need do more manually tests since the http client and yaml write function have been changed. |
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.
/lgtm
/approve
/hold cancel @stevekuznetsov I will test manually with container. |
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'm not sure we want the YAML config, otherwise this looks good.
/hold working on removing the yaml config. For my defense, the main reason for me to choose yaml over flags: |
There are a couple implementations of flags to pass a list, |
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.
Ah, and you're using the util :)
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hongkailiu, stevekuznetsov 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 |
/hold cancel This file in the repo was only for unit test. |
ownersAliasesComment = "# See the OWNERS_ALIASES docs: https://git.k8s.io/community/contributors/guide/owners.md#owners_aliases\n" | ||
doNotEdit = "# DO NOT EDIT; this file is auto-generated using tools/populate-owners.\n" | ||
ownersComment = "# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md\n" | ||
//ownersAliasesComment = "# See the OWNERS_ALIASES docs: https://git.k8s.io/community/contributors/guide/owners.md#owners_aliases\n" |
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.
Why did OWNERS_ALIASES
handling get removed here? Does that mean that openshift/release's OWNERS_ALIASES
is no longer maintained? I thought that was useful for maintaining OWNERS
files in non-job directories (e.g. openshift/release#1791), although I see openshift/release#4279 decided to hard-code lists of people in ci-operator/config/openshift/installer/OWNERS
(which are now manually maintained by... somebody?).
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.
The current autoownners tool does the sync of OWNERS and OWNERS_ALIAS from the upstream repos ONLY to the jobs/config/template folders via a periodic job, e.g., https://prow.svc.ci.openshift.org/prowjob?prowjob=98e2303f-0f6e-11ea-8989-0a58ac10564c
You can see that we have ignore-repo
args there if some repo does not want us to do this sync. If the upstream does not have an OWNERS file, the utility will ignore syncing it for those paths.
With that said, top level OWNERS related files are not synced by the tool. So if we want to defined alias, we need to maintain manually. It is one file used by release repo, maybe that is OK?
4729 was probably before this tool was taken to production. And the changed owner file was controlled by the tool now.
https://github.com/openshift/release/blob/master/ci-operator/config/openshift/installer/OWNERS#L1-L16
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.
So if we want to defined alias, we need to maintain manually.
I expect we're going to have stale entries in these files then, because folks are probably going to forget to bump them (or an OWNERS_ALIASES
entry) when they adjust the installer approver set, and I still think we want to be using the installer approver set for that template directory.
This collects similar workflow definitions together instead of having a growing dump of sibling directories. Also use symlinks to parent OWNERS files for subdirectories had the same content. I haven't used symlinks for things like: * aws/ovn/OWNERS * vsphere/ovn/OWNERS despite them having the same content, because it's not clear which location would be more canonical. Will be nice if/when [1] gets fixed and we can go back to using aliases. [1]: openshift/ci-tools#115 (comment)
Seen in an autoowners call: $ go run ./cmd/autoowners -debug-mode -dry-run -target-dir ../origin -target-subdir test -config-subdir extended ... INFO[0000] ListOrgMembers(openshift, all) client=github INFO[0002] handling repo ... orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS, ) client=github DEBU[0002] GetFile(util, image, OWNERS, ) finished client=github duration=574.249751ms DEBU[0002] Not found file in the upstream repo filename=OWNERS orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS_ALIASES, ) client=github DEBU[0003] GetFile(util, image, OWNERS_ALIASES, ) finished client=github duration=479.108876ms DEBU[0003] Not found file in the upstream repo filename=OWNERS_ALIASES orgRepo=util/image WARN[0003] Ignoring the repo with no OWNERS file in the upstream repo. orgRepo=util/image ... No need to hit GitHub for OWNERS_ALIASES unless we have successfully retrieved an OWNERS which might reference aliases. The continue I'm replacing is from 3d0c6cc (Copy autoowners from release repo, 2019-09-04, openshift#115) [1]. [1]: openshift@3d0c6cc#diff-d9fc97e94b9e2c25a3bd5eec3f3439e533b9d2d347be59f97d10506f7d61574dR147
Seen in an autoowners call: $ go run ./cmd/autoowners -debug-mode -dry-run -target-dir ../origin -target-subdir test -config-subdir extended ... INFO[0000] ListOrgMembers(openshift, all) client=github INFO[0002] handling repo ... orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS, ) client=github DEBU[0002] GetFile(util, image, OWNERS, ) finished client=github duration=574.249751ms DEBU[0002] Not found file in the upstream repo filename=OWNERS orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS_ALIASES, ) client=github DEBU[0003] GetFile(util, image, OWNERS_ALIASES, ) finished client=github duration=479.108876ms DEBU[0003] Not found file in the upstream repo filename=OWNERS_ALIASES orgRepo=util/image WARN[0003] Ignoring the repo with no OWNERS file in the upstream repo. orgRepo=util/image ... No need to hit GitHub for OWNERS_ALIASES unless we have successfully retrieved an OWNERS which might reference aliases. The continue I'm replacing is from 3d0c6cc (Copy autoowners from release repo, 2019-09-04, openshift#115) [1]. [1]: openshift@3d0c6cc#diff-d9fc97e94b9e2c25a3bd5eec3f3439e533b9d2d347be59f97d10506f7d61574dR147
Seen in an autoowners call: $ go run ./cmd/autoowners -debug-mode -dry-run -target-dir ../origin -target-subdir test -config-subdir extended ... INFO[0000] ListOrgMembers(openshift, all) client=github INFO[0002] handling repo ... orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS, ) client=github DEBU[0002] GetFile(util, image, OWNERS, ) finished client=github duration=574.249751ms DEBU[0002] Not found file in the upstream repo filename=OWNERS orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS_ALIASES, ) client=github DEBU[0003] GetFile(util, image, OWNERS_ALIASES, ) finished client=github duration=479.108876ms DEBU[0003] Not found file in the upstream repo filename=OWNERS_ALIASES orgRepo=util/image WARN[0003] Ignoring the repo with no OWNERS file in the upstream repo. orgRepo=util/image ... No need to hit GitHub for OWNERS_ALIASES unless we have successfully retrieved an OWNERS which might reference aliases. The continue I'm replacing is from 3d0c6cc (Copy autoowners from release repo, 2019-09-04, openshift#115) [1]. [1]: openshift@3d0c6cc#diff-d9fc97e94b9e2c25a3bd5eec3f3439e533b9d2d347be59f97d10506f7d61574dR147
Seen in an autoowners call: $ go run ./cmd/autoowners -debug-mode -dry-run -target-dir ../origin -target-subdir test -config-subdir extended ... INFO[0000] ListOrgMembers(openshift, all) client=github INFO[0002] handling repo ... orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS, ) client=github DEBU[0002] GetFile(util, image, OWNERS, ) finished client=github duration=574.249751ms DEBU[0002] Not found file in the upstream repo filename=OWNERS orgRepo=util/image INFO[0002] GetFile(util, image, OWNERS_ALIASES, ) client=github DEBU[0003] GetFile(util, image, OWNERS_ALIASES, ) finished client=github duration=479.108876ms DEBU[0003] Not found file in the upstream repo filename=OWNERS_ALIASES orgRepo=util/image WARN[0003] Ignoring the repo with no OWNERS file in the upstream repo. orgRepo=util/image ... No need to hit GitHub for OWNERS_ALIASES unless we have successfully retrieved an OWNERS which might reference aliases. The continue I'm replacing is from 3d0c6cc (Copy autoowners from release repo, 2019-09-04, openshift#115) [1]. [1]: openshift@3d0c6cc#diff-d9fc97e94b9e2c25a3bd5eec3f3439e533b9d2d347be59f97d10506f7d61574dR147
This prunes aliases that used to be maintained automatically. The tooling that used to maintain them was removed in 58d12ef (Clean up deprecated tool: populate-owners, 2019-09-19, openshift#5115), and the tooling that replaced it will not pick up that missing functionality [1,2]. This commit removes the stale "auto-generated" comment, and also all unused aliases: $ diff -u <(yaml2json <OWNERS_ALIASES | jq -r '.aliases | keys[]' | sort) <(find . -name OWNERS -exec grep -h "$(yaml2json <OWNERS_ALIASES | jq -r '.aliases | keys | join("\\|")')" {} \+ | sed -n 's/^ *- //p' | sort | uniq) | grep '^-' [1]: openshift/ci-tools#115 (comment) [2]: https://issues.redhat.com/browse/DPTP-690
https://jira.coreos.com/browse/DPTP-519
/cc @stevekuznetsov