Skip to content

Add read-only permissions in dask_runner_tests.yml - #41656

Merged
Amar3tto merged 1 commit into
masterfrom
codescan/gha-dask-runner-tests-permissions
Nov 25, 2026
Merged

Amar3tto merged 1 commit into
masterfrom
codescan/gha-dask-runner-tests-permissions

Conversation

@derrickaw

@derrickaw derrickaw commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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 / zizmor) on master without altering intended public API or workflow semantics
  • The fix is minimal, idiomatic, and avoids masking underlying defects (false positives and noisy rules are dismissed or scoped via config rather than code churn)
  • Relevant unit tests, linters, Gemini review feedback, and live workflow_dispatch runs (for workflow/action changes) have been verified

Initiative Progress (as of 2026-11-24 22:54 UTC): 10 PRs merged so far, with ~38 more PRs needed to be merged to close out all actionable Code Scanning findings (with #41637 disabling Note-level zizmor/self-repository warnings).

Code Scanning Remediation Context (End Goal, Scope & Impact)

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 all 5 open Code Scanning findings (CodeQL actions/missing-workflow-permissions and zizmor/excessive-permissions — alerts #13, #15, #1518–#1520) in .github/workflows/dask_runner_tests.yml:

  • Add explicit top-level permissions: contents: read so neither build_python_sdk_source nor python_unit_tests inherits default repository write scopes (actions/upload-artifact@v7 uses the Actions runtime token and codecov/codecov-action@v7 authenticates via CODECOV_TOKEN).

Verification

  • Sample workflow_dispatch run of dask_runner_tests.yml on branch codescan/gha-dask-runner-tests-permissions: https://github.com/apache/beam/actions/runs/45502030784 (success across Build python source distribution and Python Unit Tests on ubuntu-latest, macos-latest, and windows-latest)
  • zizmor --config .github/zizmor.yml .github/workflows/dask_runner_tests.yml (0 findings), ./gradlew :beam-test-gha:preCommit, and CodeQL

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot added build size/xs XS: <10 lines changed labels Nov 24, 2026

@github-actions github-actions 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.

📋 Review Summary

This PR adds an explicit top-level permissions: contents: read configuration to .github/workflows/dask_runner_tests.yml to enforce least-privilege GITHUB_TOKEN access and address CodeQL/zizmor code scanning alerts. Both jobs (build_python_sdk_source and python_unit_tests) only check out the repository, execute tests, upload build/test artifacts via the Actions runtime token, and report coverage using CODECOV_TOKEN, so contents: read is sufficient and safe.

🔍 General Feedback

  • Clean, minimal security hardening change that aligns with GitHub Actions best practices and other workflow permission configurations across the repository.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.19%. Comparing base (f223f42) to head (720d292).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master   #41656       +/-   ##
=============================================
- Coverage     58.73%   37.19%   -21.54%     
  Complexity     2315     2315               
=============================================
  Files          1135      646      -489     
  Lines        170483    86254    -84229     
  Branches       1499     1499               
=============================================
- Hits         100133    32083    -68050     
+ Misses        67803    51624    -16179     
  Partials       2547     2547               
Flag Coverage Δ
python 53.54% <ø> (-27.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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 derrickaw added ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review and removed ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review labels Nov 24, 2026
@derrickaw
derrickaw marked this pull request as ready for review November 25, 2026 13:20
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @Amar3tto for label build.
Backup reviewer: Abacn (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@Amar3tto
Amar3tto merged commit a851dc5 into master Nov 25, 2026
17 of 18 checks passed
@derrickaw
derrickaw deleted the codescan/gha-dask-runner-tests-permissions branch November 25, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants