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

Add CodeQL workflow for GitHub code scanning #7085

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

lgtm-com[bot]
Copy link
Contributor

@lgtm-com lgtm-com bot commented Nov 16, 2022

Hi aio-libs/aiohttp!

This is a one-off automatically generated pull request from LGTM.com 🤖. You might have heard that we’ve integrated LGTM’s underlying CodeQL analysis engine natively into GitHub. The result is GitHub code scanning!

With LGTM fully integrated into code scanning, we are focused on improving CodeQL within the native GitHub code scanning experience. In order to take advantage of current and future improvements to our analysis capabilities, we suggest you enable code scanning on your repository. Please take a look at our blog post for more information.

This pull request enables code scanning by adding an auto-generated codeql.yml workflow file for GitHub Actions to your repository — take a look! We tested it before opening this pull request, so all should be working ✔️. In fact, you might already have seen some alerts appear on this pull request!

Where needed and if possible, we’ve adjusted the configuration to the needs of your particular repository. But of course, you should feel free to tweak it further! Check this page for detailed documentation.

Questions? Check out the FAQ below!

FAQ

Click here to expand the FAQ section

How often will the code scanning analysis run?

By default, code scanning will trigger a scan with the CodeQL engine on the following events:

  • On every pull request — to flag up potential security problems for you to investigate before merging a PR.
  • On every push to your default branch and other protected branches — this keeps the analysis results on your repository’s Security tab up to date.
  • Once a week at a fixed time — to make sure you benefit from the latest updated security analysis even when no code was committed or PRs were opened.

What will this cost?

Nothing! The CodeQL engine will run inside GitHub Actions, making use of your unlimited free compute minutes for public repositories.

What types of problems does CodeQL find?

The CodeQL engine that powers GitHub code scanning is the exact same engine that powers LGTM.com. The exact set of rules has been tweaked slightly, but you should see almost exactly the same types of alerts as you were used to on LGTM.com: we’ve enabled the security-and-quality query suite for you.

How do I upgrade my CodeQL engine?

No need! New versions of the CodeQL analysis are constantly deployed on GitHub.com; your repository will automatically benefit from the most recently released version.

The analysis doesn’t seem to be working

If you get an error in GitHub Actions that indicates that CodeQL wasn’t able to analyze your code, please follow the instructions here to debug the analysis.

How do I disable LGTM.com?

If you have LGTM’s automatic pull request analysis enabled, then you can follow these steps to disable the LGTM pull request analysis. You don’t actually need to remove your repository from LGTM.com; it will automatically be removed in the next few months as part of the deprecation of LGTM.com (more info here).

Which source code hosting platforms does code scanning support?

GitHub code scanning is deeply integrated within GitHub itself. If you’d like to scan source code that is hosted elsewhere, we suggest that you create a mirror of that code on GitHub.

How do I know this PR is legitimate?

This PR is filed by the official LGTM.com GitHub App, in line with the deprecation timeline that was announced on the official GitHub Blog. The proposed GitHub Action workflow uses the official open source GitHub CodeQL Action. If you have any other questions or concerns, please join the discussion here in the official GitHub community!

I have another question / how do I get in touch?

Please join the discussion here to ask further questions and send us suggestions!

@lgtm-com lgtm-com bot requested a review from webknjaz as a code owner November 16, 2022 16:09
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Merging #7085 (36b9e7e) into master (3ee7091) will not change coverage.
The diff coverage is n/a.

❗ Current head 36b9e7e differs from pull request most recent head 6c2ebc5. Consider uploading reports for the commit 6c2ebc5 to get more accurate results

@@           Coverage Diff           @@
##           master    #7085   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files         103      103           
  Lines       29999    29999           
  Branches     3651     3651           
=======================================
  Hits        29252    29252           
  Misses        567      567           
  Partials      180      180           
