gnodet commented on code in PR #22247:
URL: https://github.com/apache/camel/pull/22247#discussion_r2987123974


##########
.github/workflows/pr-build-main.yml:
##########
@@ -92,61 +98,30 @@ jobs:
       - name: mvn test
         uses: ./.github/actions/incremental-build
         with:
-          mode: test
           pr-id: ${{ github.event.number || inputs.pr_number }}
           github-token: ${{ secrets.GITHUB_TOKEN }}
           skip-mvnd-install: 'true'
           artifact-upload-suffix: java-${{ matrix.java }}
-      - name: Post CI test summary comment
-        if: always() && !matrix.experimental
-        uses: actions/github-script@v8
-        with:
-          script: |
-            const fs = require('fs');
-            const commentFile = 'incremental-test-comment.md';
-            if (!fs.existsSync(commentFile)) return;
-            const body = fs.readFileSync(commentFile, 'utf8').trim();
-            if (!body) return;
-
-            const prNumber = ${{ github.event.number || inputs.pr_number || 0 
}};
-            if (!prNumber) {
-              core.warning('Could not determine PR number, skipping test 
summary comment');
-              return;
-            }
-
-            const marker = '<!-- ci-tested-modules -->';
-
-            try {
-              const { data: comments } = await 
github.rest.issues.listComments({
-                owner: context.repo.owner,
-                repo: context.repo.repo,
-                issue_number: prNumber,
-              });
-              const existing = comments.find(c => c.body && 
c.body.includes(marker));
-
-              if (existing) {
-                await github.rest.issues.updateComment({
-                  owner: context.repo.owner,
-                  repo: context.repo.repo,
-                  comment_id: existing.id,
-                  body: body,
-                });
-              } else {
-                await github.rest.issues.createComment({
-                  owner: context.repo.owner,
-                  repo: context.repo.repo,
-                  issue_number: prNumber,
-                  body: body,
-                });
-              }
-            } catch (error) {
-              core.warning(`Failed to post CI test summary comment: 
${error.message}`);
-            }
-      - name: mvn test parent pom dependencies changed
-        if: always() && !matrix.experimental
-        uses: ./.github/actions/detect-dependencies
+          extra-modules: ${{ inputs.extra_modules || '' }}
+      - name: Save PR number and test comment for commenter workflow
+        if: always() && matrix.java == '21'

Review Comment:
   _Claude Code on behalf of Guillaume Nodet_
   
   The comment lists which modules were tested — this is identical across all 
JDK versions since the same modules are tested on JDK 17, 21, and 25. Per-JDK 
pass/fail results are visible in the GitHub Actions checks UI. Uploading from 
one JDK avoids duplicate artifacts. Added a comment in the workflow to clarify 
this.



##########
.github/workflows/pr-manual-component-test.yml:
##########
@@ -28,20 +28,16 @@ jobs:
     name: PR comment
     if: ${{ github.repository == 'apache/camel' && 
github.event.issue.pull_request && (github.event.comment.author_association == 
'MEMBER' || github.event.comment.author_association == 'OWNER' || 
github.event.comment.author_association == 'CONTRIBUTOR') && 
startsWith(github.event.comment.body, '/component-test') }}
     permissions:
-      pull-requests: write # to comment on a pull request
-      actions: read # to download artifact
+      pull-requests: write
+      actions: write # to dispatch workflows
     runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        java: [ '21' ]
     steps:
       - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 
v6.0.2
         with:
           persist-credentials: false
-          submodules: recursive
-      - name: Check Permission
-        uses: 
actions-cool/check-user-permission@7b90a27f92f3961b368376107661682c441f6103

Review Comment:
   _Claude Code on behalf of Guillaume Nodet_
   
   Good catch — this was accidentally removed during the rewrite. Re-added in 
the latest commit.



##########
.github/workflows/pr-test-commenter.yml:
##########
@@ -0,0 +1,121 @@
+#
+# 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.
+#
+
+# Posts the CI test summary comment on PRs.
+# Uses workflow_run trigger so it runs in the base repo context with
+# full permissions — this allows posting comments on fork PRs too.
+
+name: Post CI test comment
+
+on:
+  workflow_run:
+    workflows: ["Build and test"]
+    types:
+      - completed
+
+jobs:
+  comment:
+    runs-on: ubuntu-latest
+    if: >
+      github.event.workflow_run.event == 'pull_request' ||
+      github.event.workflow_run.event == 'workflow_dispatch'
+    permissions:
+      pull-requests: write
+      actions: read
+    steps:
+      - name: Download CI comment artifact
+        uses: actions/github-script@v8

Review Comment:
   _Claude Code on behalf of Guillaume Nodet_
   
   Fixed — pinned to `ed597411d8f924073f98dfc5c65a23a2325f34cd` (v8) in the 
latest commit.



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