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

import-boss: add inverse import rules #116

Closed
wants to merge 6 commits into from

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Jul 10, 2018

Allow to restrict which packages Y may import a given package X via InverseRules in X/.import-restrictions:

//   "InverseRules": [{
//       "SelectorRegexp": "k8s[.]io",
//       "AllowedPrefixes": [
//         "k8s.io/same-repo",
//         "k8s.io/kubernetes/pkg/legacy"
//       ],
//       "ForbiddenPrefixes": [
//         "k8s.io/kubernetes/pkg/legacy/subpkg"
//       ]
//     },
//     {
//       "SelectorRegexp": "k8s[.]io",
//       "Transitive": true,
//       "AllowedPrefixes": [
//         "k8s.io/
//       ],
//       "ForbiddenPrefixes": [
//         "k8s.io/kubernetes/cmd/kubelet",
//         "k8s.io/kubernetes/cmd/kubectl"
//       ],
//   ]
// }

Example use-cases:

  • k8s.io/apiserver/pkg/features feature gates should not leak into kubectl and kubelet (e.g. for dry-run: Create feature-gate flag kubernetes#65558).
  • k8s.io/kubernetes/pkg/master should only be imported transitively by cmd/kube-apiserver and cmd/hyperkube.
  • k8s.io/apimachinery/pkg/private should only be imported directly by k8s.io/apimachinery, with the legacy exceptions a, b, c.

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 10, 2018
@sttts
Copy link
Contributor Author

sttts commented Jul 10, 2018

/cc @apelisse @deads2k

@k8s-ci-robot k8s-ci-robot requested review from apelisse and deads2k July 10, 2018 14:45
@sttts sttts force-pushed the sttts-import-boss-inverse branch from 63a1e39 to c6ea0d9 Compare July 18, 2018 15:18
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 18, 2018
@sttts sttts force-pushed the sttts-import-boss-inverse branch from c6ea0d9 to 0acf683 Compare July 18, 2018 20:44
@sttts sttts force-pushed the sttts-import-boss-inverse branch from 0acf683 to 3ef2ecc Compare July 19, 2018 11:13
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 17, 2018
@sttts
Copy link
Contributor Author

sttts commented Oct 18, 2018

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 18, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 15, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

@sttts
Copy link
Contributor Author

sttts commented Apr 1, 2019

/reopen

@k8s-ci-robot
Copy link
Contributor

@sttts: Reopened this PR.

In response to this:

/reopen

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 reopened this Apr 1, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sttts

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

@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

@sttts
Copy link
Contributor Author

sttts commented May 1, 2019

/reopen
/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot reopened this May 1, 2019
@k8s-ci-robot
Copy link
Contributor

@sttts: Reopened this PR.

In response to this:

/reopen
/remove-lifecycle rotten

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels May 1, 2019
@k8s-ci-robot
Copy link
Contributor

@sttts: PR needs rebase.

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.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 30, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 29, 2019
@sttts
Copy link
Contributor Author

sttts commented Aug 29, 2019

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 29, 2019
@lavalamp
Copy link
Member

Sorry, I hadn't seen this. It'll be a bit but I think I should probably review it...

/assign

@sttts
Copy link
Contributor Author

sttts commented Aug 29, 2019

@lavalamp not sure where I was when doing this, might be incomplete. It's still something we want to have and @eloyekunle (current Google Summer of Code student of Kube) showed interest to continue this effort.

Also cc @dims

@sttts
Copy link
Contributor Author

sttts commented Aug 29, 2019

I had tests. So maybe it actually worked :)

@eloyekunle
Copy link
Contributor

Yes, I'm interested in working on this, and I'll start looking into it next week.

@lavalamp
Copy link
Member

lavalamp commented Aug 29, 2019 via email

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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