Flag Coverage Δ
CI-GHA 97.41% <ø> (ø)
OS-Linux 97.05% <ø> (ø)
OS-Windows 95.39% <ø> (ø)
OS-macOS 96.69% <ø> (-0.01%) ⬇️
Py-3.10.8 97.16% <ø> (-0.06%) ⬇️
Py-3.11.0 96.61% <ø> (+0.04%) ⬆️
Py-3.7.15 96.89% <ø> (ø)
Py-3.7.9 95.28% <ø> (ø)
Py-3.8.10 95.18% <ø> (-0.01%) ⬇️
Py-3.8.14 96.78% <ø> (ø)
Py-3.9.13 95.17% <ø> (-0.01%) ⬇️
Py-3.9.14 96.58% <ø> (-0.01%) ⬇️
Py-3.9.15 96.76% <ø> (ø)
Py-pypy7.3.9 96.44% <ø> (ø)
VM-macos 96.69% <ø> (-0.01%) ⬇️
VM-ubuntu 97.05% <ø> (ø)
VM-windows 95.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Dreamsorcerer Dreamsorcerer added bot:chronographer:skip This PR does not need to include a change note backport-3.9 labels Nov 28, 2022
@Dreamsorcerer Dreamsorcerer enabled auto-merge (squash) November 28, 2022 19:45
@Dreamsorcerer Dreamsorcerer merged commit 30b375c into aio-libs:master Nov 28, 2022
@patchback
Copy link
Contributor

patchback bot commented Nov 28, 2022

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/30b375cee4ffe09085186274f0eb2b62f89fab18/pr-7085

Backported as #7108

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 28, 2022
Hi `aio-libs/aiohttp`!

This is a one-off automatically generated pull request from LGTM.com
:robot:. You might have heard that we’ve integrated LGTM’s underlying
CodeQL analysis engine natively into GitHub. The result is [**GitHub
code
scanning**](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning)!

With LGTM fully integrated into code scanning, we are focused on
improving CodeQL within the native GitHub code scanning experience. In
order to take advantage of current and future improvements to our
analysis capabilities, we suggest you enable code scanning on your
repository. Please take a look at our [blog post for more
information](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).

This pull request enables code scanning by adding an auto-generated
[`codeql.yml` workflow file for GitHub
Actions](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-manually)
to your repository — take a look! We tested it before opening this pull
request, so all should be working ✔️. In fact, you might
already have seen some alerts appear on this pull request!

