Skip to content

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

Draft
derrickaw wants to merge 1 commit into
masterfrom
codescan/gha-dask-runner-tests-permissions
Draft

derrickaw wants to merge 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 1 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 the ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build cleanup ready-for-human Draft PR with all checks passing and all review comments resolved, ready for human review size/xs XS: <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant