Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/__build-mode-autobuild.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions pr-checks/checks/build-mode-autobuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ description: "An end-to-end integration test of a Java repository built using 'b
operatingSystems: ["ubuntu", "windows"]
versions: ["linked", "nightly-latest"]
installJava: "true"
installYq: "true"
steps:
- name: Set up Java test repo configuration
run: |
Expand All @@ -18,11 +19,6 @@ steps:
languages: java
tools: ${{ steps.prepare-test.outputs.tools-url }}

- name: Install yq
if: runner.os == 'Windows'
run: |
choco install yq -y
- name: Validate database build mode
run: |
metadata_path="$RUNNER_TEMP/customDbLocation/java/codeql-database.yml"
Expand Down
17 changes: 16 additions & 1 deletion pr-checks/sync.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

import ruamel.yaml
from ruamel.yaml.scalarstring import SingleQuotedScalarString
from ruamel.yaml.scalarstring import SingleQuotedScalarString, LiteralScalarString
import pathlib
import os

Expand Down Expand Up @@ -223,6 +223,21 @@ def writeHeader(checkStream):
}
})

installYq = is_truthy(checkSpecification.get('installYq', ''))

if installYq:
steps.append({
'name': 'Install yq',
'if': "runner.os == 'Windows'",
'env': {
'YQ_PATH': '${{ runner.temp }}/yq'
},
'run': LiteralScalarString(
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

The directory $YQ_PATH should be created before downloading the file to ensure it exists. Consider adding mkdir -p "$YQ_PATH" as the first line of the run script to be consistent with similar patterns elsewhere in the codebase (e.g., .github/workflows/__cleanup-db-cluster-dir.yml:60).

Suggested change
'run': LiteralScalarString(
'run': LiteralScalarString(
'mkdir -p "$YQ_PATH"\n'

Copilot uses AI. Check for mistakes.
'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" v4.50.1 -O "$YQ_PATH/yq.exe"\n'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" v4.50.1 -O "$YQ_PATH/yq.exe"\n'
'gh release download --repo mikefarah/yq --pattern "yq_windows_amd64.exe" "$YQ_VERSION" -O "$YQ_PATH/yq.exe"'

I kind of agree with copilot.
Let's move the version out to a variable, and add and add an explanation and a direct link to the release as a comment.

Also, the trailing \n is confusing to read. Could we do something cleaner syntactically, or is this a workflow builder limitation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's move the version out to a variable, and add and add an explanation and a direct link to the release as a comment.

Sure, I can do that.

Also, the trailing \n is confusing to read. Could we do something cleaner syntactically, or is this a workflow builder limitation?

There might be something that's cleaner syntactically in Python, but this was the sanest option I came up with since Python multi-line strings mostly led to results with weird spacing. I am open to suggestions.

'echo "$YQ_PATH" >> "$GITHUB_PATH"'
),
})

# If container initialisation steps are present in the check specification,
# make sure to execute them first.
if 'container' in checkSpecification and 'container-init-steps' in checkSpecification:
Expand Down
Loading