yihua opened a new pull request, #10746: URL: https://github.com/apache/hudi/pull/10746
### Change Logs This PR redesigns and implements the way of surfacing Azure CI report status of a PR and fixes bugs in checking Azure CI report based on `issue_comment` event triggers. There are a few things to be aware of: - The GitHub token used by the GitHub workflows triggered by PRs from a fork (e.g., `yihua/hudi` instead of `apache/hudi`) has read-only permissions, and no write permissions are granted (Apache restriction). Only the GitHub workflows triggered from master and branches on `apache/hudi` contain GitHub token with write permissions, including scheduled tasks and workflows triggered by issue/PR comments. Write permissions are required for creating commit status, commenting on the PR, adding labels to the PR, add related projects, etc. - The Azure CI report is included in the comments from `hudi-bot` user. Such comments are put by the bot some time after the PR is created. - The workflow triggered by `issue_comment`, e.g., PR comments, is not associated with the PR, so from the PR page, we cannot directly see the workflow result, whether the check is successful or not. This PR aims to create a commit status to the PR (see sample screenshots below) and maintain that based on the Azure CI report so it's easier to check the Azure CI status. Changes are: - After each PR is created, a pending Azure CI commit status is created to indicate author to wait for the CI. Given that `pull_request` event-triggered workflows do not have write permissions, a new scheduled workflow, which has write permissions, is created in `scheduled_workflow.yml` to run every 5 minutes to check on recently created and updated PRs, and create or update commit status for Azure CI to the corresponding PR. - The workflow in `azure_ci_checks.yml` is fixed to also create or update the commit status of the corresponding PR based on the Azure CI report status. - PRs that are close, or containing `HOTFIX: SKIP AZURE CI` magic phrase in the description, are skipped for the check. - The schedule workflow can be further extended for any other periodic actions that require write permissions, e.g., adding PR size labeling, issue labeling, attaching projects, etc. How the commit status looks like in the PR: The "Details" links to the Azure CI run. Azure CI pending <img width="723" alt="Screenshot 2024-02-24 at 17 22 04" src="https://github.com/apache/hudi/assets/2497195/5fcfe65a-f763-4981-8278-fd485fe6a502"> Azure CI failing <img width="703" alt="Screenshot 2024-02-24 at 17 21 47" src="https://github.com/apache/hudi/assets/2497195/6dd16961-49a9-4ab6-baa7-1b0e2b4ab1f7"> Azure CI success <img width="720" alt="Screenshot 2024-02-24 at 17 21 16" src="https://github.com/apache/hudi/assets/2497195/aea4ddb1-306c-45ad-b5eb-a6e99b7eae1f"> The core logic implemented is tested in a pushed branch to `apache/hudi` with this PR since we cannot test the logic from a fork: #10743. ### Impact Makes Azure CI status easy to read. ### Risk level none ### Documentation Update N/A ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Change Logs and Impact were stated clearly - [ ] Adequate tests were added if applicable - [ ] CI passed -- 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]
