diff --git a/website/contribute/how-to-contribute.md b/website/contribute/how-to-contribute.md index 8a7b6cb6e0261..3ee8c92dc21b6 100644 --- a/website/contribute/how-to-contribute.md +++ b/website/contribute/how-to-contribute.md @@ -186,6 +186,58 @@ In rare cases, you can skip validation by adding one of these labels to your PR: Or include `[skip ci]` in your PR title for CI-related changes. +### CI for Pull Requests from Forks + +Pull requests from a fork to `master` run the `Java CI` suite on your fork, using your fork's own GitHub Actions runners, +instead of the shared ASF runner pool. Upstream, `Java CI` skips its test jobs for these PRs and only the lightweight checks +(PR title, license and source validation) run, plus any path-filtered workflows your change touches, such as the Trino +connector tests when you change `hudi-trino` or a module it builds on. + +Before anything lands, `Java CI` runs again on ASF runners through the [merge queue](#merging-pull-requests). +A PR that changes only docs and images skips the test jobs there. + +#### One-time setup + +1. In your fork of Hudi, open the **Actions** tab and enable workflows by clicking + **I understand my workflows, go ahead and enable them**. + + ![Enable workflows on a fork](/assets/images/contributing/fork_enable_actions.png) + +2. Sync your fork and rebase your branch onto the latest upstream `master`, so that it carries the current CI workflows. +3. Push to your branch. Each push that changes more than docs and images now runs `Java CI` on your fork. + +If the head commit of your branch was already pushed before you enabled Actions, pushing again does not start a run: +a push without file changes, such as an empty commit, is skipped. Instead, open the **Actions** tab of your fork, +select `Java CI`, click **Run workflow** and pick your branch. + +:::tip CI looks stuck? +If CI on your PR never turns green, Actions is most likely not enabled on your fork. In that case the PR's `CI (fork)` +check says "Enable CI on your fork" or "No fork CI run for this commit". The second one also shows up when workflows are +enabled in the **Actions** tab but Actions is turned off in **Settings > Actions > General** of your fork, so check both. +Then start a run as described above. +::: + +#### Where to see your CI results + +- **On the PR**: the `CI (fork)` check mirrors your fork's run and links to it. It refreshes about every 15 minutes, + so it can lag behind the actual run. +- **Live status**: on the PR page, click your branch name in the header line + ("`` wants to merge N commits into `apache:master` from `:`"). On your branch's latest commit, the status + icon shows the run: a yellow dot while in progress, a green tick or a red cross when done. Click it for per-job details. +- **Your fork's Actions tab** lists every run. Re-run failed jobs from there. + +Codecov reports still arrive on the PR, up to about 15 minutes after your fork run finishes. Reports are only collected +for PRs updated in the last 24 hours, so if you re-run jobs on a PR that has been quiet for longer, the report arrives +only after the PR is updated again, for example by a push. + +#### What stays the same + +- PRs to `release-*` branches and `branch-0.x` still run the full suite upstream. +- Azure CI is unchanged. + +More details are in the [Pull requests from forks](https://github.com/apache/hudi/blob/master/.github/workflows/README.md#pull-requests-from-forks) +section of the workflows README. The tracking issue is [#20471](https://github.com/apache/hudi/issues/20471). + ## Coding guidelines Our code can benefit from contributors speaking the same "language" when authoring code. After all, it gets read a lot more than it gets @@ -279,10 +331,22 @@ For website changes, please build the site locally & test navigation, formatting - If progress is hard, please involve another PMC member/Committer to share another perspective. - Staying humble and eager to learn, goes a long way in ensuring these reviews are smooth. - Reviewers are expected to uphold the code quality, standards outlined above. -- When merging PRs, always make sure you are squashing the commits using the "Squash and Merge" feature in GitHub +- PRs to `master` are merged through the merge queue, which squashes the commits. See [Merging Pull Requests](#merging-pull-requests). - When necessary/appropriate, reviewers could make changes themselves to PR branches, with the intent to get the PR landed sooner. Reviewers should seek explicit approval from the author before making large changes to the original PR. +### Merging Pull Requests + +`master` is merged through a GitHub merge queue. Once a PR is approved and its checks are green (for a fork PR, that includes +`CI (fork)`), a committer clicks **Merge when ready** to add it to the queue. A fork PR that changes only docs and images has +no fork run, so its `CI (fork)` check is neutral ("No fork CI run: docs-only change"); it can be queued as is, without a manual run. + +The queue runs `Java CI` on ASF runners against the latest `master` plus the PRs queued ahead of it, +and the PR only merges if that run is green. A PR that changes only docs and images skips the test jobs in the queue. + +Once a PR is in the merge queue, avoid pushing to it. The queue tests and merges the commits that were queued, +so later changes do not go in on their own; a committer has to re-queue the PR to include them. + ### Proposing Changes We welcome new ideas and suggestions to improve the project along any dimensions - management, processes, technical vision/direction. To kick-start a discussion on the mailing thread to effect change and source feedback, start a new email thread with the `[DISCUSS]` prefix and share your thoughts. If your proposal leads to a larger change, then it may be followed up diff --git a/website/static/assets/images/contributing/fork_enable_actions.png b/website/static/assets/images/contributing/fork_enable_actions.png new file mode 100644 index 0000000000000..c7ab891515a89 Binary files /dev/null and b/website/static/assets/images/contributing/fork_enable_actions.png differ