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

feat(extraction): support tree artifacts in bazel extractor #4932

Merged
merged 4 commits into from
May 21, 2021

Conversation

nbeloglazov
Copy link
Collaborator

Usually artifacts in bazel are regular files. But sometimes it can be directories
(tree artifacts): https://docs.bazel.build/versions/master/glossary.html#artifact
In this case extractor has to recursively include all files in such directories.

Had to refactor unit test as now extractor performs file IO so need to initialize
all input files by creating empty files.

@google-cla google-cla bot added the cla: yes label May 15, 2021
@shahms shahms requested a review from schroederc May 17, 2021 16:51
@shahms
Copy link
Contributor

shahms commented May 17, 2021

/gcbrun

@shahms
Copy link
Contributor

shahms commented May 17, 2021

It looks like the go-module build fails as well as gofmt checks.

@nbeloglazov
Copy link
Collaborator Author

What is go-module build? I don't think I have access to the build logs so no idea why it failed or how to run it locally. With gofmt should be a bit easier.

@shahms
Copy link
Contributor

shahms commented May 17, 2021

Ah, we want the Go code to be buildable outside of bazel so also run: go test -mod=readonly ./kythe/... during CI. In this case, it's complaining about being unable to find the "treeset" module.

@nbeloglazov
Copy link
Collaborator Author

I updated this PR. Should be good now. @shahms can you trigger presubmits again?

@shahms
Copy link
Contributor

shahms commented May 19, 2021

/gcbrun

@schroederc
Copy link
Contributor

/gcbrun

kythe/go/extractors/bazel/treeset/treeset.go Outdated Show resolved Hide resolved
kythe/go/extractors/bazel/treeset/treeset.go Outdated Show resolved Hide resolved
kythe/go/extractors/bazel/treeset/treeset.go Outdated Show resolved Hide resolved
kythe/go/extractors/bazel/treeset/treeset.go Outdated Show resolved Hide resolved
kythe/go/extractors/bazel/treeset/treeset.go Outdated Show resolved Hide resolved
Usually artifacts in bazel are regular files. But sometimes it can be directories
(tree artifacts): https://docs.bazel.build/versions/master/glossary.html#artifact
In this case extractor has to recursively include all files in such directories.

Had to refactor unit test as now extractor performs file IO so need to initialize
all input files by creating empty files.
@schroederc
Copy link
Contributor

/gcbrun

@schroederc
Copy link
Contributor

/gcbrun

@schroederc
Copy link
Contributor

/gcbrun

@schroederc schroederc merged commit 147034d into kythe:master May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants