You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "voonhous (via GitHub)" <gi...@apache.org> on 2026/10/23 03:03:18 UTC

[PR] chore(ci): show pr_compliance.py self-test failures [hudi]

voonhous opened a new pull request, #20422:
URL: https://github.com/apache/hudi/pull/20422

   ### Describe the issue this Pull Request addresses
   
   Follow-up to a review nit on #20421 (r4355622202): when the `pr_compliance.py` self-tests fail, can the author see why? The log did print, but behind one `::error::`, so the annotation showed only the first log line (a passing test) and the failures sat unlabelled in the step log.
   
   ### Summary and Changelog
   
   On failure, the "Test pr_compliance.py" step now prints the full log and raises one annotation naming the failed tests, e.g. `pr_compliance.py self-tests failed: bad title,bad body`. A passing run stays quiet, and the log still goes to the runner temp dir.
   
   This step only tests `pr_compliance.py` itself; a PR's own description problems are reported by the "Check PR description" step, which is unchanged.
   
   ### Impact
   
   CI output only.
   
   ### Risk Level
   
   none
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [ ] Adequate tests were added if applicable
   


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "yihua (via GitHub)" <gi...@apache.org>.
yihua commented on code in PR #20422:
URL: https://github.com/apache/hudi/pull/20422#discussion_r4356379051


##########
.github/workflows/validate_source.yml:
##########
@@ -48,10 +48,17 @@ jobs:
 
       # 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.
+      # copy and scan the workspace, and a stray test.log has no license header. A passing run
+      # stays quiet; a failing one prints the full log and names the failed tests in the annotation.
       - 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; }
+        run: |

Review Comment:
   Make sure to validate that different PR and source violations are surfaced in the log so PR author knows how to fix.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on PR #20422:
URL: https://github.com/apache/hudi/pull/20422#issuecomment-6378601796

   Rebased again.


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on code in PR #20422:
URL: https://github.com/apache/hudi/pull/20422#discussion_r4359380496


##########
.github/workflows/validate_source.yml:
##########
@@ -48,10 +48,17 @@ jobs:
 
       # 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.
+      # copy and scan the workspace, and a stray test.log has no license header. A passing run
+      # stays quiet; a failing one prints the full log and names the failed tests in the annotation.
       - 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; }
+        run: |
+          log="$RUNNER_TEMP/test.log"
+          if ! python3 scripts/pr_compliance.py run-tests > "$log"; then
+            cat "$log"
+            echo "::error::pr_compliance.py self-tests failed: $(sed -n 's/ - FAILED$//p' "$log" | paste -sd ',' -)"

Review Comment:
   Done in f4faa406825e.



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on code in PR #20422:
URL: https://github.com/apache/hudi/pull/20422#discussion_r4359475299


##########
.github/workflows/validate_source.yml:
##########
@@ -48,10 +48,17 @@ jobs:
 
       # 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.
+      # copy and scan the workspace, and a stray test.log has no license header. A passing run
+      # stays quiet; a failing one prints the full log and names the failed tests in the annotation.
       - 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; }
+        run: |

