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

github-merge-queue[bot] pushed a commit to branch 
gh-readonly-queue/master/pr-20663-d020350d0d0605b7e30d2bcde42de39067529b13
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 7522e3af8dc46712e69d1ef1327df31decd5ace7
Author: voonhous <[email protected]>
AuthorDate: Mon Nov 16 05:40:59 2026 +0000

    chore(ci): ask for action when a fork PR has no fork run (#20663)
    
    CI (fork) reported a missing fork run as neutral unless bot.yml was
    disabled on the fork. A fork with Actions turned off in its settings
    still lists its workflows as active, so such PRs showed a grey check
    next to a green Java CI result, with no sign that no tests ran.
    
    Report a missing run as action_required, except when the PR changes
    only paths the push filter of bot.yml ignores (docs and images), where
    no fork run is expected. A test pins those paths to the filter.
    
    A push without file changes starts no run under the path filter, so
    an empty commit cannot start a fork run after enabling Actions. Add
    workflow_dispatch to bot.yml; both bridges already mirror manual runs.
    The check text and the README now point at Run workflow.
---
 .github/ci/scripts/test-fork-ci-status.cjs | 44 +++++++++++++++++++++++++++---
 .github/workflows/README.md                |  6 ++--
 .github/workflows/bot.yml                  |  7 +++--
 .github/workflows/fork_ci_status.yml       | 42 ++++++++++++++++++++++------
 4 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/.github/ci/scripts/test-fork-ci-status.cjs 
b/.github/ci/scripts/test-fork-ci-status.cjs
index 876a93bbb0e2..866d45ac863a 100644
--- a/.github/ci/scripts/test-fork-ci-status.cjs
+++ b/.github/ci/scripts/test-fork-ci-status.cjs
@@ -65,11 +65,13 @@ async function execute({
   event = 'schedule', checks = [], runs = [run()], workflowState = 'active',
   recent = [pr], slice = [pr], candidates = [pr], repo = 'hudi',
   owner = 'apache', runError, count = 1, notification = {}, checkErrors = {},
+  files = [{ filename: 'hudi-common/src/main/java/A.java' }],
 } = {}) {
   const writes = [], calls = [], failures = [];
   let sweepPage;
   const github = { rest: { checks: {}, actions: {}, pulls: {} } };
   github.rest.checks.listForRef = async () => {};
+  github.rest.pulls.listFiles = async () => {};
   github.rest.pulls.list = async (params) => {
     calls.push(['pulls', params]);
     if (params.per_page === 1) return {
@@ -102,6 +104,11 @@ async function execute({
       if (checkErrors[params.ref]) throw new Error(checkErrors[params.ref]);
       return checks;
     }
+    if (fn === github.rest.pulls.listFiles) {
+      calls.push(['files', params]);
+      assert.deepEqual(params, { owner, repo, pull_number: 10, per_page: 100 
});
+      return files;
+    }
     assert.equal(fn, github.rest.pulls.list);
     assert.equal(params.head, 'contributor:feature');
     return candidates;
@@ -164,23 +171,52 @@ test('only runs for the exact branch head on push/manual 
events are mirrored', a
   ] });
   assert.equal(result.writes[0].details_url, run(5).html_url);
 });
+// A fork with Actions turned off in its settings still lists bot.yml as 
active, so an active
+// workflow without a run asks for action as loudly as a disabled one.
 for (const [state, expected, title] of [
-  ['active', 'neutral', 'No fork CI run for this commit'],
+  ['active', 'action_required', 'No fork CI run for this commit'],
   ['disabled_manually', 'action_required', 'Enable CI on your fork'],
   ['disabled_fork', 'action_required', 'Enable CI on your fork'],
   [null, 'action_required', 'Enable CI on your fork'],
 ]) {
   test('missing run reports workflow state ' + state, async () => {
-    const { writes } = await execute({ runs: [], workflowState: state });
+    const { writes, calls } = await execute({ runs: [], workflowState: state 
});
     assert.equal(writes[0].conclusion, expected);
     assert.equal(writes[0].output.title, title);
     assert.equal(writes[0].details_url, 
'https://github.com/contributor/hudi/actions');
     assert.match(writes[0].output.summary, /^No Java CI run was found for /);
-    assert.match(writes[0].output.summary, /Enable workflows/);
+    assert.match(writes[0].output.summary, /Enable Actions on your fork/);
     assert.match(writes[0].output.summary, /only docs or images is skipped by 
the path filter/);
     assert.deepEqual(JSON.parse(writes[0].output.text).runs.map((item) => 
item.run_id), [null]);
+    // Only an active workflow needs the PR's files to tell a docs-only change 
apart.
+    assert.equal(calls.some(([kind]) => kind === 'files'), state === 'active');
+  });
+}
+// [case, PR files, whether the missing run is expected]
+for (const [name, files, docsOnly] of [
+  ['docs and images', [{ filename: 'README.md' }, { filename: 
'rfc/rfc-1/a.png' }, { filename: '.gitignore' }], true],
+  ['a doc renamed from another doc', [{ filename: 'b.md', previous_filename: 
'a.md' }], true],
+  ['a nested .gitignore', [{ filename: 'hudi-common/.gitignore' }], false],
+  ['a doc renamed from code', [{ filename: 'A.md', previous_filename: 'A.java' 
}], false],
+  ['docs and code', [{ filename: 'README.md' }, { filename: 'pom.xml' }], 
false],
+  ['no files', [], false],
+  ['the files API limit', Array.from({ length: 3000 }, (_, index) => ({ 
filename: index + '.md' })), false],
+]) {
+  test('a missing run on a PR with ' + name + ' ' + (docsOnly ? 'is expected' 
: 'asks for action'), async () => {
+    const { writes } = await execute({ runs: [], files });
+    assert.equal(writes[0].conclusion, docsOnly ? 'neutral' : 
'action_required');
+    assert.equal(writes[0].output.title,
+      docsOnly ? 'No fork CI run: docs-only change' : 'No fork CI run for this 
commit');
   });
 }
+test('the docs-only paths of the bridge are what the push filter of bot.yml 
ignores', () => {
+  const script = bridgeWorkflow.jobs.bridge.steps[0].with.script;
+  const list = (name) => JSON.parse(new RegExp('const ' + name + ' = 
(\\[[^\\]]*\\]);').exec(script)[1].replace(/'/g, '"'));
+  const ignored = ci.workflow.true.push.paths.filter((pattern) => 
pattern.startsWith('!')).map((pattern) => pattern.slice(1));
+  assert.deepEqual(
+    [...list('DOCS_EXTENSIONS').map((extension) => '**' + extension), 
...list('DOCS_ROOT_FILES')].sort(),
+    [...ignored].sort());
+});
 test('a missing workflow endpoint is handled as missing CI', async () => {
   const { writes } = await execute({ runError: 404, workflowState: null });
   assert.equal(writes[0].conclusion, 'action_required');
@@ -245,7 +281,7 @@ test('a manual run can replace a failed push run', async () 
=> {
 test('a deleted run clears its stale success result', async () => {
   const { writes } = await execute({ checks: [await existing()], runs: [] });
   assert.equal(writes[0].method, 'update');
-  assert.equal(writes[0].conclusion, 'neutral');
+  assert.equal(writes[0].conclusion, 'action_required');
 });
 test('unchanged results do not consume check write requests', async () => {
   const check = await existing();
diff --git a/.github/workflows/README.md b/.github/workflows/README.md
index 1c8c834dd96c..9c537f537fda 100644
--- a/.github/workflows/README.md
+++ b/.github/workflows/README.md
@@ -4,7 +4,7 @@ When updating the pr template, you must consider if updates 
need to be made to s
 
 ## What are the files in workflows?
 - bot.yml: Java CI. Spark lanes (JDK 11 on Spark 3.5, JDK 17 on Spark 4.2), 
Flink, bundle validation and integration tests. Runs on PRs, merge-queue groups 
and branch pushes; only push runs are path-filtered. Forks run it on every 
branch push; upstream it skips every job on pushes to branches other than 
master, release-* and branch-0.x, and every job but the aggregate on PRs from 
forks to master (see [Pull requests from forks](#pull-requests-from-forks)). 
Every test job depends only on t [...]
-- fork_ci_status.yml: Fork CI status. Mirrors the fork's bot.yml run for the 
head commit of each open fork PR to master onto the PR as the informational `CI 
(fork)` check. Runs when an upstream Java CI run completes and every 15 minutes 
for late runs and reruns. It never checks out PR code. Its tests, 
.github/ci/scripts/test-fork-ci-status.cjs, also cover the routing and 
concurrency of bot.yml
+- fork_ci_status.yml: Fork CI status. Mirrors the fork's bot.yml run for the 
head commit of each open fork PR to master onto the PR as the `CI (fork)` 
check, which also asks for action when the head commit has no fork run although 
the PR changes more than docs and images. Runs when an upstream Java CI run 
completes and every 15 minutes for late runs and reruns. It never checks out PR 
code. Its tests, .github/ci/scripts/test-fork-ci-status.cjs, also cover the 
routing and concurrency of bot.yml
 - fork_coverage_bridge.yml: Fork coverage bridge. Every 15 minutes, uploads to 
Codecov the JaCoCo reports that the fork's bot.yml runs stored as artifacts 
(through .github/actions/upload-coverage) for the head commit of each recently 
updated fork PR to master, and records each uploaded commit as a `Coverage 
(fork)` check. It never checks out or runs PR code; its tests are 
.github/ci/scripts/test-fork-coverage-bridge.cjs
 - validate_source.yml: PR and Source Validation. One job, 
`validate-pr-and-source`, one of the two required status checks with `Java CI 
result`: it checks the PR description with scripts/pr_compliance.py, runs that 
script's own tests and the fork_ci_status.yml and fork_coverage_bridge.yml 
tests, validates the PR title, rejects commits with a Claude co-author trailer, 
and runs the source release checks (RAT, binary files, copyright). Never 
path-filtered, because a required check must repo [...]
 
@@ -14,8 +14,8 @@ To reduce load on ASF's shared runners, pull requests from 
forks to `master` run
 
 1. Open the Actions tab in your fork and enable workflows before pushing.
 2. Sync your fork and rebase your branch onto upstream `master` to include the 
current CI workflows.
-3. Push your branch.
+3. Push your branch. If its head commit already exists on your fork, for 
example after you enabled Actions, run `Java CI` on the branch from your fork's 
Actions tab (Run workflow) instead: a push without file changes, such as an 
empty commit, starts no run.
 
 Each push runs the `Java CI` workflow on your fork, and the run appears in 
your fork's Actions tab. View results and rerun failed jobs there; the PR's `CI 
(fork)` check mirrors the run and may lag. A push that changes only docs or 
images creates no fork run, because the workflow path-filters push events. The 
PR's Codecov report arrives up to about 15 minutes after the fork run finishes, 
through the coverage bridge (fork_coverage_bridge.yml).
 
-The `CI (fork)` check links to the fork run and is informational. When your PR 
is approved and added to the merge queue, Java CI runs using ASF's runners 
against the proposed merge with `master`, and skips its test jobs if the PR 
changes only docs and images. Release-branch PRs, and PRs from branches pushed 
to apache/hudi itself, keep upstream testing.
+The `CI (fork)` check links to the fork run. It fails when the fork run fails, 
and asks for action when your head commit has no fork run although the PR 
changes more than docs and images. It is not a required check, but committers 
add a fork PR to the merge queue only once it is green. When your PR is 
approved and added to the merge queue, Java CI runs using ASF's runners against 
the proposed merge with `master`, and skips its test jobs if the PR changes 
only docs and images. Release-bra [...]
diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml
index 9be5e2246809..923d0056e812 100644
--- a/.github/workflows/bot.yml
+++ b/.github/workflows/bot.yml
@@ -17,7 +17,9 @@ name: Java CI
 # push; see "Pull requests from forks" in README.md. Upstream pushes to 
branches other than master,
 # release-* and branch-0.x skip every job: their PRs test them. Merge-queue 
branches
 # (gh-readonly-queue/...) are validated by merge_group, not push: a skipped 
aggregate job on a
-# queue-branch push would report success and could satisfy the gate early.
+# queue-branch push would report success and could satisfy the gate early. 
workflow_dispatch lets
+# a contributor run the suite on a fork branch whose head no push run tested, 
such as after enabling
+# Actions: the path filter starts no run for a push without file changes, such 
as an empty commit.
 on:
   push:
     branches-ignore:
@@ -43,6 +45,7 @@ on:
       - branch-0.x
   merge_group:
     types: [checks_requested]
+  workflow_dispatch:
 
 # A group holds one running and one pending run, and a newer pending run 
replaces the older one
 # even when cancel-in-progress is false. Pushes to apache/hudi are therefore 
keyed by SHA, so a
@@ -76,7 +79,7 @@ env:
 # FORK_PR, a pull request from a fork to master:
 #   github.event_name == 'pull_request' && 
github.event.pull_request.head.repo.full_name != github.repository && 
github.base_ref == 'master'
 # Its test jobs already run on the fork's runners when the contributor pushes 
the branch, and
-# fork_ci_status.yml mirrors that run onto the PR as the informational `CI 
(fork)` check. The
+# fork_ci_status.yml mirrors that run onto the PR as the `CI (fork)` check. The
 # merge queue then runs them on ASF runners against the proposed merge with 
master. The
 # event_name guard matters: on merge_group the pull_request fields are empty 
strings, and an empty
 # head repository differs from github.repository. Fork PRs to release-* and 
branch-0.x keep
diff --git a/.github/workflows/fork_ci_status.yml 
b/.github/workflows/fork_ci_status.yml
index 273d2edcf88e..d6678b06dd56 100644
--- a/.github/workflows/fork_ci_status.yml
+++ b/.github/workflows/fork_ci_status.yml
@@ -16,10 +16,12 @@
 # under the License.
 
 # Adapted from apache/arrow-rs .github/workflows/fork_ci_status.yml.
-# Mirror fork results as the informational CI (fork) check after upstream PR CI
-# completes and through scheduled polling for late runs and reruns. The check
-# reports the fork's Java CI (bot.yml) run for the PR head. Read fork runs and
-# write upstream checks using reviewed default-branch code.
+# Mirror fork results as the CI (fork) check after upstream PR CI completes and
+# through scheduled polling for late runs and reruns. The check reports the
+# fork's Java CI (bot.yml) run for the PR head, and asks for action when the
+# head has no run although the PR changes more than docs and images. It is not
+# a required check; committers queue a fork PR once it is green. Read fork runs
+# and write upstream checks using reviewed default-branch code.
 # No checkout, artifacts, or code from the pull request are used here.
 # Test with Python 3.11+, PyYAML, and Node.js 24:
 #   node --test .github/ci/scripts/test-fork-ci-status.cjs
@@ -71,6 +73,14 @@ jobs:
             const repository = upstream.owner + '/' + upstream.repo;
             const GUIDE = 
'https://github.com/apache/hudi/blob/master/.github/workflows/README.md#pull-requests-from-forks';
             const SWEEP_SIZE = 25;
+            // The paths the push filter of bot.yml ignores, so a PR that 
changes only these has no fork
+            // run. test-fork-ci-status.cjs checks them against the filter.
+            const DOCS_EXTENSIONS = ['.bmp', '.gif', '.jpg', '.jpeg', '.md', 
'.pdf', '.png', '.svg'];
+            const DOCS_ROOT_FILES = ['.gitignore'];
+            const isDocs = (file) => DOCS_ROOT_FILES.includes(file) ||
+              DOCS_EXTENSIONS.some((extension) => file.endsWith(extension));
+            // The files API lists at most 3000 files; a longer PR counts as 
more than docs.
+            const MAX_LISTED_FILES = 3000;
             const listing = { ...upstream, state: 'open', base: 'master', 
sort: 'updated', direction: 'desc' };
             const isForkPr = (pr) => pr.state === 'open' && pr.head.repo &&
               pr.head.repo.full_name.toLowerCase() !== 
repository.toLowerCase() && pr.base.ref === 'master';
@@ -82,7 +92,7 @@ jobs:
             ];
             const conclusionOf = (run) => CONCLUSIONS.includes(run.conclusion) 
? run.conclusion : 'failure';
             const UPDATE_NOTE =
-              'This check is informational: the contributor controls the fork 
workflow. ' +
+              'This check is not required, but committers queue a fork PR only 
once it is green. ' +
               'The upstream merge queue runs the required CI checks on the 
proposed merge result. ' +
               'Active or missing runs on recently updated PRs are polled every 
15 minutes; ' +
               'a rotating sweep also discovers reruns on older PRs. Scheduled 
updates may be delayed.';
@@ -168,19 +178,33 @@ jobs:
                   })));
                 }
                 const disabled = states.some((workflow) => !workflow || 
workflow.state.startsWith('disabled'));
+                // A fork with Actions turned off in its settings still lists 
its workflows as active,
+                // so a missing run asks for action too, unless the PR changes 
only paths the push
+                // filter ignores. Renames count both paths.
+                let docsOnly = false;
+                if (!disabled) {
+                  const files = await 
github.paginate(github.rest.pulls.listFiles, {
+                    ...upstream, pull_number: pr.number, per_page: 100,
+                  });
+                  docsOnly = files.length > 0 && files.length < 
MAX_LISTED_FILES && files.every((file) =>
+                    isDocs(file.filename) && (!file.previous_filename || 
isDocs(file.previous_filename)));
+                }
                 const missing = WORKFLOWS.filter((workflow, index) => 
!runs[index]).map((workflow) => workflow.name);
                 const actions = 'https://github.com/' + pr.head.repo.full_name 
+ '/actions';
                 payload = {
                   status: 'completed',
-                  conclusion: disabled ? 'action_required' : 'neutral',
+                  conclusion: docsOnly ? 'neutral' : 'action_required',
                   details_url: disabled ? actions : 
(runs.find(Boolean)?.html_url || actions),
                   output: {
-                    title: disabled ? 'Enable CI on your fork' : 'No fork CI 
run for this commit',
+                    title: disabled ? 'Enable CI on your fork' :
+                      docsOnly ? 'No fork CI run: docs-only change' : 'No fork 
CI run for this commit',
                     summary: [
                       'No ' + missing.join(' or ') + ' run was found for ' + 
sha + ' on ' + pr.head.repo.full_name + '.',
                       ...(runs.some(Boolean) ? [runList] : []),
-                      'Enable workflows in the Actions tab of your fork, 
sync/rebase onto master to include the fork CI workflows, ' +
-                      'then push your branch. A newly pushed run may take a 
moment to appear.',
+                      'Enable Actions on your fork (the Actions tab, and 
Settings > Actions > General) and ' +
+                      'sync/rebase onto master to include the fork CI 
workflows. Then push your branch, or run ' +
+                      'Java CI on it from the Actions tab of your fork (Run 
workflow): a push without file ' +
+                      'changes, such as an empty commit, starts no run. A new 
run may take a moment to appear.',
                       'A push that changes only docs or images is skipped by 
the path filter of bot.yml, ' +
                       'so no run exists for such a commit.',
                       UPDATE_NOTE,

Reply via email to