Repository navigation
Conversation
…ate_all_dependencies.sh
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds an update_if_present helper function to generate_all_dependencies.sh to regenerate hash-pinned CI workflow and test-infra requirements, and introduces a new requirements-test.in file for bigquery anomaly detection. Feedback suggests adding a check to ensure the base requirements file exists before compilation to prevent script failures.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a helper function update_if_present in generate_all_dependencies.sh to conditionally regenerate hash-pinned CI workflow and test-infra helper requirements, and adds a new test-only requirements file for the BigQuery anomaly detection module. Feedback suggests executing generate_dependencies.sh using bash instead of sh to prevent potential compatibility issues with bash-specific features.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4613 +/- ##
============================================
+ Coverage 33.53% 37.88% +4.35%
- Complexity 512 521 +9
============================================
Files 219 197 -22
Lines 13486 12001 -1485
Branches 1373 1228 -145
============================================
+ Hits 4523 4547 +24
+ Misses 8590 7080 -1510
- Partials 373 374 +1
🚀 New features to boost your workflow:
|
…se_bqmonitor_requirements.txt
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates python/generate_all_dependencies.sh by introducing an update_if_present helper function to conditionally regenerate hash-pinned CI workflow and test-infra helper requirements. A review comment suggests executing generate_dependencies.sh using bash instead of sh to ensure compatibility and prevent potential syntax or runtime errors on systems where sh does not point to bash.
| BUILD_REQ="$2" | ||
| DEST_REQ="$3" | ||
| if [ -f "$BASE_REQ" ] && [ -f "$DEST_REQ" ] && grep -q -- "--hash=" "$DEST_REQ"; then | ||
| sh "$SCRIPTPATH/generate_dependencies.sh" "$BASE_REQ" "$BUILD_REQ" |
There was a problem hiding this comment.
Since generate_dependencies.sh specifies #!/bin/bash in its shebang and uses bash-specific features (such as alias), it should be executed using bash instead of sh to ensure portability and avoid syntax or runtime errors on systems where sh points to a non-bash shell (like dash on Ubuntu/Debian).
| sh "$SCRIPTPATH/generate_dependencies.sh" "$BASE_REQ" "$BUILD_REQ" | |
| bash "$SCRIPTPATH/generate_dependencies.sh" "$BASE_REQ" "$BUILD_REQ" |
There was a problem hiding this comment.
Keeping sh intentionally to match lines 24–25 above: generate_dependencies.sh defines alias pip_automation="pip" without shopt -s expand_aliases, so non-interactive bash fails with pip_automation: command not found (exit 127), whereas POSIX sh (dash on Ubuntu) expands aliases in non-interactive scripts.
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
CodeQL/Scorecard/zizmor) onmainthat are not already covered by upcoming Apache Beam releases, without altering intended template or workflow semanticsIf you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
Extends
python/generate_all_dependencies.sh(invoked on every Beam release upgrade and every Monday by.github/workflows/update-python-deps.ymlunder Python3.11) so the hash-pinned test and CI workflow requirements introduced in PRs #4602, #4603, #4604, #4605, and #4606 have their version pins and SHA-256 digests refreshed automatically alongside the existingchore(deps): update Python dependenciesPR.What's Included
bqmonitortest requirements (zero version drift, ci(security): pin pip install by SHA-256 hash in bqmonitor-pr.yml #4602):python/src/test/python/bigquery-anomaly-detection/requirements-test.txtdirectly frompython/default_base_bqmonitor_requirements.txtby swappingapache-beam[gcp]->apache-beam[gcp,test], so 100% of test dependency bounds come straight from the repo's pinned Apache Beam release while keeping the production container'srequirements_all.txtlean ([gcp]only)..inbase requirement inputs for standalone CI helper scripts (paired with existingtest-infra/requirements.txt):.github/workflows/requirements/yaml-pr.in(pyyaml->yaml-pr-hashes.txt, ci(security): pin pyyaml install by SHA-256 hash in yaml-pr.yml #4603).github/workflows/requirements/yaml-config-params-report.in(beautifulsoup4,jinja2,pyyaml,tabulate->yaml-config-params-report-hashes.txt, ci(security): pin pip install by SHA-256 hash in yaml-config-params-report.yml #4604)test-infra/requirements.txt(google-cloud-storage,google-cloud-spanner,google-cloud-datastream->test-infra/requirements-hashes.txt, ci(security): pin pip install by SHA-256 hash in cleanup-spanner-test-infra.yml #4605).github/workflows/requirements/poetry-requirements.in(poetry->poetry-requirements-hashes.txt, ci(security): replace unpinned pip install poetry with SHA-pinned action in upload-python-package.yml #4606)update_if_present):python/generate_dependencies.sh(pip-compile --upgrade --generate-hashes --allow-unsafe) once that hashed lockfile is present onmain, avoiding merge conflicts regardless of merge order across ci(security): pin pip install by SHA-256 hash in bqmonitor-pr.yml #4602–ci(security): replace unpinned pip install poetry with SHA-pinned action in upload-python-package.yml #4606 and this PR..github/workflows/update-python-deps.yml's existing Python3.11environment untouched (--generate-hashesemits cross-version PyPI wheel/sdist SHA-256 digests).