LuciferYang commented on code in PR #13762:
URL: https://github.com/apache/gluten/pull/13762#discussion_r4692711344


##########
.github/workflows/util/update-fork-build-status.js:
##########
@@ -179,11 +253,16 @@ module.exports = async ({ github, context, core }) => {
         // Two branches can share a head commit; the newer run keeps the 
status.
         if (at && at.id > run.id) continue;
         if (at && at.id == run.id && at.attempt == run.run_attempt && 
isFinal(current)) continue;
-        const next = statusOf(run, await jobsOf(pr, run));
-        const same = current && ['state', 'description', 
'target_url'].every((k) => current[k] == next[k]);
-        if (!same) await setStatus(pr, w, next);
-      } else if (!current) {
-        await setStatus(pr, w, { state: 'error', target_url: SETUP_URL, 
description: NO_RUN });
+        // An irrelevant run skips its jobs. Linking it makes the status final.
+        const next = (await isRelevant(w))
+          ? statusOf(run, await jobsOf(pr, run))
+          : { state: 'success', target_url: 
`${run.html_url}/attempts/${run.run_attempt}`, description: NOT_NEEDED };
+        await update(w, current, next);
+      } else if (!current || current.description == LEGACY_NO_RUN) {

Review Comment:
   A status this branch writes, `NO_RUN` or `NOT_NEEDED` with `SETUP_URL`, is 
only looked at again if a fork push run of this workflow appears for the head 
commit. So when this branch gets the verdict wrong, it stays wrong until the 
author pushes again. Nothing triggers that today, but two kinds of edit on main 
would. If `pathFilterOf` can't read a `paths` input, it only logs a warning, 
and every open PR that still shows `LEGACY_NO_RUN` gets the new `NO_RUN`, which 
this branch doesn't recheck. A change to a workflow's `paths` leaves open PRs 
with the verdict from the old list.
   
   I don't think this blocks the PR. The first case is cheap to avoid: when the 
filter is null, this branch could leave a `LEGACY_NO_RUN` status alone, so the 
one recheck happens on a pass that can read the filter.



##########
.github/workflows/velox_backend_arm.yml:
##########
@@ -137,7 +137,7 @@ jobs:
           match() { echo "$changed" | grep -qE "$1" && echo true || echo 
false; }
 
           echo "cpp=$(match      '^(cpp/|ep/build-velox/|dev/)')"              
                              >> $GITHUB_OUTPUT
-          echo "java=$(match     
'^(\.github/(workflows|actions)/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|pom\.xml)|package/|build/mvn)')"
 >> $GITHUB_OUTPUT
+          echo "java=$(match     
'^(\.github/workflows/velox_backend_arm\.yml$|\.github/actions/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|pom\.xml)|package/|build/mvn)')"
 >> $GITHUB_OUTPUT

Review Comment:
   The `flink.yml` + `cpp/` example in item 2 of the PR description runs the 
same jobs before and after this change. Every job that checks `java` also 
accepts `cpp` (in x86 the spark-test-* jobs, `spark35_needed`, the TPC jobs, 
`build-fast-build-test` and `build-test-spark42`; here `tpc-test-centos8`), so 
once `cpp/` changes, `java` doesn't matter.
   
   The narrowing saves jobs when the run is relevant through a file that sets 
neither `java` nor `cpp`. In x86, `flink.yml` + `shims/spark35/...` used to run 
every Spark test job and now runs only spark35, spark35-slow and 
iceberg-spark-ut. Could you use an example like that in the description, since 
it becomes the commit message?



##########
.github/workflows/velox_backend_x86.yml:
##########
@@ -224,7 +224,7 @@ jobs:
           match() { echo "$changed" | grep -qE "$1" && echo true || echo 
false; }
 
           echo "cpp=$(match      '^(cpp/|ep/build-velox/|dev/)')"              
                              >> $GITHUB_OUTPUT
-          echo "java=$(match     
'^(\.github/(workflows|actions)/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|src-iceberg-upstream/|pom\.xml)|package/|build/mvn)')"
 >> $GITHUB_OUTPUT
+          echo "java=$(match     
'^(\.github/workflows/(velox_backend_x86|velox_native_build|iceberg_spark_ut|iceberg_upstream_revision)\.yml$|\.github/workflows/util/(parallel-ut/|iceberg-upstream/|install-spark-deps\.sh$)|\.github/actions/|pom\.xml|backends-velox/|gluten-(uniffle|celeborn|ras|core|substrait|arrow|delta|iceberg|hudi|paimon)/|gluten-ut/(common/|test/|src-iceberg-upstream/|pom\.xml)|package/|build/mvn)')"
 >> $GITHUB_OUTPUT

Review Comment:
   `install-spark-deps.sh` is in the new `java` regex here, and 
`tpc-test-ubuntu` does source it (lines 379, 387, 409), but it's missing from 
this workflow's `paths:` trigger and from the `paths` input to 
`squash-merge-upstream` at line 125. Since the status script now reads that 
input as the list of files this workflow tests, a fork PR that changes only 
this script, as #13012 did, gets a green "Not needed: this pull request changes 
no file this workflow tests".
   
   The gap in `paths` predates this PR, but the status text now tells the 
author the workflow doesn't test the file. Could you add 
`.github/workflows/util/install-spark-deps.sh` to both lists? Then the `java` 
entry here also applies when the script is the only file changed.



##########
.github/workflows/util/update-fork-build-status.js:
##########
@@ -179,11 +253,16 @@ module.exports = async ({ github, context, core }) => {
         // Two branches can share a head commit; the newer run keeps the 
status.
         if (at && at.id > run.id) continue;
         if (at && at.id == run.id && at.attempt == run.run_attempt && 
isFinal(current)) continue;
-        const next = statusOf(run, await jobsOf(pr, run));
-        const same = current && ['state', 'description', 
'target_url'].every((k) => current[k] == next[k]);
-        if (!same) await setStatus(pr, w, next);
-      } else if (!current) {
-        await setStatus(pr, w, { state: 'error', target_url: SETUP_URL, 
description: NO_RUN });
+        // An irrelevant run skips its jobs. Linking it makes the status final.
+        const next = (await isRelevant(w))
+          ? statusOf(run, await jobsOf(pr, run))
+          : { state: 'success', target_url: 
`${run.html_url}/attempts/${run.run_attempt}`, description: NOT_NEEDED };

Review Comment:
   When a fork run exists, this replaces its result with "Not needed" whenever 
no changed file passes the workflow's `paths`/`paths-ignore`, and it links the 
run's attempt, so line 255 treats the status as final and never looks at the 
run's result again. The two verdicts can disagree. The run diffs after 
squash-merging onto current main, and that merge follows renames main made 
after the branch point. If a PR edits only `cpp/bolt/Shared.cc` and main has 
since moved it to `cpp/core/Shared.cc`, the files API still lists 
`cpp/bolt/Shared.cc`, which `paths-ignore` drops, while the run builds and 
tests `cpp/core/Shared.cc`. If a job then fails, the PR stays green.
   
   The red error this PR targets only comes from the no-run branch below. 
Without this branch, a run that skips its jobs ends as "Passed in the fork", 
same as today. Could the run case keep `statusOf(run, ...)`?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to