-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 / configure-baseline: account for multiple vendor directories and the CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS
setting
#17227
Go / configure-baseline: account for multiple vendor directories and the CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS
setting
#17227
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It generally looks good. I suppose that ideally we'd share the logic between the autobuilder and this script somehow, so that if we change one in future then the other changes automatically, but that probably introduces more complexity than we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This generally looks reasonable. I have a few minor suggestions for improvements in what's already here. As you said, this does need tests. It would be good to have some unit tests for the logic in configurebaseline.go
and then a couple of integration tests. We should also run QA later.
A bigger question I have is whether we can reasonably assume that the go-configure-baseline
binary will always be available when the configure-baseline.sh
script is called. I assume that's probably the case, but it may be worth checking if you haven't yet.
…the `CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS` setting Our existing configure-baseline scripts would give the wrong result if a `vendor` directory wasn't at the root of the repository, or if the `CODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS` variable was set to `true` indicating the user wants their vendored code scanned. Here I replace the shell scripts that implemented the very simplest behaviour with a small Go program.
a8d6e64
to
3acab64
Compare
@owen-mc this is now ready for re-review; all comments have been addressed and an integration test added. I will run QA just in case it highlights anything breaking, but I'm aware this won't particularly exercise the code coverage information, only detect crashes. |
The windows integration test seems to be failing on two counts: wrong separator and actually getting the wrong results. |
go/ql/integration-tests/all-platforms/go/configure-baseline/test.py
Outdated
Show resolved
Hide resolved
(Don't forget to run QA, if you still plan to do that.) |
QA is unremarkable (though it has a limited scope to show anything relevant to this change, it at least confirms there are no new surprising extraction failures) |
Our existing configure-baseline scripts would give the wrong result if a
vendor
directory wasn't at the root of the repository, or if theCODEQL_EXTRACTOR_GO_EXTRACT_VENDOR_DIRS
variable was set totrue
indicating the user wants their vendored code scanned.Here I replace the shell scripts that implemented the very simplest behaviour with a small Go program.