staging environment#183
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request introduces a standardized pull request template and a Dangerfile.js to automate CI checks, including PR size warnings, test requirements for source changes, and protection for sensitive files. The review feedback suggests improving the source change detection logic to include newly created files and refining the dependency check to specifically warn when the uv.lock file is not updated alongside manifest changes.
| const hasSourceChanges = danger.git.modified_files | ||
| .some(f => f.startsWith("src/")); |
There was a problem hiding this comment.
The hasSourceChanges check currently only considers modified_files. It should also include created_files to ensure that new source files are also checked for accompanying tests, maintaining consistency with the hasTestChanges check on line 18.
const hasSourceChanges = danger.git.modified_files
.concat(danger.git.created_files)
.some(f => f.startsWith("src/"));| const touchedDeps = danger.git.modified_files.filter(f => depFiles.includes(f)); | ||
|
|
||
| if (touchedDeps.includes("pyproject.toml") || touchedDeps.includes("requirements.txt")) { | ||
| warn( | ||
| "📦 `pyproject.toml` or `requirements.txt` was modified. " + | ||
| "Make sure `uv.lock` is updated (`uv lock`) and the security audit passes." | ||
| ); | ||
| } |
There was a problem hiding this comment.
The dependency check can be improved by verifying if uv.lock is actually included in the PR when pyproject.toml or requirements.txt are changed. This makes the warning more actionable by only triggering when the lockfile is likely out of sync. Additionally, including created_files ensures the check is comprehensive.
| const touchedDeps = danger.git.modified_files.filter(f => depFiles.includes(f)); | |
| if (touchedDeps.includes("pyproject.toml") || touchedDeps.includes("requirements.txt")) { | |
| warn( | |
| "📦 `pyproject.toml` or `requirements.txt` was modified. " + | |
| "Make sure `uv.lock` is updated (`uv lock`) and the security audit passes." | |
| ); | |
| } | |
| const touchedDeps = danger.git.modified_files | |
| .concat(danger.git.created_files) | |
| .filter(f => depFiles.includes(f)); | |
| if ((touchedDeps.includes("pyproject.toml") || touchedDeps.includes("requirements.txt")) && !touchedDeps.includes("uv.lock")) { | |
| warn( | |
| "📦 `pyproject.toml` or `requirements.txt` was modified without updating `uv.lock`. " + | |
| "Please run `uv lock` and include the updated lockfile in your PR." | |
| ); | |
| } |
No description provided.