vinothchandar commented on code in PR #10731:
URL: https://github.com/apache/hudi/pull/10731#discussion_r1500166265
##########
.github/workflows/azure_ci_check.yml:
##########
@@ -0,0 +1,72 @@
+name: Azure CI
+
+on:
+ pull_request:
+ types: [ opened, reopened, synchronize, edited ]
+ issue_comment:
+ types: [ created, edited, deleted ]
+
+jobs:
+ check-azure-ci-report:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Get last commit hash
+ id: last_commit
+ uses: actions/github-script@v5
+ with:
+ script: |
+ const pr = context.payload.pull_request;
+ const lastCommitHash = pr.head.sha;
+ console.log(`Last commit hash: ${lastCommitHash}`);
+ // Set the output variable to be used in subsequent step
+ core.setOutput("last_commit_hash", lastCommitHash);
+
+ - name: Check Azure CI report in PR comment
+ uses: actions/github-script@v5
+ with:
+ script: |
+ const lastCommitHash = '${{
steps.last_commit.outputs.last_commit_hash }}'
+ const botUsername = 'hudi-bot';
+ const contentToCheck = 'specific content';
+
+ const issueNumber = context.payload.pull_request.number;
+ const comments = await github.rest.issues.listComments({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: issueNumber,
+ });
+
+ // Find the last comment from hudi-bot containing the Azure CI
report
+ const botComments = comments.data.filter(comment =>
comment.user.login === botUsername);
+ const lastComment = botComments.pop();
+
+ if (lastComment) {
+ const reportPrefix = '${lastCommitHash} Azure: '
+ const successReportString = '${reportPrefix}[SUCCESS]'
+ const failureReportString = '${reportPrefix}[FAILURE]'
+ if (lastComment.body.includes(reportPrefix)) {
+ if (lastComment.body.includes(successReportString)) {
+ console.log(`Azure CI succeeded on the latest commit of the
PR.`);
+ return true;
+ } else if (lastComment.body.includes(failureReportString)) {
+ console.log(`Azure CI failed on the latest commit of the
PR.`);
+ core.setFailed("Azure CI failed on the latest commit of the
PR.");
+ return false;
+ } else {
+ console.log(`Azure CI is in progress on the latest commit of
the PR.`);
+ core.setFailed("Azure CI is in progress on the latest commit
of the PR.");
+ return false;
+ }
+ } else {
+ console.log(`No Azure CI report on the latest commit of the
PR.`);
+ core.setFailed("No Azure CI report on the latest commit of the
PR.");
+ return false;
+ }
+ } else {
+ console.log(`PR comments do not contain Azure CI report.`);
Review Comment:
`Azure CI report does not seem to be ready yet`
##########
.github/workflows/azure_ci_check.yml:
##########
@@ -0,0 +1,72 @@
+name: Azure CI
+
+on:
+ pull_request:
+ types: [ opened, reopened, synchronize, edited ]
+ issue_comment:
+ types: [ created, edited, deleted ]
+
+jobs:
+ check-azure-ci-report:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
Review Comment:
does this do a git clone? would n't that be expensive for each time?
##########
.github/workflows/azure_ci_check.yml:
##########
@@ -0,0 +1,72 @@
+name: Azure CI
+
+on:
+ pull_request:
+ types: [ opened, reopened, synchronize, edited ]
+ issue_comment:
+ types: [ created, edited, deleted ]
+
+jobs:
+ check-azure-ci-report:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+
+ - name: Get last commit hash
+ id: last_commit
+ uses: actions/github-script@v5
+ with:
+ script: |
+ const pr = context.payload.pull_request;
+ const lastCommitHash = pr.head.sha;
+ console.log(`Last commit hash: ${lastCommitHash}`);
+ // Set the output variable to be used in subsequent step
+ core.setOutput("last_commit_hash", lastCommitHash);
+
+ - name: Check Azure CI report in PR comment
+ uses: actions/github-script@v5
+ with:
+ script: |
+ const lastCommitHash = '${{
steps.last_commit.outputs.last_commit_hash }}'
+ const botUsername = 'hudi-bot';
+ const contentToCheck = 'specific content';
Review Comment:
is this used?
##########
.github/workflows/azure_ci_check.yml:
##########
@@ -0,0 +1,72 @@
+name: Azure CI
Review Comment:
does the .yml file have a apache license we can add?
--
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]