Copilot commented on code in PR #7154:
URL: https://github.com/apache/incubator-kie/pull/7154#discussion_r4229442110
##########
.github/workflows/ci.yaml:
##########
@@ -42,23 +42,19 @@ jobs:
build:
if: github.event.action != 'closed'
- name: '${{ matrix.os }}, Java ${{ matrix.java }}'
+ name: '${{ matrix.os }}, Java 21'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
- java: [17, 21]
+ java: [21]
# macos and windows temporarily excluded
# due to Docker-dependent tests introduced by the kogito-runtimes merge
# failing on non-Linux runners. Re-enable once resolved.
exclude:
- - os: windows-latest
- java: 17
- os: windows-latest
java: 21
- - os: macos-latest
- java: 17
- os: macos-latest
java: 21
Review Comment:
Now that the workflow only runs Java 21 and both macOS/windows are fully
excluded, the matrix is effectively a single configuration (ubuntu-latest +
21). Keeping the multi-OS matrix + exclude list adds redundant configuration to
maintain. Consider narrowing the matrix to only the active OS (e.g., `os:
[ubuntu-latest]`) and, if Java is fixed, removing the `java` axis entirely (or
using `matrix.java` consistently in the job name) to reduce future churn when
re-enabling other OSes.
##########
.github/workflows/ci_java17_compat.yml:
##########
@@ -0,0 +1,178 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "CI :: Build (Java 17)"
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+ branches: [main]
+ paths-ignore:
+ - 'LICENSE'
+ - '**/.gitignore'
+ - '**.md'
+ - '**.adoc'
+ - '*.txt'
+ - 'docsimg/**'
+ - '.ci/jenkins/**'
+ push:
+ branches: [main]
Review Comment:
The PR trigger ignores docs-only changes, but the `push` trigger does not.
This means docs-only merges to `main` will still run the full Java 17 build,
which can add significant CI load/queue time. If the intent is to skip non-code
changes on `main` as well, mirror the same `paths-ignore` filters under `push`.
##########
.github/workflows/ci_java17_compat.yml:
##########
@@ -0,0 +1,178 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "CI :: Build (Java 17)"
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+ branches: [main]
+ paths-ignore:
+ - 'LICENSE'
+ - '**/.gitignore'
+ - '**.md'
+ - '**.adoc'
+ - '*.txt'
+ - 'docsimg/**'
+ - '.ci/jenkins/**'
+ push:
+ branches: [main]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+jobs:
+
+ build:
+ name: 'Java 17'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: 'SETUP :: Set paths for temporary files'
+ shell: bash
+ run: |
+ echo "CHANGED_FILES_FILE=${{ runner.temp }}/changed-files.txt" >>
"$GITHUB_ENV"
+ echo "MAVEN_PL_AFFECTED_FILE=${{ runner.temp
}}/maven-pl-affected.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_UPSTREAM_FILE=${{ runner.temp
}}/maven-pl-upstream.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_CHANGED_FILE=${{ runner.temp }}/maven-pl-changed.txt"
>> "$GITHUB_ENV"
+ echo "DEP_GRAPH_EXTRACTOR__OUTPUT_FILE=${{ runner.temp
}}/dep-graph.tsv" >> "$GITHUB_ENV"
+ touch "${{ runner.temp }}/changed-files.txt"
+ touch "${{ runner.temp }}/maven-pl-affected.txt"
+ touch "${{ runner.temp }}/maven-pl-upstream.txt"
+ touch "${{ runner.temp }}/maven-pl-changed.txt"
+
+ - name: 'SETUP :: Free disk space (Ubuntu)'
+ shell: bash
+ run: |
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
+ df -h
+
+ - name: "SETUP :: Checkout to load local actions"
+ uses: actions/checkout@v7
+
+ - name: "SETUP :: Checkout @ Simulated squashed-merge if PR, else
checkout current commit"
+ id: checkout_pr
+ uses: ./.github/actions/checkout-pr
+ with:
+ ref: ${{ github.base_ref }}
+
+ - uses: actions/setup-java@v6
+ name: 'SETUP :: Java 17'
+ with:
+ java-version: 17
+ distribution: temurin
+ cache: maven
+
+ - name: 'SETUP :: Install JBang'
+ shell: bash
+ run: |
+ curl -sL
https://github.com/jbangdev/jbang/releases/download/v0.138.0/jbang-0.138.0.zip
-o jbang.zip
+ echo
"3c9fb9ac5823ae5ab9d136dec08b896e2a0f6f6b313689b21f43c511b7c34b85 jbang.zip" |
sha256sum -c -
+ unzip -q jbang.zip
+ echo "${{ github.workspace }}/jbang-0.138.0/bin" >> $GITHUB_PATH
+
+ - name: 'SETUP :: Block apache.snapshots Maven repository'
+ shell: bash
+ run: |
+ mkdir -p "$HOME/.m2"
+ cat > "$HOME/.m2/settings.xml" <<'EOF'
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
https://maven.apache.org/xsd/settings-1.2.0.xsd">
+ <mirrors>
+ <mirror>
+ <id>block-apache-snapshots</id>
+
<mirrorOf>apache.snapshots,apache-snapshot-repository</mirrorOf>
+ <url>https://repository.apache.org/snapshots/</url>
+ <blocked>true</blocked>
+ </mirror>
+ </mirrors>
+ </settings>
+ EOF
+
+ - name: 'SETUP :: Collect changed files'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ env:
+ BASE_REF: origin/${{ github.base_ref }}
+ run: |
+ git diff --name-only "${BASE_REF}...HEAD" > "$CHANGED_FILES_FILE"
+ echo "Changed files:"
+ cat "$CHANGED_FILES_FILE"
+
+ - name: 'SETUP :: Compute build scopes'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ jbang script/ci/CiComputeBuildScopes.java \
+ "$CHANGED_FILES_FILE" \
+ "$MAVEN_PL_UPSTREAM_FILE" \
+ "$MAVEN_PL_AFFECTED_FILE" \
+ "$MAVEN_PL_CHANGED_FILE"
+
+ - name: "PR CHECK :: BUILD :: Upstream modules${{ github.event_name ==
'push' && ' (skipped)' || '' }}"
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ pl=$(paste -sd, "$MAVEN_PL_UPSTREAM_FILE")
+ [ -z "$pl" ] && echo "No upstream modules. Skipping." && exit 0
+ mvn -T 1C --batch-mode --no-transfer-progress -fae -DskipTests
-DskipITs -Denforcer.skip=true -Dcheckstyle.skip=true -Dformatter.skip=true
-Darchunit.skip=true -Dsurefire.redirectTestOutputToFile=true -pl "$pl" install
+
+ - name: "PR CHECK :: BUILD :: Changed and affected modules${{
github.event_name == 'push' && ' (skipped)' || '' }}"
+ if: github.event_name == 'pull_request'
Review Comment:
These step names append a conditional ' (skipped)' suffix, but each step is
already gated by an `if:` that prevents it from running on the opposite event.
The conditional suffix therefore never appears in practice and adds
noise/complexity to the workflow. Consider simplifying the names by removing
the `${{ ... }}` suffixes and relying on the step-level `if:` for clarity.
##########
.github/workflows/ci_java17_compat.yml:
##########
@@ -0,0 +1,178 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "CI :: Build (Java 17)"
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+ branches: [main]
+ paths-ignore:
+ - 'LICENSE'
+ - '**/.gitignore'
+ - '**.md'
+ - '**.adoc'
+ - '*.txt'
+ - 'docsimg/**'
+ - '.ci/jenkins/**'
+ push:
+ branches: [main]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+jobs:
+
+ build:
+ name: 'Java 17'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: 'SETUP :: Set paths for temporary files'
+ shell: bash
+ run: |
+ echo "CHANGED_FILES_FILE=${{ runner.temp }}/changed-files.txt" >>
"$GITHUB_ENV"
+ echo "MAVEN_PL_AFFECTED_FILE=${{ runner.temp
}}/maven-pl-affected.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_UPSTREAM_FILE=${{ runner.temp
}}/maven-pl-upstream.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_CHANGED_FILE=${{ runner.temp }}/maven-pl-changed.txt"
>> "$GITHUB_ENV"
+ echo "DEP_GRAPH_EXTRACTOR__OUTPUT_FILE=${{ runner.temp
}}/dep-graph.tsv" >> "$GITHUB_ENV"
+ touch "${{ runner.temp }}/changed-files.txt"
+ touch "${{ runner.temp }}/maven-pl-affected.txt"
+ touch "${{ runner.temp }}/maven-pl-upstream.txt"
+ touch "${{ runner.temp }}/maven-pl-changed.txt"
+
+ - name: 'SETUP :: Free disk space (Ubuntu)'
+ shell: bash
+ run: |
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
+ df -h
+
+ - name: "SETUP :: Checkout to load local actions"
+ uses: actions/checkout@v7
+
+ - name: "SETUP :: Checkout @ Simulated squashed-merge if PR, else
checkout current commit"
+ id: checkout_pr
+ uses: ./.github/actions/checkout-pr
+ with:
+ ref: ${{ github.base_ref }}
+
+ - uses: actions/setup-java@v6
+ name: 'SETUP :: Java 17'
+ with:
+ java-version: 17
+ distribution: temurin
+ cache: maven
+
+ - name: 'SETUP :: Install JBang'
+ shell: bash
+ run: |
+ curl -sL
https://github.com/jbangdev/jbang/releases/download/v0.138.0/jbang-0.138.0.zip
-o jbang.zip
+ echo
"3c9fb9ac5823ae5ab9d136dec08b896e2a0f6f6b313689b21f43c511b7c34b85 jbang.zip" |
sha256sum -c -
+ unzip -q jbang.zip
+ echo "${{ github.workspace }}/jbang-0.138.0/bin" >> $GITHUB_PATH
+
+ - name: 'SETUP :: Block apache.snapshots Maven repository'
+ shell: bash
+ run: |
+ mkdir -p "$HOME/.m2"
+ cat > "$HOME/.m2/settings.xml" <<'EOF'
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
https://maven.apache.org/xsd/settings-1.2.0.xsd">
+ <mirrors>
+ <mirror>
+ <id>block-apache-snapshots</id>
+
<mirrorOf>apache.snapshots,apache-snapshot-repository</mirrorOf>
+ <url>https://repository.apache.org/snapshots/</url>
+ <blocked>true</blocked>
+ </mirror>
+ </mirrors>
+ </settings>
+ EOF
+
+ - name: 'SETUP :: Collect changed files'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ env:
+ BASE_REF: origin/${{ github.base_ref }}
+ run: |
+ git diff --name-only "${BASE_REF}...HEAD" > "$CHANGED_FILES_FILE"
+ echo "Changed files:"
+ cat "$CHANGED_FILES_FILE"
+
+ - name: 'SETUP :: Compute build scopes'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ jbang script/ci/CiComputeBuildScopes.java \
+ "$CHANGED_FILES_FILE" \
+ "$MAVEN_PL_UPSTREAM_FILE" \
+ "$MAVEN_PL_AFFECTED_FILE" \
+ "$MAVEN_PL_CHANGED_FILE"
+
+ - name: "PR CHECK :: BUILD :: Upstream modules${{ github.event_name ==
'push' && ' (skipped)' || '' }}"
+ if: github.event_name == 'pull_request'
Review Comment:
These step names append a conditional ' (skipped)' suffix, but each step is
already gated by an `if:` that prevents it from running on the opposite event.
The conditional suffix therefore never appears in practice and adds
noise/complexity to the workflow. Consider simplifying the names by removing
the `${{ ... }}` suffixes and relying on the step-level `if:` for clarity.
##########
.github/workflows/ci_java17_compat.yml:
##########
@@ -0,0 +1,178 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: "CI :: Build (Java 17)"
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+ branches: [main]
+ paths-ignore:
+ - 'LICENSE'
+ - '**/.gitignore'
+ - '**.md'
+ - '**.adoc'
+ - '*.txt'
+ - 'docsimg/**'
+ - '.ci/jenkins/**'
+ push:
+ branches: [main]
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number ||
github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+jobs:
+
+ build:
+ name: 'Java 17'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: 'SETUP :: Set paths for temporary files'
+ shell: bash
+ run: |
+ echo "CHANGED_FILES_FILE=${{ runner.temp }}/changed-files.txt" >>
"$GITHUB_ENV"
+ echo "MAVEN_PL_AFFECTED_FILE=${{ runner.temp
}}/maven-pl-affected.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_UPSTREAM_FILE=${{ runner.temp
}}/maven-pl-upstream.txt" >> "$GITHUB_ENV"
+ echo "MAVEN_PL_CHANGED_FILE=${{ runner.temp }}/maven-pl-changed.txt"
>> "$GITHUB_ENV"
+ echo "DEP_GRAPH_EXTRACTOR__OUTPUT_FILE=${{ runner.temp
}}/dep-graph.tsv" >> "$GITHUB_ENV"
+ touch "${{ runner.temp }}/changed-files.txt"
+ touch "${{ runner.temp }}/maven-pl-affected.txt"
+ touch "${{ runner.temp }}/maven-pl-upstream.txt"
+ touch "${{ runner.temp }}/maven-pl-changed.txt"
+
+ - name: 'SETUP :: Free disk space (Ubuntu)'
+ shell: bash
+ run: |
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
+ df -h
+
+ - name: "SETUP :: Checkout to load local actions"
+ uses: actions/checkout@v7
+
+ - name: "SETUP :: Checkout @ Simulated squashed-merge if PR, else
checkout current commit"
+ id: checkout_pr
+ uses: ./.github/actions/checkout-pr
+ with:
+ ref: ${{ github.base_ref }}
+
+ - uses: actions/setup-java@v6
+ name: 'SETUP :: Java 17'
+ with:
+ java-version: 17
+ distribution: temurin
+ cache: maven
+
+ - name: 'SETUP :: Install JBang'
+ shell: bash
+ run: |
+ curl -sL
https://github.com/jbangdev/jbang/releases/download/v0.138.0/jbang-0.138.0.zip
-o jbang.zip
+ echo
"3c9fb9ac5823ae5ab9d136dec08b896e2a0f6f6b313689b21f43c511b7c34b85 jbang.zip" |
sha256sum -c -
+ unzip -q jbang.zip
+ echo "${{ github.workspace }}/jbang-0.138.0/bin" >> $GITHUB_PATH
+
+ - name: 'SETUP :: Block apache.snapshots Maven repository'
+ shell: bash
+ run: |
+ mkdir -p "$HOME/.m2"
+ cat > "$HOME/.m2/settings.xml" <<'EOF'
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0
https://maven.apache.org/xsd/settings-1.2.0.xsd">
+ <mirrors>
+ <mirror>
+ <id>block-apache-snapshots</id>
+
<mirrorOf>apache.snapshots,apache-snapshot-repository</mirrorOf>
+ <url>https://repository.apache.org/snapshots/</url>
+ <blocked>true</blocked>
+ </mirror>
+ </mirrors>
+ </settings>
+ EOF
+
+ - name: 'SETUP :: Collect changed files'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ env:
+ BASE_REF: origin/${{ github.base_ref }}
+ run: |
+ git diff --name-only "${BASE_REF}...HEAD" > "$CHANGED_FILES_FILE"
+ echo "Changed files:"
+ cat "$CHANGED_FILES_FILE"
+
+ - name: 'SETUP :: Compute build scopes'
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ jbang script/ci/CiComputeBuildScopes.java \
+ "$CHANGED_FILES_FILE" \
+ "$MAVEN_PL_UPSTREAM_FILE" \
+ "$MAVEN_PL_AFFECTED_FILE" \
+ "$MAVEN_PL_CHANGED_FILE"
+
+ - name: "PR CHECK :: BUILD :: Upstream modules${{ github.event_name ==
'push' && ' (skipped)' || '' }}"
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ pl=$(paste -sd, "$MAVEN_PL_UPSTREAM_FILE")
+ [ -z "$pl" ] && echo "No upstream modules. Skipping." && exit 0
+ mvn -T 1C --batch-mode --no-transfer-progress -fae -DskipTests
-DskipITs -Denforcer.skip=true -Dcheckstyle.skip=true -Dformatter.skip=true
-Darchunit.skip=true -Dsurefire.redirectTestOutputToFile=true -pl "$pl" install
+
+ - name: "PR CHECK :: BUILD :: Changed and affected modules${{
github.event_name == 'push' && ' (skipped)' || '' }}"
+ if: github.event_name == 'pull_request'
+ shell: bash
+ run: |
+ pl=$(paste -sd, "$MAVEN_PL_AFFECTED_FILE")
+ [ -z "$pl" ] && echo "No affected modules. Skipping." && exit 0
+ mvn --batch-mode --no-transfer-progress -fae
-Dsurefire.redirectTestOutputToFile=true -Dfull -Dreproducible -pl "$pl" install
+
+ - name: "CI :: BUILD :: Full${{ github.event_name == 'pull_request' && '
(skipped)' || '' }}"
+ if: github.event_name == 'push'
Review Comment:
These step names append a conditional ' (skipped)' suffix, but each step is
already gated by an `if:` that prevents it from running on the opposite event.
The conditional suffix therefore never appears in practice and adds
noise/complexity to the workflow. Consider simplifying the names by removing
the `${{ ... }}` suffixes and relying on the step-level `if:` for clarity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]