You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2025/12/01 09:55:16 UTC

(opendal) branch xuanwo/pr-autotest-workflow created (now f0083fd10)

This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a change to branch xuanwo/pr-autotest-workflow
in repository https://gitbox.apache.org/repos/asf/opendal.git


      at f0083fd10 ci: Allow test_behavior to be called with dispatch

This branch includes the following new commits:

     new f0083fd10 ci: Allow test_behavior to be called with dispatch

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(opendal) 01/01: ci: Allow test_behavior to be called with dispatch

Posted by xu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch xuanwo/pr-autotest-workflow
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit f0083fd102f15bdaa9b1c1fe91bb202f024ad4b0
Author: Xuanwo <gi...@xuanwo.io>
AuthorDate: Mon Dec 1 17:54:54 2025 +0800

    ci: Allow test_behavior to be called with dispatch
    
    Signed-off-by: Xuanwo <gi...@xuanwo.io>
---
 .github/workflows/full-ci-promote.yml | 12 ++++++------
 .github/workflows/test_behavior.yml   | 14 ++++++++++++++
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/full-ci-promote.yml b/.github/workflows/full-ci-promote.yml
index 5621de6f7..d52f1ec0f 100644
--- a/.github/workflows/full-ci-promote.yml
+++ b/.github/workflows/full-ci-promote.yml
@@ -94,15 +94,14 @@ jobs:
             core.setOutput('mirror_pr_number', mirrorPr.number);
             core.setOutput('mirror_pr_html_url', mirrorPr.html_url);
 
-      - name: Trigger CI workflows
+      - name: Trigger Behavior Test
         uses: actions/github-script@v7
         env:
           TARGET_BRANCH: ci/pr-${{ github.event.pull_request.number }}
         with:
           script: |
             const workflows = [
-              'ci_core.yml',
-              'test_behavior.yml',
+              { id: 'test_behavior.yml', inputs: { pr_number: `${context.payload.pull_request.number}` } },
             ];
             const owner = context.repo.owner;
             const repo = context.repo.repo;
@@ -112,10 +111,11 @@ jobs:
               await github.rest.actions.createWorkflowDispatch({
                 owner,
                 repo,
-                workflow_id: workflow,
+                workflow_id: workflow.id,
                 ref,
+                inputs: workflow.inputs,
               });
-              core.info(`Dispatched ${workflow} on ref ${ref}`);
+              core.info(`Dispatched ${workflow.id} on ref ${ref}`);
             }
 
       - name: Comment on PR
@@ -135,7 +135,7 @@ jobs:
               marker,
               'Maintainer triggered full CI with repository secrets.',
               `Please monitor the mirrored CI PR for results: ${mirrorUrl}`,
-              'Workflows dispatched: ci_core.yml, test_behavior.yml.',
+              'Workflows dispatched: test_behavior.yml.',
               'Re-applying the label will refresh this mirror.',
             ].join('\n');
 
diff --git a/.github/workflows/test_behavior.yml b/.github/workflows/test_behavior.yml
index d51e91afc..1558eac8a 100644
--- a/.github/workflows/test_behavior.yml
+++ b/.github/workflows/test_behavior.yml
@@ -24,6 +24,12 @@ on:
   pull_request:
     branches:
       - main
+  workflow_dispatch:
+    inputs:
+      pr_number:
+        description: "Upstream PR number (for mirrored runs)"
+        required: false
+        type: string
 
 concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
@@ -66,6 +72,14 @@ jobs:
             files_changed=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
             echo "Files changed:"
             echo "$files_changed"
+          elif [ "$event_name" == "workflow_dispatch" ]; then
+            # Mirror runs are explicitly triggered by maintainers; allow secrets.
+            has_secrets="true"
+            # Compare against main to infer affected components.
+            git fetch --no-tags --prune --depth=1 origin main
+            files_changed=$(git diff --name-only origin/main HEAD)
+            echo "Files changed (main..HEAD):"
+            echo "$files_changed"
           fi
 
           # Export variables