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

populate-owners: resolve owner aliases #2572

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

pgier
Copy link
Contributor

@pgier pgier commented Jan 11, 2019

This changes the populate-owners tool to resolve OWNER_ALIASES into the individual OWNERS files. This avoids some complexity related to merging OWNER_ALIASES from different repositories, and also makes it easy to update OWNERS only for certain repositories.

pgier added 2 commits January 11, 2019 16:19
- Fix go vet complaining about wrong type in ErrorF
- Print console output when there is an error
- Configure username and email for test git repo
- Ignore difference in commit ID between expected and actual orgRepo
Resolves aliases contained in the OWNERS files based on the contents
of the OWNERS_ALIASES file.
Also adds optional parameter to only update repositories which match
a regex.
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 11, 2019
@pgier
Copy link
Contributor Author

pgier commented Jan 11, 2019

CC @wking

@pgier
Copy link
Contributor Author

pgier commented Jan 12, 2019

See also #1285, #1601, and #1791

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.

Seems like a reasonable approach

// in another string slice. Returns a new slice with the insert
// slice replacing the elements between begin and end index.
func insertStringSlice(insert []string, intoSlice []string,
begin int, end int) []string {
Copy link
Contributor

Choose a reason for hiding this comment

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

When is end used? To overwrite items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, it will overwrite anything between begin and end in the existing slice. In this case it should always just be the single element which is the alias name.

assertEqual(t, test.input, test.namespaced)
}
})
func TestResolveAliases(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would love a test for the slice insert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I'll add one!

Also update readme, add comments, and remove some console logging
@pgier pgier force-pushed the resolve-owner-aliases branch from 766c570 to a9f4c3a Compare January 16, 2019 20:08
@pgier
Copy link
Contributor Author

pgier commented Jan 18, 2019

@stevekuznetsov Does this look ok? I added tests for the slice insert and also updated the readme.

@stevekuznetsov
Copy link
Contributor

@wking any thoughts here?

@wking
Copy link
Member

wking commented Jan 18, 2019

I haven't had time to work through the diff. If it looks good to you, don't wait on me.

@stevekuznetsov
Copy link
Contributor

Sounds good.

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pgier, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2019
@openshift-merge-robot openshift-merge-robot merged commit bfb2475 into openshift:master Jan 18, 2019
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/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.

5 participants