Skip to content

Conversation

linghengqian
Copy link
Owner

@linghengqian linghengqian commented Aug 12, 2025

  • Test older versions of GraalVM CE on Windows Server 2025. Let's see what the problem is with the older version of GraalVM CE.

Comment on lines 84 to 115
name: NativeTest - ${{ matrix.graalvm-distribution }} for JDK ${{ matrix.java }} on ${{ matrix.os }}
if: github.repository == 'linghengqian/hive-server2-jdbc-driver'
strategy:
matrix:
java: [ '24.2.2' ]
os: [ 'windows-2025' ]
graalvm-distribution: [ 'mandrel' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rancher Desktop without GUI on Windows Server
run: |
./subprojects/doc/helpful_tools/uninstall-docker-engine-for-wcow.ps1
winget install --id jazzdelightsme.WingetPathUpdater --source winget
winget install --id SUSE.RancherDesktop --source winget
rdctl start --application.start-in-background --container-engine.name=moby --kubernetes.enabled=false
./subprojects/doc/helpful_tools/wait-for-rancher-desktop-backend.ps1
"PATH=$env:PATH" >> $env:GITHUB_ENV
- uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.graalvm-distribution }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
native-image-job-reports: 'true'
- name: NativeTest on ${{ matrix.os }}
run: ./mvnw -PnativeTestInJava23+ clean test
native-test-ci-on-liberica:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

To fix this issue, add an explicit permissions block to your workflow so that all jobs limit their access to the GITHUB_TOKEN according to the principle of least privilege. Since none of the jobs in your workflow appear to require write permissions (they run code checks and tests, do checkouts, and set up environments), the minimal recommended setting is contents: read. This can be added at the top level (applies to all jobs unless overridden), or individually per job if some jobs need additional permissions. The fix is best performed by editing .github/workflows/test.yml by adding the following block after the name section and before the on: section:

permissions:
  contents: read

No other changes or imports are necessary.

Suggested changeset 1
.github/workflows/test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -13,6 +13,8 @@
 # limitations under the License.
 
 name: Test
+permissions:
+  contents: read
 on:
   pull_request:
     branches:
EOF
@@ -13,6 +13,8 @@
# limitations under the License.

name: Test
permissions:
contents: read
on:
pull_request:
branches:
Copilot is powered by AI and may make mistakes. Always verify output.
@linghengqian linghengqian force-pushed the test-windows branch 2 times, most recently from 47c9806 to 0d2a65e Compare August 14, 2025 13:03
Comment on lines 116 to 145
os: [ 'windows-2025' ]
graalvm-distribution: [ 'liberica' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Rancher Desktop without GUI on Windows Server
run: |
iwr -Uri "https://raw.githubusercontent.com/microsoft/Windows-Containers/refs/heads/Main/helpful_tools/Install-DockerCE/uninstall-docker-ce.ps1" -OutFile uninstall-docker-ce.ps1
.\uninstall-docker-ce.ps1 -Force
ri .\uninstall-docker-ce.ps1
winget install --id jazzdelightsme.WingetPathUpdater --source winget
winget install --id SUSE.RancherDesktop --source winget
rdctl start --application.start-in-background --container-engine.name=moby --kubernetes.enabled=false
./subprojects/doc/helpful_tools/wait-for-rancher-desktop-backend.ps1
"PATH=$env:PATH" >> $env:GITHUB_ENV
- uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.graalvm-distribution }}
github-token: ${{ secrets.GITHUB_TOKEN }}
cache: 'maven'
native-image-job-reports: 'true'
- name: NativeTest on ${{ matrix.os }}
run: ./mvnw -PnativeTestInJava23+ clean test
native-test-ci-on-oracle-graalvm:
name: NativeTest - ${{ matrix.graalvm-distribution }} for JDK ${{ matrix.java }} on ${{ matrix.os }}
if: github.repository == 'linghengqian/hive-server2-jdbc-driver'
strategy:
matrix:
java: [ '24.0.2' ]

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

To fix the issue, you should add an explicit permissions: block to your workflow or directly to the job shown (starting at line 116 for "native-test-ci-on-liberica"). Since most CI/test jobs typically require only the ability to read repository contents (not write), you can add a minimal permissions: entry specifying contents: read either at the top (root) level or for each job individually.

  • General fix: Add permissions: at the root of the workflow (above jobs:) if all jobs require the same reduced permissions, or add an explicit block to each job if different jobs need different permissions.
  • Best approach here: Insert the following near line 15 (above or below name: Test):
    permissions:
      contents: read
    This applies to all jobs unless a job sets its own permissions.
  • If only specific jobs need the block: Add it inside the relevant job.
  • For the error specifically highlighted at line 116, you can add:
        permissions:
          contents: read
    directly after the name: field in the native-test-ci-on-liberica job.

Files/regions to change:
You can add a root-level permissions: block, or a per-job block inside the affected job (native-test-ci-on-liberica). Prefer root-level unless exceptions are needed.

Methods/imports/definitions:
No dependencies or imports required; purely a YAML field addition.


Suggested changeset 1
.github/workflows/test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -13,6 +13,8 @@
 # limitations under the License.
 
 name: Test
+permissions:
+  contents: read
 on:
   pull_request:
     branches:
EOF
@@ -13,6 +13,8 @@
# limitations under the License.

name: Test
permissions:
contents: read
on:
pull_request:
branches:
Copilot is powered by AI and may make mistakes. Always verify output.
@linghengqian linghengqian force-pushed the test-windows branch 2 times, most recently from 168642c to 3a259e9 Compare September 19, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant