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

Autoowners #115

Merged
merged 2 commits into from
Sep 12, 2019
Merged

Autoowners #115

merged 2 commits into from
Sep 12, 2019

Conversation

hongkailiu
Copy link
Member

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 4, 2019
@hongkailiu
Copy link
Member Author

/hold

dep. on kubernetes/test-infra#14191

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 4, 2019
@hongkailiu
Copy link
Member Author

/hold

Need do more manually tests since the http client and yaml write function have been changed.

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 6, 2019
@hongkailiu
Copy link
Member Author

/hold cancel

@stevekuznetsov I will test manually with container.
Ready for review and merge.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 11, 2019
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a 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.

cmd/autoowners/test_config.yaml Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 12, 2019
@hongkailiu
Copy link
Member Author

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:
flags in args in a yaml does not really look like a list while yaml has a defined list syntax.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2019
@stevekuznetsov
Copy link
Contributor

There are a couple implementations of flags to pass a list, test-infra has a helper prow/flaguti/strings.go@Strings to do it. Config could be fine too, I guess, but we want it to be a runtime configuration given in the job definition, not baked into the image.

Copy link
Contributor

@stevekuznetsov stevekuznetsov left a 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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2019
@openshift-ci-robot
Copy link
Contributor

[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:
  • OWNERS [hongkailiu,stevekuznetsov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hongkailiu
Copy link
Member Author

/hold cancel

This file in the repo was only for unit test.
The one for deployment will be in the release repo and mount by configMap.
So wont build the config in the image at all. :)

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2019
@openshift-merge-robot openshift-merge-robot merged commit d3b19a9 into openshift:master Sep 12, 2019
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"
Copy link
Member

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?).

Copy link
Member Author

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

Copy link
Member

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.

wking added a commit to wking/openshift-release that referenced this pull request Jun 10, 2020
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)
wking added a commit to wking/ci-tools that referenced this pull request Jun 29, 2021
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
wking added a commit to wking/ci-tools that referenced this pull request Jun 29, 2021
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
wking added a commit to wking/ci-tools that referenced this pull request Jun 29, 2021
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
wking added a commit to wking/ci-tools that referenced this pull request Jun 29, 2021
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
wking added a commit to wking/openshift-release that referenced this pull request Oct 4, 2021
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
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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants