DEVOPS-1086: (v2) In CI-Tools, force Pylint on all files if environment lock has changed - #209
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the reusable Python static-analysis workflow so that, on pull requests, Pylint runs on all files when the environment lock definition changes (instead of only running on changed files or being skipped). This helps ensure lint results remain valid after dependency/environment updates.
Changes:
- Add
source-dir/test-dirinputs to better target Pixi “all-files” lint runs. - Detect lock-file changes per package manager and set
FORCE_ALL_FILESto trigger an all-files Pylint run on PRs. - Add an explicit “Pylint skipped” notice when no applicable file changes are detected and no force-run is triggered.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/reusable-python-static_analysis.yml:148
- The conda lock-file path detection treats any non-Linux runner as "win" (via RUNNER_OS), which will mis-identify the lock file on macOS runners. Since this workflow supports macos-latest in the OS matrix, lock-file changes on macOS could fail to trigger the intended FORCE_ALL_FILES behavior.
conda)
os_conda=$( [[ "$RUNNER_OS" == "Linux" ]] && echo "linux" || echo "win")
LOCK_FILE="environments/py-${PYTHON_VERSION}-${os_conda}-64-dev.conda.lock.yml"
;;
sebhmg
left a comment
There was a problem hiding this comment.
the logic looks correct 👍
Please, see comments for some adjustment:
- have a default value for test-dir in input definition
- clarification in doc and variable names
sebhmg
left a comment
There was a problem hiding this comment.
see comment about doc and test-dir
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
.github/workflows/reusable-python-static_analysis.yml:155
- Lock-file force-run detection only looks at files added/modified (
git diff --diff-filter=AM). If the lock file is deleted or renamed (both are still “changed” relative to base),FORCE_ALL_FILESwon’t be set and the workflow may incorrectly skip the full Pylint run. Consider using an unfiltered name list for lock detection while keeping theAMfilter for the per-file Pylint list (to avoid passing deleted paths to Pylint).
changed_files=$(git diff --diff-filter=AM --name-only refs/remotes/origin/${GITHUB_BASE_REF}... --)
if [ -n "$LOCK_FILE" ] && echo "$changed_files" | grep -qxF "$LOCK_FILE"; then
echo "::notice::Lock file '$LOCK_FILE' changed: forcing Pylint to run on all files"
echo "FORCE_ALL_FILES=true" >> $GITHUB_ENV
DEVOPS-1086 - In CI-Tools, force Pylint on all files if environment lock has changed