Review Comment:
   Tested in a separate PR here #20424:
   Summary page contains instructions on how to fix:
   https://github.com/apache/hudi/actions/runs/39952344062?pr=20424
   
   
   Screenshot is shown below:
   <img width="1822" height="1536" alt="image" src="https://github.com/user-attachments/assets/8c3996b4-b026-4efb-8222-10f74adf50e3" />
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #20422:
URL: https://github.com/apache/hudi/pull/20422#issuecomment-6356832509

   ## [Codecov](https://app.codecov.io/gh/apache/hudi/pull/20422?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 80.80%. Comparing base ([`1c54bd3`](https://app.codecov.io/gh/apache/hudi/commit/1c54bd382ad9b37a004ba7ec785ca3ebc3c70a84?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bc0b690`](https://app.codecov.io/gh/apache/hudi/commit/bc0b6902ba98b8e01277e604bb9431e933715548?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff            @@
   ##             master   #20422   +/-   ##
   =========================================
     Coverage     80.80%   80.80%           
   - Complexity    35892    35893    +1     
   =========================================
     Files          2575     2575           
     Lines        146762   146762           
     Branches      17984    17984           
   =========================================
   + Hits         118594   118596    +2     
   + Misses        20030    20029    -1     
   + Partials       8138     8137    -1     
   ```
   
   | [Components](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hudi-common](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.18% <ø> (+<0.01%)` | :arrow_up: |
   | [hudi-client](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.99% <ø> (ø)` | |
   | [hudi-flink](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.15% <ø> (ø)` | |
   | [hudi-spark-datasource](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.20% <ø> (ø)` | |
   | [hudi-utilities](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `79.21% <ø> (ø)` | |
   | [hudi-cli](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.80% <ø> (ø)` | |
   | [hudi-hadoop](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.18% <ø> (ø)` | |
   | [hudi-sync](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `76.57% <ø> (ø)` | |
   | [hudi-io](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.57% <ø> (ø)` | |
   | [hudi-timeline-service](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.41% <ø> (ø)` | |
   | [hudi-cloud](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.01% <ø> (ø)` | |
   | [hudi-kafka-connect](https://app.codecov.io/gh/apache/hudi/pull/20422/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.90% <ø> (ø)` | |
   
   | [Flag](https://app.codecov.io/gh/apache/hudi/pull/20422/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hadoop-mr-java-client](https://app.codecov.io/gh/apache/hudi/pull/20422/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `43.95% <ø> (+0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   [see 1 file with indirect coverage changes](https://app.codecov.io/gh/apache/hudi/pull/20422/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "wombatu-kun (via GitHub)" <gi...@apache.org>.
wombatu-kun commented on code in PR #20422:
URL: https://github.com/apache/hudi/pull/20422#discussion_r4356172648


##########
.github/workflows/validate_source.yml:
##########
@@ -48,10 +48,17 @@ jobs:
 
       # 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.
+      # copy and scan the workspace, and a stray test.log has no license header. A passing run
+      # stays quiet; a failing one prints the full log and names the failed tests in the annotation.
       - 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; }
+        run: |
+          log="$RUNNER_TEMP/test.log"
+          if ! python3 scripts/pr_compliance.py run-tests > "$log"; then
+            cat "$log"
+            echo "::error::pr_compliance.py self-tests failed: $(sed -n 's/ - FAILED$//p' "$log" | paste -sd ',' -)"

Review Comment:
   nit: the annotation's list comes out empty when the run crashes before any test prints `FAILED` (a traceback, or one of the script's own `exit()` calls), and the `Swapped sections: {i}, {k}` names already contain a comma, so the comma-joined list does not split cleanly. Could we join with `;` and fall back to something like `see the step log` when nothing matched?



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous commented on code in PR #20422:
URL: https://github.com/apache/hudi/pull/20422#discussion_r4359506402


##########
.github/workflows/validate_source.yml:
##########
@@ -48,10 +48,17 @@ jobs:
 
       # 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.
+      # copy and scan the workspace, and a stray test.log has no license header. A passing run
+      # stays quiet; a failing one prints the full log and names the failed tests in the annotation.
       - 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; }
+        run: |

Review Comment:
   We tested the below and the failure messages are shown:
   | # | Violation planted in the demo | Annotation |
   |---|---|---|
   | 1 | PR description doesn't follow the template | "Please make sure you have filled out the template correctly..." |
   | 2 | PR title type `DNM` isn't allowed | `Unknown release type "DNM"...` plus the allowed types |
   | 3 | Commit `bdda9f6` has a `Co-authored-by: Claude` trailer | "Commits with a Claude co-author trailer: bdda9f6... Remove the trailer (amend or rebase) and force-push." (new) |
   | 4 | `pr_compliance.py` broken (simulated) | "pr_compliance.py self-tests failed: Swapped sections: 0, 1; ..." |
   | 5 | `demo-validation-failures/binary.bin` is a binary file | "Binary file in the source release..." on that file (new) |
   | 6 | `no_license_header.py` and `binary.bin` lack the ASF header | "Missing the ASF license header..." on each file (new) |
   | 7 | RAT flags `no_license_header.py` | "RAT found no approved license header..." on that file (new) |
   



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore(ci): show pr_compliance.py self-test failures [hudi]

Posted by "voonhous (via GitHub)" <gi...@apache.org>.
voonhous merged PR #20422:
URL: https://github.com/apache/hudi/pull/20422


-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org