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

Go: Add environment variable to include vendor directories in extraction #16925

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

mbg
Copy link
Member

@mbg mbg commented Jul 8, 2024

This PR introduces a new environment variable CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS which, if set to true, includes vendor directories in the extraction. I have also added an integration test to verify that a vendor directory is included in the extraction with this environment variable set to true. Specifically, test.expected does not contain src/vendor/example.com/test/add.go if CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS is not true or with an old version of the extractor.

@mbg mbg self-assigned this Jul 8, 2024
@mbg mbg requested a review from a team as a code owner July 8, 2024 13:10
@github-actions github-actions bot added the Go label Jul 8, 2024
Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

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

You could consider putting some of the new logic into a function, which either returns excludedDirs or strings.Join(excludedDirs, "|").

@mbg mbg merged commit 45b7825 into main Jul 11, 2024
13 checks passed
@mbg mbg deleted the mbg/go/add-vendor-env-var branch July 11, 2024 10:06
@mbg
Copy link
Member Author

mbg commented Jul 11, 2024

@owen-mc I have merged this for now as is, but putting the new logic into a separate function is something we can definitely do when we next touch this part.

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.

2 participants