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

yihua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new f1c3e7427ca [HUDI-7446] Enable CI on PRs targeting branch-0.x and 
branch-0.x (#10765)
f1c3e7427ca is described below

commit f1c3e7427ca1485b49e172c2fe365d2facdae3de
Author: Y Ethan Guo <[email protected]>
AuthorDate: Mon Feb 26 23:25:51 2024 -0800

    [HUDI-7446] Enable CI on PRs targeting branch-0.x and branch-0.x (#10765)
---
 .github/workflows/bot.yml                |  4 +++-
 .github/workflows/pr_compliance.yml      |  1 +
 .github/workflows/scheduled_workflow.yml | 21 ++++++++++++++-------
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml
index ca53f8f6fdc..0bfd9541bcc 100644
--- a/.github/workflows/bot.yml
+++ b/.github/workflows/bot.yml
@@ -5,6 +5,7 @@ on:
     branches:
       - master
       - 'release-*'
+      - branch-0.x
   pull_request:
     paths-ignore:
       - '**.bmp'
@@ -20,10 +21,11 @@ on:
     branches:
       - master
       - 'release-*'
+      - branch-0.x
 
 concurrency:
   group: ${{ github.ref }}
-  cancel-in-progress: ${{ !contains(github.ref, 'master') }}
+  cancel-in-progress: ${{ !contains(github.ref, 'master') && 
!contains(github.ref, 'branch-0.x') }}
 
 env:
   MVN_ARGS: -e -ntp -B -V -Dgpg.skip -Djacoco.skip -Pwarn-log 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=warn 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.dependency=warn 
-Dmaven.wagon.httpconnectionManager.ttlSeconds=25 
-Dmaven.wagon.http.retryHandler.count=5
diff --git a/.github/workflows/pr_compliance.yml 
b/.github/workflows/pr_compliance.yml
index 3f58ceafcf3..104a933db7d 100644
--- a/.github/workflows/pr_compliance.yml
+++ b/.github/workflows/pr_compliance.yml
@@ -4,6 +4,7 @@ on:
     types: [opened, edited, reopened, synchronize]
     branches:
       - master
+      - branch-0.x
 
 jobs:
   validate-pr:
diff --git a/.github/workflows/scheduled_workflow.yml 
b/.github/workflows/scheduled_workflow.yml
index 4e17ee12990..48fca07ddbb 100644
--- a/.github/workflows/scheduled_workflow.yml
+++ b/.github/workflows/scheduled_workflow.yml
@@ -46,7 +46,7 @@ jobs:
           script: |
             // Cron schedule may not be reliable so giving buffer time to 
avoid missing recent PRs
             const since = new Date(new Date().getTime() - (900 * 
1000)).toISOString();
-            const query = `repo:${context.repo.owner}/${context.repo.repo} 
type:pr state:open base:master updated:>=${since}`;
+            const query = `repo:${context.repo.owner}/${context.repo.repo} 
type:pr state:open updated:>=${since}`;
             const openPrs = await 
github.paginate(github.rest.search.issuesAndPullRequests, {
               q: query,
               sort: 'updated',
@@ -61,12 +61,19 @@ jobs:
             for (const pr of openPrs) {
               console.log(`*** Processing PR: ${pr.title}, URL: 
${pr.html_url}`);
             
-              if (!pr.body.includes('HOTFIX: SKIP AZURE CI')) {
-                const { data: pullRequest } = await github.rest.pulls.get({
-                  owner: context.repo.owner,
-                  repo: context.repo.repo,
-                  pull_number: pr.number
-                });
+              const { data: pullRequest } = await github.rest.pulls.get({
+                owner: context.repo.owner,
+                repo: context.repo.repo,
+                pull_number: pr.number
+              });
+            
+              const targetBase = pullRequest.base.ref;
+              console.log(`Target base branch: ${targetBase}`);
+            
+              // Check Azure CI and create commit status (targeting "master", 
"release*", or "branch-0.x" branch)
+              const targetBaseRegex = /^(master|release.*|branch-0\.x)$/;
+              if (targetBaseRegex.test(targetBase)
+                && !pr.body.includes('HOTFIX: SKIP AZURE CI')) {
                 const latestCommitHash = pullRequest.head.sha;
             
                 // Create commit status based on Azure CI report to PR

Reply via email to