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

Remove ineffective make build in CodeQL jobs #2259

Merged
merged 2 commits into from
Sep 28, 2022

Conversation

dfarrell07
Copy link
Member

@dfarrell07 dfarrell07 commented Sep 27, 2022

By running CodeQL locally (with more granular control than possible
through the GHA) it's possible to show that our make tooling isn't
creating a CodeQL database.

$ codeql database create go-database --language=go \
--command='make build'
Initializing database at
/home/dfarrell07/go/src/submariner-io/submariner-operator/go-database.
Running build command: [make, build]
[2022-09-26 21:09:56] [build-stdout] docker network create -d bridge kind
...
No source code was seen and extracted to
/home/dfarrell07/go/src/submariner-io/submariner-operator/go-database.
This can occur if the specified build commands failed to compile or
process any code.
$ tree go-database|wc -l
11
# There are 1000s of files when it works, the CodeQL DB for this code

The local invocation also offers this help:

 - For codebases written in Go, JavaScript, TypeScript, and Python, do
   not specify an explicit --command.

Which seems to conflict with the other docs. They say that for compiled
languages (like golang), the --command flag can be used to specify a
build step.

Main website "Creating CodeQL databases" docs:

--command: used when you create a database for one or more compiled
languages, omit if the only languages requested are Python and
JavaScript. This specifies the build commands needed to invoke the
compiler. Commands are run from the current folder, or --source-root if
specified. If you don’t include a --command, CodeQL will attempt to
detect the build system automatically, using a built-in autobuilder.

https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/

To do that with the GHA, run: make examples are given.

Main README:

# If the Autobuild fails above, remove it and uncomment the following
#   three lines and modify them (or add more) to build your code if your
#   project uses a compiled language

#- run: |
#     make bootstrap
#     make release

https://github.com/github/codeql-action/

Depends on #2219
Signed-off-by: Daniel Farrell [email protected]

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr2259/dfarrell07/nobuild_codeql
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@github-actions
Copy link

This PR/issue depends on:

By running CodeQL locally (with more granular control than possible
through the GHA) it's possible to show that our make tooling isn't
creating a CodeQL database.

```
$ codeql database create go-database --language=go \
--command='make build'
Initializing database at
/home/dfarrell07/go/src/submariner-io/submariner-operator/go-database.
Running build command: [make, build]
[2022-09-26 21:09:56] [build-stdout] docker network create -d bridge kind
...
No source code was seen and extracted to
/home/dfarrell07/go/src/submariner-io/submariner-operator/go-database.
This can occur if the specified build commands failed to compile or
process any code.
$ tree go-database|wc -l
11
\# There are 1000s of files when it works, the CodeQL DB for this code
```

The local invocation also offers this help:

```
 - For codebases written in Go, JavaScript, TypeScript, and Python, do
   not specify an explicit --command.
```

Which seems to conflict with the other docs. They say that for compiled
languages (like golang), the `--command` flag can be used to specify a
build step.

Main website "Creating CodeQL databases" docs:

```
--command: used when you create a database for one or more compiled
languages, omit if the only languages requested are Python and
JavaScript. This specifies the build commands needed to invoke the
compiler. Commands are run from the current folder, or --source-root if
specified. If you don’t include a --command, CodeQL will attempt to
detect the build system automatically, using a built-in autobuilder.
```

https://codeql.github.com/docs/codeql-cli/creating-codeql-databases/

To do that with the GHA, `run: make` examples are given.

Main README:

```
\# If the Autobuild fails above, remove it and uncomment the following
\#   three lines and modify them (or add more) to build your code if your
\#   project uses a compiled language

\#- run: |
\#     make bootstrap
\#     make release
```

https://github.com/github/codeql-action/

Signed-off-by: Daniel Farrell <[email protected]>
@dfarrell07
Copy link
Member Author

It's weird GH thinks there are conflicts git can't resolve, because a simple rebase worked locally (as expected, because I built this commit on top of the ABC order one just merged and still at HEAD).

@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Sep 28, 2022
@dfarrell07 dfarrell07 enabled auto-merge (rebase) September 28, 2022 13:00
@dfarrell07 dfarrell07 merged commit dc55d7b into submariner-io:devel Sep 28, 2022
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr2259/dfarrell07/nobuild_codeql]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation ready-to-test When a PR is ready for full E2E testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants