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

Validate usage of knative.dev/hack/shell #32

Merged

Conversation

cardil
Copy link
Contributor

@cardil cardil commented Nov 26, 2020

This is follow up to #30 intended to disallow using this shell out package without control.

If a new place is required to use this package, an "allow PR" should be made to this repo first.

/cc @n3wscott

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Nov 26, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 26, 2020
@cardil cardil force-pushed the followup/30-validate-shellout-usage branch from e957121 to f4ed6bd Compare November 26, 2020 11:22
This is follow up to knative.dev/hack#30 intended to disallow using this
shell out package without control.

If new place is required to use this package, first a allow PR should be
made to this repo.
@cardil cardil force-pushed the followup/30-validate-shellout-usage branch from f4ed6bd to 1f1f81b Compare November 26, 2020 11:25
@cardil
Copy link
Contributor Author

cardil commented Nov 26, 2020

What do you think of this solution, to block not allowed usages @n3wscott ?

"knative.dev/hack/shell"
)

func TestCallerNotAllowed(t *testing.T) {

Choose a reason for hiding this comment

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

I think it just needs the deprecated comment, this test will be removed in the vendoring process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course test will be removed.

But, there's a validation added to shell/project.go that will return error in used from not allowed location

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW: Using deprecated comments will upset the linter.

Copy link

Choose a reason for hiding this comment

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

FWIW: Using deprecated comments will upset the linter.

That is the point. You have to opt-in to using the deprecated code

Copy link

@n3wscott n3wscott 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

Let's try this.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2020
@knative-prow-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cardil, n3wscott

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2020
@knative-prow-robot knative-prow-robot merged commit 0cc6568 into knative:master Dec 1, 2020
@cardil cardil deleted the followup/30-validate-shellout-usage branch December 2, 2020 17:37
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants