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

Warning: Some packages could not be found #1980

Open
weilueluo opened this issue Nov 2, 2023 · 2 comments
Open

Warning: Some packages could not be found #1980

weilueluo opened this issue Nov 2, 2023 · 2 comments

Comments

@weilueluo
Copy link

Hi guys, I ran the Golang CodeQL checks on this repository: https://github.com/CiscoDevNet/terraform-provider-cdo and found that it is unable to resolve some references. Those references are replaced in the go.mod file to a local package like this:

replace github.com/CiscoDevnet/terraform-provider-cdo/go-client => ../client

however, it seems like the tool does not recognise this:
Screenshot 2023-11-02 at 21 19 34

May I know how can I resolve this? Any help is appreciated!

@aibaars
Copy link
Collaborator

aibaars commented Nov 3, 2023

Thanks for reporting this. The error message suggests that this can be fixed by using a custom build command. Have you tried that?

I'm not sure CodeQL "understands" the replace statements in your mod.go file. I'll ask the team if we support this feature, and if not, perhaps it could be implemented.

@weilueluo
Copy link
Author

Hi, thanks for the reply! I have added my custom build command and now the warnings are gone, however, it is still not running queries for the files in the client directory. I downloaded artifact and found that the files in the client directory had been indexed:
Screenshot 2023-11-03 at 15 07 01
However, when I download the language csv report from this link (not sure if you can access)
https://github.com/CiscoDevNet/terraform-provider-cdo/security/code-scanning/tools/CodeQL/status, It says that all files in the client directory are not successfully extracted
Screenshot 2023-11-03 at 15 09 27
And then I went to decode the files in codeql_databases/go/results/codeql/go-queries/Diagnostics/ExtractionErrors.bqrs and I got:

~/Downloads/artifact/codeql_databases/go/results/codeql/go-queries/Diagnostics ❯ codeql bqrs decode -- ExtractionErrors.bqrs                                                                                 17:46:07
| msg | sev |
+-----+-----+
~/Downloads/artifact/codeql_databases/go/results/codeql/go-queries/Diagnostics ❯

which seems to suggest no error is found. Does it mean that the codeql has intentionally filtered out that package? How can I tell codeql to run query on that package as well? Any suggestion would be helpful! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants