Add workflows for Codecov, CodeQL, and Codacy integration#3
Add workflows for Codecov, CodeQL, and Codacy integration#3marekdkropiewnicki-dotcom wants to merge 17 commits into
Conversation
Bumps the pip group with 1 update in the / directory: [flask](https://github.com/pallets/flask). Updates `flask` from 3.0.3 to 3.1.3 - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](pallets/flask@3.0.3...3.1.3) --- updated-dependencies: - dependency-name: flask dependency-version: 3.1.3 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] <support@github.com>
This workflow performs a Codacy security scan and integrates the results with GitHub Advanced Security.
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions workflows and configuration to integrate code scanning and code quality/coverage tooling (CodeQL, Codecov, Codacy) plus Dependabot.
Changes:
- Add CodeQL “Advanced” code scanning workflow.
- Add pytest coverage workflow that uploads reports to Codecov.
- Add Codacy security scan workflow and a Dependabot configuration file.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| .github/workflows/codeql.yml | Introduces CodeQL scanning job for Actions + Python (currently has YAML indentation issues). |
| .github/workflows/codecov.yml | Adds a pytest coverage job and uploads to Codecov (may fail in repos without tests / fork PRs). |
| .github/workflows/codacy.yml | Adds Codacy SARIF generation + upload to code scanning (may fail on fork PRs due to secrets). |
| .github/dependabot.yml | Adds Dependabot config (currently invalid due to empty ecosystem). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
steps: is defined, but the step items (- name: etc.) are not indented beneath it, which will cause a YAML parse error and prevent the workflow from running. Indent all - name: entries under steps:.
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| slug: marekdkropiewnicki-dotcom/flask-api |
There was a problem hiding this comment.
Hardcoding slug: marekdkropiewnicki-dotcom/flask-api will break coverage uploads for forks and if the repository is renamed/transferred. The Codecov action can infer the repo from GITHUB_REPOSITORY, so it’s safer to remove the slug setting.
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This workflow runs Bandit, a security linter for Python, on pushes and pull requests to the main branch, and on a scheduled basis.
|
@copilot |
|
@copilot apply changes based on the comments in this thread @copilot |
|
@copilot Remember, contributions to this repository should follow our GitHub Community Guidelines. |
|
@copilot apply changes based on the comments in this thread |
|
@copilot apply changes based on the comments in this thread |
|
@copilot apply changes based on the comments in this thread |
|
@copilot apply changes based on the comments in this thread |
|
@copilot apply changes based on the comments in this thread |
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" |
| - name: Run tests with coverage | ||
| run: | | ||
| pytest --cov --cov-branch --cov-report=xml | ||
| status=$? | ||
| if [ "$status" -eq 5 ]; then | ||
| echo "No tests were collected by pytest; treating exit code 5 as success." | ||
| exit 0 | ||
| fi | ||
| exit "$status" |
| exit "$status" | ||
|
|
||
| - name: Upload coverage reports to Codecov | ||
| if: ${{ github.event_name != 'pull_request' || env.CODECOV_TOKEN != '' }} |
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ env.CODECOV_TOKEN }} | ||
| slug: marekdkropiewnicki-dotcom/flask-api |
| if: ${{ github.event_name != 'pull_request' || env.CODECOV_TOKEN != '' }} | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| uses: codecov/codecov-action@v5 |
|
|
||
| # Upload the SARIF file generated in the previous step | ||
| - name: Upload SARIF results file | ||
| uses: github/codeql-action/upload-sarif@v3 |
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| build-mode: ${{ matrix.build-mode }} |
* Initial plan * test: add pytest tests for Flask app routes and coverage Agent-Logs-Url: https://github.com/marekdkropiewnicki-dotcom/flask-api/sessions/067a86e5-a314-4704-95ea-37ce97190e48 Co-authored-by: marekdkropiewnicki-dotcom <259442047+marekdkropiewnicki-dotcom@users.noreply.github.com> * chore: add coverage.xml to .gitignore Agent-Logs-Url: https://github.com/marekdkropiewnicki-dotcom/flask-api/sessions/067a86e5-a314-4704-95ea-37ce97190e48 Co-authored-by: marekdkropiewnicki-dotcom <259442047+marekdkropiewnicki-dotcom@users.noreply.github.com> * test: improve test assertions based on code review feedback Agent-Logs-Url: https://github.com/marekdkropiewnicki-dotcom/flask-api/sessions/067a86e5-a314-4704-95ea-37ce97190e48 Co-authored-by: marekdkropiewnicki-dotcom <259442047+marekdkropiewnicki-dotcom@users.noreply.github.com> * Update conftest.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * test: add module/fixture docstrings and silence pylint redefined-outer-name Agent-Logs-Url: https://github.com/marekdkropiewnicki-dotcom/flask-api/sessions/cb23b390-6a95-4ef9-acee-0a6aefd31765 Co-authored-by: marekdkropiewnicki-dotcom <259442047+marekdkropiewnicki-dotcom@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: marekdkropiewnicki-dotcom <259442047+marekdkropiewnicki-dotcom@users.noreply.github.com> Co-authored-by: QuantuM <marek.d.kropiewnicki@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Bumps the pip group with 1 update in the / directory: [flask](https://github.com/pallets/flask). Updates `flask` from 3.0.3 to 3.1.3 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/pallets/flask/releases">flask's releases</a>.</em></p> <blockquote> <h2>3.1.3</h2> <p>This is the Flask 3.1.3 security fix release, which fixes a security issue but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.</p> <p>PyPI: <a href="https://pypi.org/project/Flask/3.1.3/">https://pypi.org/project/Flask/3.1.3/</a> Changes: <a href="https://flask.palletsprojects.com/page/changes/#version-3-1-3">https://flask.palletsprojects.com/page/changes/#version-3-1-3</a></p> <ul> <li>The session is marked as accessed for operations that only access the keys but not the values, such as <code>in</code> and <code>len</code>. <a href="https://github.com/pallets/flask/security/advisories/GHSA-68rp-wp8r-4726">GHSA-68rp-wp8r-4726</a></li> </ul> <h2>3.1.2</h2> <p>This is the Flask 3.1.2 fix release, which fixes bugs but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.</p> <p>PyPI: <a href="https://pypi.org/project/Flask/3.1.2/">https://pypi.org/project/Flask/3.1.2/</a> Changes: <a href="https://flask.palletsprojects.com/page/changes/#version-3-1-2">https://flask.palletsprojects.com/page/changes/#version-3-1-2</a> Milestone: <a href="https://github.com/pallets/flask/milestone/38?closed=1">https://github.com/pallets/flask/milestone/38?closed=1</a></p> <ul> <li><code>stream_with_context</code> does not fail inside async views. <a href="https://redirect.github.com/pallets/flask/issues/5774">#5774</a></li> <li>When using <code>follow_redirects</code> in the test client, the final state of <code>session</code> is correct. <a href="https://redirect.github.com/pallets/flask/issues/5786">#5786</a></li> <li>Relax type hint for passing bytes IO to <code>send_file</code>. <a href="https://redirect.github.com/pallets/flask/issues/5776">#5776</a></li> </ul> <h2>3.1.1</h2> <p>This is the Flask 3.1.1 fix release, which fixes bugs but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.</p> <p>PyPI: <a href="https://pypi.org/project/Flask/3.1.1/">https://pypi.org/project/Flask/3.1.1/</a> Changes: <a href="https://flask.palletsprojects.com/en/stable/changes/#version-3-1-1">https://flask.palletsprojects.com/en/stable/changes/#version-3-1-1</a> Milestone <a href="https://github.com/pallets/flask/milestone/36?closed=1">https://github.com/pallets/flask/milestone/36?closed=1</a></p> <ul> <li>Fix signing key selection order when key rotation is enabled via <code>SECRET_KEY_FALLBACKS</code>. GHSA-4grg-w6v8-c28g</li> <li>Fix type hint for <code>cli_runner.invoke</code>. <a href="https://redirect.github.com/pallets/flask/issues/5645">#5645</a></li> <li><code>flask --help</code> loads the app and plugins first to make sure all commands are shown. <a href="https://redirect.github.com/pallets/flask/issues/5673">#5673</a></li> <li>Mark sans-io base class as being able to handle views that return <code>AsyncIterable</code>. This is not accurate for Flask, but makes typing easier for Quart. <a href="https://redirect.github.com/pallets/flask/issues/5659">#5659</a></li> </ul> <h2>3.1.0</h2> <p>This is the Flask 3.1.0 feature release. A feature release may include new features, remove previously deprecated code, add new deprecations, or introduce potentially breaking changes. We encourage everyone to upgrade, and to use a tool such as <a href="https://pypi.org/project/pip-tools/">pip-tools</a> to pin all dependencies and control upgrades. Test with warnings treated as errors to be able to adapt to deprecation warnings early.</p> <p>PyPI: <a href="https://pypi.org/project/Flask/3.1.0/">https://pypi.org/project/Flask/3.1.0/</a> Changes: <a href="https://flask.palletsprojects.com/en/stable/changes/#version-3-1-0">https://flask.palletsprojects.com/en/stable/changes/#version-3-1-0</a> Milestone: <a href="https://github.com/pallets/flask/milestone/33?closed=1">https://github.com/pallets/flask/milestone/33?closed=1</a></p> <ul> <li>Drop support for Python 3.8. <a href="https://redirect.github.com/pallets/flask/issues/5623">#5623</a></li> <li>Update minimum dependency versions to latest feature releases. Werkzeug >= 3.1, ItsDangerous >= 2.2, Blinker >= 1.9. <a href="https://redirect.github.com/pallets/flask/issues/5624">#5624</a>, <a href="https://redirect.github.com/pallets/flask/issues/5633">#5633</a></li> <li>Provide a configuration option to control automatic option responses. <a href="https://redirect.github.com/pallets/flask/issues/5496">#5496</a></li> <li><code>Flask.open_resource</code>/<code>open_instance_resource</code> and <code>Blueprint.open_resource</code> take an <code>encoding</code> parameter to use when opening in text mode. It defaults to <code>utf-8</code>. <a href="https://redirect.github.com/pallets/flask/issues/5504">#5504</a></li> <li><code>Request.max_content_length</code> can be customized per-request instead of only through the <code>MAX_CONTENT_LENGTH</code> config. Added <code>MAX_FORM_MEMORY_SIZE</code> and <code>MAX_FORM_PARTS</code> config. Added documentation about resource limits to the security page. <a href="https://redirect.github.com/pallets/flask/issues/5625">#5625</a></li> <li>Add support for the <code>Partitioned</code> cookie attribute (CHIPS), with the <code>SESSION_COOKIE_PARTITIONED</code> config. <a href="https://redirect.github.com/pallets/flask/issues/5472">#5472</a></li> <li><code>-e path</code> takes precedence over default <code>.env</code> and <code>.flaskenv</code> files. <code>load_dotenv</code> loads default files in addition to a path unless <code>load_defaults=False</code> is passed. <a href="https://redirect.github.com/pallets/flask/issues/5628">#5628</a></li> <li>Support key rotation with the <code>SECRET_KEY_FALLBACKS</code> config, a list of old secret keys that can still be used for unsigning. Extensions will need to add support. <a href="https://redirect.github.com/pallets/flask/issues/5621">#5621</a></li> <li>Fix how setting <code>host_matching=True</code> or <code>subdomain_matching=False</code> interacts with <code>SERVER_NAME</code>. Setting <code>SERVER_NAME</code> no longer restricts requests to only that domain. <a href="https://redirect.github.com/pallets/flask/issues/5553">#5553</a></li> <li><code>Request.trusted_hosts</code> is checked during routing, and can be set through the <code>TRUSTED_HOSTS</code> config. <a href="https://redirect.github.com/pallets/flask/issues/5636">#5636</a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pallets/flask/blob/main/CHANGES.rst">flask's changelog</a>.</em></p> <blockquote> <h2>Version 3.1.3</h2> <p>Released 2026-02-18</p> <ul> <li>The session is marked as accessed for operations that only access the keys but not the values, such as <code>in</code> and <code>len</code>. :ghsa:<code>68rp-wp8r-4726</code></li> </ul> <h2>Version 3.1.2</h2> <p>Released 2025-08-19</p> <ul> <li><code>stream_with_context</code> does not fail inside async views. :issue:<code>5774</code></li> <li>When using <code>follow_redirects</code> in the test client, the final state of <code>session</code> is correct. :issue:<code>5786</code></li> <li>Relax type hint for passing bytes IO to <code>send_file</code>. :issue:<code>5776</code></li> </ul> <h2>Version 3.1.1</h2> <p>Released 2025-05-13</p> <ul> <li>Fix signing key selection order when key rotation is enabled via <code>SECRET_KEY_FALLBACKS</code>. :ghsa:<code>4grg-w6v8-c28g</code></li> <li>Fix type hint for <code>cli_runner.invoke</code>. :issue:<code>5645</code></li> <li><code>flask --help</code> loads the app and plugins first to make sure all commands are shown. :issue:<code>5673</code></li> <li>Mark sans-io base class as being able to handle views that return <code>AsyncIterable</code>. This is not accurate for Flask, but makes typing easier for Quart. :pr:<code>5659</code></li> </ul> <h2>Version 3.1.0</h2> <p>Released 2024-11-13</p> <ul> <li>Drop support for Python 3.8. :pr:<code>5623</code></li> <li>Update minimum dependency versions to latest feature releases. Werkzeug >= 3.1, ItsDangerous >= 2.2, Blinker >= 1.9. :pr:<code>5624,5633</code></li> <li>Provide a configuration option to control automatic option responses. :pr:<code>5496</code></li> <li><code>Flask.open_resource</code>/<code>open_instance_resource</code> and <code>Blueprint.open_resource</code> take an <code>encoding</code> parameter to use when opening in text mode. It defaults to <code>utf-8</code>. :issue:<code>5504</code></li> <li><code>Request.max_content_length</code> can be customized per-request instead of only through the <code>MAX_CONTENT_LENGTH</code> config. Added</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pallets/flask/commit/22d924701a6ae2e4cd01e9a15bbaf3946094af65"><code>22d9247</code></a> release version 3.1.3</li> <li><a href="https://github.com/pallets/flask/commit/089cb86dd22bff589a4eafb7ab8e42dc357623b4"><code>089cb86</code></a> Merge commit from fork</li> <li><a href="https://github.com/pallets/flask/commit/c17f379390731543eea33a570a47bd4ef76a54fa"><code>c17f379</code></a> request context tracks session access</li> <li><a href="https://github.com/pallets/flask/commit/27be9338405382445a7cb01151e084559b98d602"><code>27be933</code></a> start version 3.1.3</li> <li><a href="https://github.com/pallets/flask/commit/4e652d3f68b90d50aa2301d3b7e68c3fafd9251d"><code>4e652d3</code></a> Abort if the instance folder cannot be created (<a href="https://redirect.github.com/pallets/flask/issues/5903">#5903</a>)</li> <li><a href="https://github.com/pallets/flask/commit/3d03098a97ddc6a908aa4a50c2ef7381f8297d0a"><code>3d03098</code></a> Abort if the instance folder cannot be created</li> <li><a href="https://github.com/pallets/flask/commit/407eb76b27884848383a37c7274654f0271e4bc4"><code>407eb76</code></a> document using gevent for async (<a href="https://redirect.github.com/pallets/flask/issues/5900">#5900</a>)</li> <li><a href="https://github.com/pallets/flask/commit/ac5664d2281533eacafd64f5cc7d5edcdaccab60"><code>ac5664d</code></a> document using gevent for async</li> <li><a href="https://github.com/pallets/flask/commit/4f79d5b59a56bc4356a97f2e81a35f98cb18d7b3"><code>4f79d5b</code></a> Increase required flit_core version to 3.11 (<a href="https://redirect.github.com/pallets/flask/issues/5865">#5865</a>)</li> <li><a href="https://github.com/pallets/flask/commit/fe3b215d3ade4db68262dae1a3cdc464a1fc524f"><code>fe3b215</code></a> Increase required flit_core version to 3.11</li> <li>Additional commits viewable in <a href="https://github.com/pallets/flask/compare/3.0.3...3.1.3">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/marekdkropiewnicki-dotcom/flask-api/network/alerts). </details>
No description provided.