Add CodeQL Python coverage and ShellCheck/PSScriptAnalyzer/ruff lint gates#145
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR closes CI/security-baseline gaps by expanding CodeQL coverage to Python and introducing a new CI “Lint” workflow that enforces ShellCheck, PSScriptAnalyzer, and ruff checks across the repo. It also updates an existing Python helper script and a PowerShell installer to comply with the new lint gates.
Changes:
- Extend CodeQL language matrix to include Python.
- Add a new
.github/workflows/lint.ymlworkflow with ShellCheck, PSScriptAnalyzer, and ruff gates plus corresponding repo configs (ruff.toml,PSScriptAnalyzerSettings.psd1). - Update
trigger-getting-started.pyandinstall.ps1to satisfy the new linting requirements.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ruff.toml |
Adds repo-wide ruff configuration (line length, target version, selected rule sets). |
public-preview/connector-namespace-cli/install.ps1 |
Encoding-only change (adds UTF-8 BOM) to satisfy PSScriptAnalyzer BOM rule. |
PSScriptAnalyzerSettings.psd1 |
Adds analyzer settings excluding PSAvoidUsingWriteHost repo-wide. |
plugin/skills/aca-sandboxes/scripts/trigger-getting-started.py |
Ruff-driven cleanup and Bandit suppressions; refactors long string; (note: callback URL host must be regional). |
.github/workflows/lint.yml |
New workflow enforcing ShellCheck, PSScriptAnalyzer, and ruff checks in CI. |
.github/workflows/codeql.yml |
Adds Python to CodeQL scan matrix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…efixes, wrap long URL
… pinned versions, not preinstalled
7487921 to
6feaafa
Compare
Summary
Closes the CodeQL-Python and CI-lint gaps identified during the repo security-baseline audit.
Changes
pythonto the language matrix. Python is this repo's dominant language (14,338 bytes) but had zero CodeQL coverage - the matrix only ever scannedactions.ShellCheckagainst all*.shfilesPSScriptAnalyzer(pinned to 1.25.0) against all*.ps1files (Warning+Errorseverity)ruff(pinned to 0.15.14) against all Python files, selecting both style (E,F) and security (S/ flake8-bandit) rulesline-length = 150,target-version = "py310"(matches this script's documented Python 3.10+ minimum),select = ["E", "F", "S"].PSAvoidUsingWriteHostrepo-wide, sinceinstall.ps1is an interactiveirm | iexinstaller where console-only output is intentional.fprefixes from 6 f-strings with no placeholders (F541).# noqa: S603/# noqa: S607comments on the 4subprocess.runcalls toaz- all use fixed argument lists (nevershell=True, never untrusted/interpolated input), so these are not injection risks.callbackUrlused the unregionalmanagement.azuredevcompute.iohost, which 404s (GlobalSandboxNotFound) per this repo's owngotchas.md/trigger-setup.md. Now fetches the sandbox group's ARM location and builds a regionalmanagement.{region}.azuredevcompute.iohost instead. Theaudiencefield is intentionally left unregional, matching the documented canonical pattern.PSUseBOMForUnicodeEncodedFile.Validation
All three lint tools were run locally against the affected files before pushing, and the PR's own CI (CodeQL actions+python, Lint/ShellCheck, Lint/PSScriptAnalyzer, Lint/Ruff) is green:
ruff check .-> all checks passed (including after the py310 target-version fix)Invoke-ScriptAnalyzer -Settings PSScriptAnalyzerSettings.psd1-> zero findingsset -euo pipefail/set -euand consistently quote variables - confirmed clean by the CI ShellCheck job.Went through two rounds of Copilot review: round 1 caught the regional-host bug above; round 2 caught the unpinned tool versions and an inaccurate header comment (all fixed). Round 3 was a clean pass.