-
Notifications
You must be signed in to change notification settings - Fork 10
Add Pre-commit, gitleaks,codeql #172
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
base: main
Are you sure you want to change the base?
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files
|
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.
Pull request overview
Adds repository-level developer/CI security tooling to help catch secrets and vulnerabilities earlier in the PR workflow.
Changes:
- Introduces a
.pre-commit-config.yamlwith gitleaks + formatting/lint hooks. - Adds a GitHub Actions Dependency Review workflow to block risky dependency changes.
- Adds a GitHub Actions CodeQL workflow for Python static analysis.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.pre-commit-config.yaml |
Adds pre-commit hooks (gitleaks + whitespace + Python formatting/linting). |
.github/workflows/dependency-review.yml |
Adds Dependency Review action to gate PR dependency changes. |
.github/workflows/codeql.yml |
Adds scheduled + PR/push CodeQL analysis for Python. |
.pre-commit-config.yaml
Outdated
| # Python specific | ||
| - repo: https://github.com/psf/black | ||
| rev: 24.4.2 | ||
| hooks: | ||
| - id: black | ||
| language_version: python3 | ||
|
|
||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.13.2 | ||
| hooks: | ||
| - id: isort | ||
| args: ["--profile", "black"] | ||
|
|
||
| - repo: https://github.com/pycqa/flake8 | ||
| rev: 7.0.0 | ||
| hooks: | ||
| - id: flake8 | ||
| args: [--max-line-length=120] |
Copilot
AI
Feb 10, 2026
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.
The repo’s CI standardizes on Ruff for both linting and formatting (including line-length 100). Adding Black/Isort/Flake8 hooks here will likely produce different results locally (e.g., Black’s default line length 88 and Flake8 set to 120) than what CI enforces, causing noisy diffs and inconsistent failures. Consider replacing these Python hooks with Ruff + Ruff-format pre-commit hooks (or configure them to exactly match the existing Ruff settings).
| with: | ||
| fail-on-severity: high | ||
| comment-summary-in-pr: always | ||
| deny-licenses: GPL-3.0, AGPL-3.0 |
Copilot
AI
Feb 10, 2026
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.
deny-licenses expects SPDX license identifiers; GPL-3.0 and AGPL-3.0 are not valid SPDX IDs (e.g., use GPL-3.0-only / AGPL-3.0-only or the -or-later variants). With the current values the dependency review may not block the intended licenses.
| deny-licenses: GPL-3.0, AGPL-3.0 | |
| deny-licenses: GPL-3.0-only, AGPL-3.0-only |
a3d3169 to
bf83d08
Compare
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.4.4 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix, --line-length=100] | ||
| - id: ruff-format | ||
| args: [--line-length=100] |
Copilot
AI
Feb 10, 2026
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.
The ruff-pre-commit hook is pinned to v0.4.4, but the workspace’s locked Ruff version is 0.15.0 (see uv.lock). This large version mismatch can cause pre-commit to format/lint differently than CI (uv run ... ruff). Please bump the hook rev to match the locked Ruff version (or otherwise align the versions) so developers see the same results locally and in CI.
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] |
Copilot
AI
Feb 10, 2026
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 workflow only runs for PRs targeting main, but the repo’s CI also targets release/* branches. If release PRs are expected, dependency review won’t run there, which weakens the intended security gate. Consider including release/* in the on.pull_request.branches list (or removing the branch filter).
| branches: [main] | |
| branches: [main, release/*] |
| # Dependency Review - blocks PRs that introduce known-vulnerable dependencies | ||
| name: Dependency Review | ||
|
|
Copilot
AI
Feb 10, 2026
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.
The PR title mentions adding CodeQL, but this change set only adds pre-commit configuration and a dependency-review workflow—no CodeQL workflow/config is included. Please either add the intended CodeQL setup or adjust the PR title/description to match what’s actually being introduced.
No description provided.