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

kazel K8sOpenAPIGen should respect SkippedPaths too #32

Merged
merged 2 commits into from
Aug 16, 2017

Conversation

ixdy
Copy link
Member

@ixdy ixdy commented Aug 7, 2017

Some of the non-Bazel kubernetes build scripts toss Go source under _output/dockerized/go; we should not go looking for OpenAPI packages there.

Still testing this (trying to figure out what set of steps actually copies code into _output/dockerized/go but I think this will work.

/assign @mikedanese @spxtr
cc @thockin @nikhita @sttts

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 7, 2017
@ixdy ixdy changed the title K8sOpenAPIGen should respect SkippedPaths too kazel K8sOpenAPIGen should respect SkippedPaths too Aug 7, 2017
@ixdy ixdy force-pushed the openapi-skip-dirs branch from 3171ab4 to d60c468 Compare August 7, 2017 20:40
@ixdy
Copy link
Member Author

ixdy commented Aug 7, 2017

ok, tested. pretty sure this works now.

@@ -52,6 +52,11 @@ func (v *Vendorer) walkGenerated() error {
// findOpenAPI searches for all packages under root that request OpenAPI. It
// returns the go import paths. It does not follow symlinks.
func (v *Vendorer) findOpenAPI(root string) ([]string, error) {
for _, r := range v.skippedPaths {
if r.Match([]byte(root)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

r.MatchString(root)

Copy link
Member Author

Choose a reason for hiding this comment

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

done. fixed similar calls elsewhere, too.

@@ -42,7 +42,7 @@ func (v *Vendorer) walkGenerated() error {
return nil
}
v.managedAttrs = append(v.managedAttrs, "openapi_targets", "vendor_targets")
paths, err := v.findOpenAPI(v.root)
paths, err := v.findOpenAPI(".")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

SkippedPaths uses relative paths, so the regexes won't match unless we use a relative path consistently. We use relative paths (i.e. .) for both walk() and walkSource(), so this was the odd one out.

Copy link
Member Author

Choose a reason for hiding this comment

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

(and we chdir to v.root so . will be valid)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@spxtr
Copy link
Contributor

spxtr commented Aug 16, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2017
@ixdy
Copy link
Member Author

ixdy commented Aug 16, 2017

tested, seems to still work.

@ixdy ixdy merged commit 9ba3a24 into kubernetes:master Aug 16, 2017
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request Aug 17, 2017
Automatic merge from submit-queue (batch tested with PRs 49869, 47987, 50211, 50804, 50583)

Bump repo-infra/kazel dependency

**What this PR does / why we need it**: `kazel` shouldn't be looking under skipped paths (like `_output`) for openapi files. This was fixed in kubernetes/repo-infra#32 and now should be included here.

I've tested locally that this now ignores everything under `_output`.

**Release note**:

```release-note
NONE
```

/assign @mikedanese @spxtr
spxtr pushed a commit to spxtr/repo-infra that referenced this pull request Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants