Skip to content

ci(security): pin pip install by SHA-256 hash in bqmonitor-pr.yml - #4602

Closed
derrickaw wants to merge 3 commits into
mainfrom
codescan/actions-bqmonitor-pr-pinned-pip
Closed

derrickaw wants to merge 3 commits into
mainfrom
codescan/actions-bqmonitor-pr-pinned-pip

Conversation

@derrickaw

@derrickaw derrickaw commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • The PR remediates confirmed, live Code Scanning finding(s) (CodeQL / Scorecard / zizmor) on main that are not already covered by upcoming Apache Beam releases, without altering intended template or workflow semantics
  • The fix is minimal, idiomatic, respects Dataflow Templates release-label and lockfile policies, and avoids suppressing alerts or masking defects
  • Relevant unit tests, linters, and CI checks have been verified

If 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

Resolves OpenSSF Scorecard PinnedDependenciesID Code Scanning alerts (#282, #283) in .github/workflows/bqmonitor-pr.yml without introducing any new hash lockfiles:

  • Replaces the unpinned pip install -r src/test/python/bigquery-anomaly-detection/requirements-test.txt and pip install -e src/main/python/bigquery-anomaly-detection commands in bqmonitor-pr.yml with --require-hashes --no-deps installs from the repository's existing hash-pinned lockfiles on main:
    • src/main/python/yaml-template/requirements.txt (already compiles apache-beam[dataframe,gcp,test,yaml,aws,azure] including parameterized / pyhamcrest test extras)
    • src/main/python/bigquery-anomaly-detection/requirements_all.txt (installs bqmonitor's exact pinned runtime dependencies on top)
  • Removes the now-unused 1-line unpinned python/src/test/python/bigquery-anomaly-detection/requirements-test.txt and sets PYTHONPATH=src/main/python/bigquery-anomaly-detection/src when running python -m unittest discover.
  • Because both lockfiles already exist on main, they stay automatically updated by weekly update-python-deps.yml runs and Apache Beam release bumps with zero extra maintenance.

Verification

  • BigQuery Anomaly Detection PR (python_unit_tests, java_build, java_integration_tests) workflow passes in CI.

@derrickaw derrickaw added cleanup python Pull requests that update Python code ignore-for-release github_actions Pull requests that update GitHub Actions code labels Nov 20, 2026
@derrickaw

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the test dependencies in requirements-test.txt for the bigquery-anomaly-detection project, replacing apache-beam[gcp,test] with parameterized==0.9.0 along with its SHA-256 hashes. There are no review comments, and I have no feedback to provide.

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.88%. Comparing base (d187e32) to head (9a9ea08).
⚠️ Report is 4 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (d187e32) and HEAD (9a9ea08). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (d187e32) HEAD (9a9ea08)
5 1
Additional details and impacted files
@@              Coverage Diff              @@
##               main    #4602       +/-   ##
=============================================
- Coverage     59.74%   37.88%   -21.87%     
+ Complexity     8383      521     -7862     
=============================================
  Files          1123      197      -926     
  Lines         72705    12001    -60704     
  Branches       8842     1228     -7614     
=============================================
- Hits          43441     4547    -38894     
+ Misses        26363     7080    -19283     
+ Partials       2901      374     -2527     
Components Coverage Δ
spanner-templates ∅ <ø> (∅)
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration ∅ <ø> (∅)
spanner-live-reverse-replication ∅ <ø> (∅)
spanner-bulk-migration ∅ <ø> (∅)
gcs-spanner-dv ∅ <ø> (∅)
see 951 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@derrickaw

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@derrickaw derrickaw added ready-for-human Draft PR checks passed and ready for human review and removed ready-for-human Draft PR checks passed and ready for human review labels Nov 21, 2026
@derrickaw

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the 'apache-beam[gcp,test]' dependency. There are no review comments, and I have no feedback to provide.

@derrickaw derrickaw added ready-for-human Draft PR checks passed and ready for human review and removed ready-for-human Draft PR checks passed and ready for human review labels Nov 22, 2026
@derrickaw

Copy link
Copy Markdown
Contributor Author

Closing for now to avoid over-installing extra template container dependencies in CI; keeping focus on surgical workflow permission and action pinning fixes.

@derrickaw derrickaw closed this Nov 22, 2026
@derrickaw
derrickaw deleted the codescan/actions-bqmonitor-pr-pinned-pip branch November 22, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup github_actions Pull requests that update GitHub Actions code ignore-for-release python Pull requests that update Python code ready-for-human Draft PR checks passed and ready for human review size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant