gnodet-bot commented on code in PR #26330:
URL: https://github.com/apache/camel/pull/26330#discussion_r4060292008


##########
.github/workflows/dep-check.yml:
##########
@@ -0,0 +1,94 @@
+#
+# 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: 'Dependency Analysis'
+
+on:
+  pull_request:
+    branches:
+      - main
+    paths-ignore:
+      - .claude-plugin/**
+      - .idea/**
+      - .github/**
+      - .oss-ai-helper-rules/**
+      - AGENTS.md
+      - README.md
+      - SECURITY.md
+      - Jenkinsfile
+      - Jenkinsfile.*
+      - NOTICE.txt
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  dep-check:
+    if: github.repository == 'apache/camel'
+    name: Dependency Analysis (non-blocking)
+    runs-on: ubuntu-latest
+    continue-on-error: true
+    steps:
+      - name: Checkout
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+          fetch-depth: 1
+
+      - name: Set up JDK 21
+        uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # 
v6.0.0
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+          cache: 'maven'
+
+      - name: Compile (test-compile for accurate test-scope analysis)
+        run: |
+          # camel-spring-xml is excluded: it unpacks SNAPSHOT source JARs 
(camel-api:sources, etc.)
+          # during process-resources, which are not available in a clean CI 
checkout without a
+          # prior mvn install. The XSD it generates is pre-committed, so 
skipping it here is safe.
+          # camel-test-spring-junit6 is excluded: it has a compile dependency 
on camel-spring-xml,
+          # which is not available in a clean checkout without a prior mvn 
install.
+          # camel-spring-main is excluded: it has a test dependency on 
camel-test-spring-junit6,
+          # which is excluded above and therefore not available in a clean 
checkout.
+          # camel-maven-plugin, catalog/camel-allcomponents, coverage are 
excluded: they have a
+          # compile dependency on camel-spring-main, which is excluded above.
+          # camel-hazelcast, camel-mail, camel-consul, camel-zookeeper are 
excluded: they have a
+          # test dependency on camel-spring-main, which is not resolvable in a 
clean checkout.
+          mvn test-compile -Pdep-check -Dlicense.skip -Dquickly \
+            --pl 
'!components/camel-spring-parent/camel-spring-xml,!components/camel-test/camel-test-spring-junit6,!components/camel-spring-parent/camel-spring-main,!tooling/maven/camel-maven-plugin,!catalog/camel-allcomponents,!coverage,!components/camel-hazelcast,!components/camel-mail,!components/camel-consul,!components/camel-zookeeper'
 \
+            --no-transfer-progress --batch-mode -q
+
+      - name: Run dependency analysis
+        run: |
+          mvn eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies \
+            -Pdep-check -Dlicense.skip \
+            --pl 
'!components/camel-spring-parent/camel-spring-xml,!components/camel-test/camel-test-spring-junit6,!components/camel-spring-parent/camel-spring-main,!tooling/maven/camel-maven-plugin,!catalog/camel-allcomponents,!coverage,!components/camel-hazelcast,!components/camel-mail,!components/camel-consul,!components/camel-zookeeper'
 \
+            --no-transfer-progress --batch-mode \
+            2>&1 | tee dep-check-output.txt
+
+      - name: Upload dependency analysis report

Review Comment:
   💡 **Nit (carry-over from previous review, still open) — version hardcoded in 
3 locations:** `pilot-plugin:0.4.0` appears here in the workflow, in `pom.xml` 
`<pluginManagement>` (line 172 of the pom diff), and 4× in `building.adoc`. 
These must be updated independently on each pilot release since the 
fully-qualified `groupId:artifactId:version:goal` form bypasses 
pluginManagement resolution.
   
   Consider extracting to a root-pom property 
(`<pilot.plugin.version>0.4.0</pilot.plugin.version>`) and referencing it as 
`-D` in the workflow, or at minimum add a comment pointing to the other two 
locations.



##########
.github/workflows/dep-check.yml:
##########
@@ -0,0 +1,94 @@
+#
+# 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: 'Dependency Analysis'
+
+on:
+  pull_request:
+    branches:
+      - main
+    paths-ignore:
+      - .claude-plugin/**
+      - .idea/**
+      - .github/**
+      - .oss-ai-helper-rules/**
+      - AGENTS.md
+      - README.md
+      - SECURITY.md
+      - Jenkinsfile
+      - Jenkinsfile.*
+      - NOTICE.txt
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  dep-check:
+    if: github.repository == 'apache/camel'
+    name: Dependency Analysis (non-blocking)
+    runs-on: ubuntu-latest
+    continue-on-error: true
+    steps:
+      - name: Checkout
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+          fetch-depth: 1
+
+      - name: Set up JDK 21
+        uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # 
v6.0.0
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+          cache: 'maven'
+
+      - name: Compile (test-compile for accurate test-scope analysis)
+        run: |
+          # camel-spring-xml is excluded: it unpacks SNAPSHOT source JARs 
(camel-api:sources, etc.)
+          # during process-resources, which are not available in a clean CI 
checkout without a
+          # prior mvn install. The XSD it generates is pre-committed, so 
skipping it here is safe.
+          # camel-test-spring-junit6 is excluded: it has a compile dependency 
on camel-spring-xml,
+          # which is not available in a clean checkout without a prior mvn 
install.
+          # camel-spring-main is excluded: it has a test dependency on 
camel-test-spring-junit6,
+          # which is excluded above and therefore not available in a clean 
checkout.
+          # camel-maven-plugin, catalog/camel-allcomponents, coverage are 
excluded: they have a
+          # compile dependency on camel-spring-main, which is excluded above.
+          # camel-hazelcast, camel-mail, camel-consul, camel-zookeeper are 
excluded: they have a
+          # test dependency on camel-spring-main, which is not resolvable in a 
clean checkout.
+          mvn test-compile -Pdep-check -Dlicense.skip -Dquickly \
+            --pl 
'!components/camel-spring-parent/camel-spring-xml,!components/camel-test/camel-test-spring-junit6,!components/camel-spring-parent/camel-spring-main,!tooling/maven/camel-maven-plugin,!catalog/camel-allcomponents,!coverage,!components/camel-hazelcast,!components/camel-mail,!components/camel-consul,!components/camel-zookeeper'
 \
+            --no-transfer-progress --batch-mode -q
+
+      - name: Run dependency analysis
+        run: |
+          mvn eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies \
+            -Pdep-check -Dlicense.skip \
+            --pl 
'!components/camel-spring-parent/camel-spring-xml,!components/camel-test/camel-test-spring-junit6,!components/camel-spring-parent/camel-spring-main,!tooling/maven/camel-maven-plugin,!catalog/camel-allcomponents,!coverage,!components/camel-hazelcast,!components/camel-mail,!components/camel-consul,!components/camel-zookeeper'
 \
+            --no-transfer-progress --batch-mode \
+            2>&1 | tee dep-check-output.txt
+
+      - name: Upload dependency analysis report
+        if: always()
+        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a 
# v7.0.1

Review Comment:
   💡 **Nit — exclusion list duplicated in two steps:** The `--pl '!...'` string 
appears verbatim in both the `test-compile` step (line 83) and the 
`pilot:dependencies` step (line 90). If they drift — e.g. a new exclusion is 
added to one but not the other — the analysis step would silently attempt to 
analyze modules that failed to compile, producing an empty/misleading result.
   
   Extract to a job-level env var so both steps share the same source of truth:
   
   ```suggestion
             mvn eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies \
               -Pdep-check -Dlicense.skip \
               --pl 
'!components/camel-spring-parent/camel-spring-xml,!components/camel-test/camel-test-spring-junit6,!components/camel-spring-parent/camel-spring-main,!tooling/maven/camel-maven-plugin,!catalog/camel-allcomponents,!coverage,!components/camel-hazelcast,!components/camel-mail,!components/camel-consul,!components/camel-zookeeper'
 \
               --no-transfer-progress --batch-mode \
               2>&1 | tee dep-check-output.txt
   ```
   
   (The fix is to extract the list to a shared env var, e.g. at job level — the 
suggestion above is a placeholder since GitHub doesn't support multi-step 
refactoring suggestions. The actual change would be adding `env: 
EXCLUDED_MODULES: '...'` at the `dep-check:` job level and using 
`$EXCLUDED_MODULES` in both steps.)



-- 
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]

Reply via email to