-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
run java tests on safari #16754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
run java tests on safari #16754
Conversation
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
19e1569 to
23601a7
Compare
| name: Safari Tests | ||
| uses: ./.github/workflows/bazel.yml | ||
| with: | ||
| name: Safari Tests | ||
| os: macos | ||
| cache-key: java-safari-tests | ||
| java-version: 17 | ||
| run: > | ||
| bazel test | ||
| --flaky_test_attempts 3 | ||
| --test_tag_filters=safari | ||
| //java/test/... |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 days ago
Generally, to fix this kind of issue you explicitly define a permissions: block either at the top level of the workflow (applying to all jobs that don’t override it) or inside each job. For test-only workflows that just need to check out code and run Bazel, the minimal safe choice is typically permissions: contents: read, which allows reading the repository contents while preventing unintended write operations with the GITHUB_TOKEN.
For this specific workflow, the simplest, non‑intrusive fix is to add a single root‑level permissions: block, just after the on: section and before jobs:. This will apply to all jobs (browser-tests-windows, browser-tests-macos, remote-tests, and safari-tests) and address the CodeQL warning at line 78, since that warning is about the absence of any explicit permissions for the job. There is no evidence in the snippet that any job needs write access (no step uses the token to modify issues, PRs, etc.), so setting contents: read is appropriate and should not break existing functionality.
Concretely:
-
Edit
.github/workflows/ci-java.yml. -
Insert:
permissions: contents: read
on its own indentation level after the
on:block (after line 5 and a blank line), shifting the existingjobs:definition down. No imports or other definitions are required.
-
Copy modified lines R7-R9
| @@ -4,6 +4,9 @@ | ||
| workflow_call: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| browser-tests-windows: | ||
| name: Browser Tests |
23601a7 to
2399859
Compare
Should figure out what is and isn't supported with Safari in Java.
Lots to debug, so this is in draft.