Where needed and if possible, we’ve adjusted the configuration to the
needs of your particular repository. But of course, you should feel free
to tweak it further! Check [this
page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#editing-a-code-scanning-workflow)
for detailed documentation.

Questions? Check out the FAQ below!

### FAQ
<details>
<summary>Click here to expand the FAQ section</summary>

#### How often will the code scanning analysis run?
By default, code scanning will trigger a scan with the CodeQL engine on
the following events:
* On every pull request — to flag up potential security problems for you
to investigate before merging a PR.
* On every push to your default branch and other protected branches —
this keeps the analysis results on your repository’s *Security* tab up
to date.
* Once a week at a fixed time — to make sure you benefit from the latest
updated security analysis even when no code was committed or PRs were
opened.

#### What will this cost?
Nothing! The CodeQL engine will run inside GitHub Actions, making use of
your [unlimited free compute minutes for public
repositories](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#about-billing-for-github-actions).

#### What types of problems does CodeQL find?
The CodeQL engine that powers GitHub code scanning is the exact same
engine that powers LGTM.com. The exact set of rules has been tweaked
slightly, but you should see almost exactly the same types of alerts as
you were used to on LGTM.com: we’ve enabled the [`security-and-quality`
query
suite](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs)
for you.

#### How do I upgrade my CodeQL engine?
No need! New versions of the CodeQL analysis are constantly deployed on
GitHub.com; your repository will automatically benefit from the most
recently released version.

#### The analysis doesn’t seem to be working
If you get an error in GitHub Actions that indicates that CodeQL wasn’t
able to analyze your code, please [follow the instructions
here](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow)
to debug the analysis.

#### How do I disable LGTM.com?
If you have LGTM’s automatic pull request analysis enabled, then you can
[follow these steps to disable the LGTM pull request
analysis](https://lgtm.com/help/lgtm/managing-automated-code-review#disabling-pr-integration).
You don’t actually need to remove your repository from LGTM.com; it will
automatically be removed in the next few months as part of the
deprecation of LGTM.com ([more info
here](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/)).

#### Which source code hosting platforms does code scanning support?
GitHub code scanning is deeply integrated within GitHub itself. If you’d
like to scan source code that is hosted elsewhere, we suggest that you
create a mirror of that code on GitHub.

#### How do I know this PR is legitimate?
This PR is filed by the official LGTM.com GitHub App, in line with the
[deprecation timeline that was announced on the official GitHub
Blog](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).
The proposed GitHub Action workflow uses the [official open source
GitHub CodeQL Action](https://github.com/github/codeql-action/). If you
have any other questions or concerns, please join the discussion
[here](https://github.com/orgs/community/discussions/29534) in the
official GitHub community!

#### I have another question / how do I get in touch?
Please join the discussion
[here](https://github.com/orgs/community/discussions/29534) to ask
further questions and send us suggestions!

</details>

Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com>
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
(cherry picked from commit 30b375c)
Dreamsorcerer pushed a commit that referenced this pull request Nov 28, 2022
… scanning (#7108)

**This is a backport of PR #7085 as merged into master
(30b375c).**

Hi `aio-libs/aiohttp`!

This is a one-off automatically generated pull request from LGTM.com
:robot:. You might have heard that we’ve integrated LGTM’s underlying
CodeQL analysis engine natively into GitHub. The result is [**GitHub
code
scanning**](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning)!

With LGTM fully integrated into code scanning, we are focused on
improving CodeQL within the native GitHub code scanning experience. In
order to take advantage of current and future improvements to our
analysis capabilities, we suggest you enable code scanning on your
repository. Please take a look at our [blog post for more
information](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).

This pull request enables code scanning by adding an auto-generated
[`codeql.yml` workflow file for GitHub
Actions](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-manually)
to your repository — take a look! We tested it before opening this pull
request, so all should be working ✔️. In fact, you might
already have seen some alerts appear on this pull request!

Where needed and if possible, we’ve adjusted the configuration to the
needs of your particular repository. But of course, you should feel free
to tweak it further! Check [this
page](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#editing-a-code-scanning-workflow)
for detailed documentation.

Questions? Check out the FAQ below!

### FAQ
<details>
<summary>Click here to expand the FAQ section</summary>

#### How often will the code scanning analysis run?
By default, code scanning will trigger a scan with the CodeQL engine on
the following events:
* On every pull request — to flag up potential security problems for you
to investigate before merging a PR.
* On every push to your default branch and other protected branches —
this keeps the analysis results on your repository’s *Security* tab up
to date.
* Once a week at a fixed time — to make sure you benefit from the latest
updated security analysis even when no code was committed or PRs were
opened.

#### What will this cost?
Nothing! The CodeQL engine will run inside GitHub Actions, making use of
your [unlimited free compute minutes for public
repositories](https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#about-billing-for-github-actions).

#### What types of problems does CodeQL find?
The CodeQL engine that powers GitHub code scanning is the exact same
engine that powers LGTM.com. The exact set of rules has been tweaked
slightly, but you should see almost exactly the same types of alerts as
you were used to on LGTM.com: we’ve enabled the [`security-and-quality`
query
suite](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs)
for you.

#### How do I upgrade my CodeQL engine?
No need! New versions of the CodeQL analysis are constantly deployed on
GitHub.com; your repository will automatically benefit from the most
recently released version.

#### The analysis doesn’t seem to be working
If you get an error in GitHub Actions that indicates that CodeQL wasn’t
able to analyze your code, please [follow the instructions
here](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow)
to debug the analysis.

#### How do I disable LGTM.com?
If you have LGTM’s automatic pull request analysis enabled, then you can
[follow these steps to disable the LGTM pull request
analysis](https://lgtm.com/help/lgtm/managing-automated-code-review#disabling-pr-integration).
You don’t actually need to remove your repository from LGTM.com; it will
automatically be removed in the next few months as part of the
deprecation of LGTM.com ([more info
here](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/)).

#### Which source code hosting platforms does code scanning support?
GitHub code scanning is deeply integrated within GitHub itself. If you’d
like to scan source code that is hosted elsewhere, we suggest that you
create a mirror of that code on GitHub.

#### How do I know this PR is legitimate?
This PR is filed by the official LGTM.com GitHub App, in line with the
[deprecation timeline that was announced on the official GitHub
Blog](https://github.blog/2022-08-15-the-next-step-for-lgtm-com-github-code-scanning/).
The proposed GitHub Action workflow uses the [official open source
GitHub CodeQL Action](https://github.com/github/codeql-action/). If you
have any other questions or concerns, please join the discussion
[here](https://github.com/orgs/community/discussions/29534) in the
official GitHub community!

#### I have another question / how do I get in touch?
Please join the discussion
[here](https://github.com/orgs/community/discussions/29534) to ask
further questions and send us suggestions!

</details>

Co-authored-by: lgtm-com[bot] <43144390+lgtm-com[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants