Skip to content

Commit

Permalink
[HUDI-7446] Enable CI on PRs targeting branch-0.x and branch-0.x (#10765
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yihua authored Feb 27, 2024
1 parent 20db8b7 commit f1c3e74
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- 'release-*'
- branch-0.x
pull_request:
paths-ignore:
- '**.bmp'
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr_compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
types: [opened, edited, reopened, synchronize]
branches:
- master
- branch-0.x

jobs:
validate-pr:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/scheduled_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down

0 comments on commit f1c3e74

Please sign in to comment.