yihua commented on code in PR #20421:
URL: https://github.com/apache/hudi/pull/20421#discussion_r4355622202


##########
.github/workflows/validate_source.yml:
##########
@@ -20,21 +22,118 @@ concurrency:
   cancel-in-progress: ${{ !contains(github.ref, 'master') && 
!contains(github.ref, 'branch-0.x') && !contains(github.ref, 'release-') }}
 
 jobs:
-  # [CI-TRIM] to revisit for CI improvement
-  # This only blocks PRs whose checks predate the matrix trim (#19514). Since 
bot.yml and
-  # java_ci_engines.yml are path-filtered, a green result here no longer means 
any Java CI
-  # job ran; reviewers gate on the checks the PR shows. Delete under #19535.
-  validate-ci-baseline:
-    runs-on: ubuntu-24.04
-    steps:
-      - name: Confirm CI ran against the reduced matrix
-        run: echo "Ran against the reduced CI matrix."
-
-  validate-source:
+  # The only required status check in .asf.yaml. It runs every short check (PR 
metadata, source
+  # release) so each PR event spends one runner. It replaces 
validate-ci-baseline: PRs whose last
+  # run predates this job never reported its name, so they cannot merge on 
stale checks until a new
+  # push or a close and reopen runs it. A re-run of an old run does not help, 
as it replays the old
+  # workflow file.
+  validate-pr-and-source:
     runs-on: ubuntu-24.04
+    env:
+      # The metadata checks only apply to PRs. release-* PRs (backports, "[DO 
NOT MERGE] Validate
+      # rc bundles") were never subject to them.
+      CHECK_PR_METADATA: ${{ github.event_name == 'pull_request' && 
!startsWith(github.base_ref, 'release-') }}
     steps:
       - uses: actions/checkout@v5
+
+      # PR metadata checks. Each takes seconds, so they share this job instead 
of spending a runner
+      # of their own. Every step from here on runs even when an earlier one 
fails, so one run
+      # reports every problem; the failed step's name says which check it was.
+      - name: Check PR description
+        if: ${{ env.CHECK_PR_METADATA == 'true' }}
+        env:
+          REQUEST_BODY: ${{ github.event.pull_request.body }}
+          REQUEST_TITLE: ${{ github.event.pull_request.title }}
+        run: python3 scripts/pr_compliance.py
+
+      # Seconds of stdlib-only unit tests, so they run on every PR instead of 
path-filtering
+      # on scripts/pr_compliance.py. The log goes to the runner temp dir: the 
source checks below
+      # copy and scan the workspace, and a stray test.log has no license 
header.
+      - name: Test pr_compliance.py
+        if: ${{ !cancelled() && env.CHECK_PR_METADATA == 'true' }}
+        run: python3 scripts/pr_compliance.py run-tests > 
"$RUNNER_TEMP/test.log" || { echo "::error::pr_compliance.py $(cat 
"$RUNNER_TEMP/test.log")" && exit 1; }

Review Comment:
   nit: are we still going to see the log? In case the validation fails, is the 
PR author able to figure out the root cause?



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

Reply via email to