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

Use peribolos to manage team repo permissions #2614

Merged
merged 10 commits into from
Jul 26, 2023

Conversation

nikhita
Copy link
Member

@nikhita nikhita commented Apr 4, 2021

Fixes #2465

This PR starts using peribolos to manage team repo permissions. Note - peribolos will fail if the repo doesn't exist, so we need to ensure that the repo exists before specifying it in the config. We could probably write a test to query the GitHub API to validate this, but I'd like to cover this in a follow-up.

Specifically, it includes the following changes:

  • Add a new binary in cmd/restrictions to define restrictions to the team repo config so that a team in a sub-folder can't arbitrarily give themselves kubernetes/kubernetes admin access. The restrictions config is similar to slack-infra, and can be extended in the future to define further restrictions.

  • Add a verify script for restrictions. Note: I've not added this to bazel directly because I want to be able to run this script without bazel. This also meant that verify-all.sh now contains code to run all hack/verify-* scripts.

  • Update all org configs to dump team repo permissions.

  • There are a few teams that use the triage and maintain permissions. Peribolos was recently updated to support these (Added support for full set of repository permissions in Peribolos test-infra#21526, thanks @MadhavJivrajani!). To support this feature + some critical fixes related to team permissions (peribolos: fix updating teams  test-infra#19338), this PR also bumps test-infra to the latest master (kubernetes/test-infra@01a7a10). I also copied over the replace statements from test-infra's go.mod on master. Most of the diff is generated bazel changes due to this bump.

  • Add a config/restrictions.yaml to restrict which repos teams can specify. The GitHub Management team will be able to approve changes to this file.

/cc @spiffxp @cblecker @mrbobbytables
/assign @spiffxp

/hold for review

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/github-management Issues or PRs related to GitHub Management subproject area/provider/aws Issues or PRs related to aws provider approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/azure Issues or PRs related to azure provider area/provider/ibmcloud Issues or PRs related to ibmcloud provider area/provider/openstack Issues or PRs related to openstack provider area/provider/vmware Issues or PRs related to vmware provider sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. sig/cli Categorizes an issue or PR as relevant to SIG CLI. 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/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. sig/network Categorizes an issue or PR as relevant to SIG Network. 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/scalability Categorizes an issue or PR as relevant to SIG Scalability. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. labels Apr 4, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 11, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2023
@nikhita
Copy link
Member Author

nikhita commented Jul 26, 2023

LGTM.

Since I had technically authored the original code, I'd like one of @MadhavJivrajani or @palnabarun to approve here.

Comment on lines 17 to +19
// When bumping Kubernetes dependencies, you should update each of these lines
// to point to the same kubernetes-1.x.y release branch before running update-deps.sh.
// to point to the same kubernetes v0.KubernetesMinor.KubernetesPatch version
// before running update-deps.sh.
Copy link
Member

Choose a reason for hiding this comment

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

@MadhavJivrajani, @palnabarun I was thinking of removing above lines of comment from the go.mod file, since update-deps.sh hack file is no longer present in the repo (was removed as part of #1278).

WDYT? Is there something else that is doing the job of update-deps.sh script currently and can be replaced with, in the comments?

Copy link
Member

Choose a reason for hiding this comment

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

SGTM!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, pushed changes in the latest commits refresh. 👍

@Priyankasaggu11929
Copy link
Member

Summing up the recent changes after the last PR review:

  • all org config files updated to add repo permissions for the newly created teams, since this PR was created

    • restrictions.yaml updated to reflect the same
  • go version & package dependencies bump in go.mod. Major changes, among all:

    • golang version bump - 1.20

    • k8s.io/test-infra bump - v0.0.0-20230726003218-c95b43963de2

      pointing to c95b43963de20d3ce1c9fa600d2b859809c3259d
      (latest head on master branch as of July 26, 2023, at the time of last commit )

    • k8s.io staging repos pinned to kubernetes v1.27.4 in replace directive section

  • removed comment lines referencing use of update-deps.sh script as per comment above

Copy link
Contributor

@MadhavJivrajani MadhavJivrajani left a comment

Choose a reason for hiding this comment

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

/lgtm
Thank you so much @Priyankasaggu11929 ❤️

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2023
@MadhavJivrajani
Copy link
Contributor

MadhavJivrajani commented Jul 26, 2023

/hold
For further acks

Copy link
Member

@palnabarun palnabarun left a comment

Choose a reason for hiding this comment

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

Thank you all for working on this and pushing this ahead! ❤️

/lgtm
/approve

/hold cancel

/pony party

@k8s-ci-robot
Copy link
Contributor

@palnabarun: pony image

In response to this:

Thank you all for working on this and pushing this ahead! ❤️

/lgtm
/approve

/hold cancel

/pony party

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 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MadhavJivrajani, marosset, nikhita, palnabarun

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 [MadhavJivrajani,nikhita,palnabarun]

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

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. area/github-management Issues or PRs related to GitHub Management subproject area/provider/aws Issues or PRs related to aws provider area/provider/azure Issues or PRs related to azure provider area/provider/ibmcloud Issues or PRs related to ibmcloud provider area/provider/openstack Issues or PRs related to openstack provider area/provider/vmware Issues or PRs related to vmware provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. 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/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/k8s-infra Categorizes an issue or PR as relevant to SIG K8s Infra. sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. sig/network Categorizes an issue or PR as relevant to SIG Network. 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/scalability Categorizes an issue or PR as relevant to SIG Scalability. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/service-catalog Categorizes an issue or PR as relevant to SIG Service Catalog. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/usability Categorizes an issue or PR as relevant to SIG Usability. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. wg/component-standard Categorizes an issue or PR as relevant to WG Component Standard. wg/policy Categorizes an issue or PR as relevant to WG Policy.
Projects
Archived in project
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

Use peribolos to manage team repo permissions
10 participants