You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "xijiu (via GitHub)" <gi...@apache.org> on 2024/09/02 09:25:41 UTC

[PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

xijiu opened a new pull request, #17071:
URL: https://github.com/apache/kafka/pull/17071

   As title, see https://github.com/apache/kafka/actions/runs/10534117374/jobs/21477070226/summary_raw
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "mumrah (via GitHub)" <gi...@apache.org>.
mumrah commented on code in PR #17071:
URL: https://github.com/apache/kafka/pull/17071#discussion_r1751065157


##########
.github/scripts/junit.py:
##########
@@ -95,6 +96,9 @@ def parse_report(workspace_path, report_path, fp) -> Iterable[TestSuite]:
                 test_case_failed = False
             elif elem.tag == "failure":
                 failure_message = elem.get("message")
+                if failure_message:
+                    failure_message = failure_message.replace('\n', '<br>').replace('\r', '<br>')
+                    failure_message = html.escape(failure_message)

Review Comment:
   I think these should be reversed. Otherwise the `<br>` will get escaped and not actually rendered as HTML



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "xijiu (via GitHub)" <gi...@apache.org>.
xijiu commented on PR #17071:
URL: https://github.com/apache/kafka/pull/17071#issuecomment-2333103846

   > @xijiu Could you please rebase code to trigger github CI again?
   
   @chia7712  Sure, I have rebased, PTAL


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "xijiu (via GitHub)" <gi...@apache.org>.
xijiu commented on PR #17071:
URL: https://github.com/apache/kafka/pull/17071#issuecomment-2339555015

   @mumrah  
   
   Hello David, I have fixed the code,  PTAL


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "xijiu (via GitHub)" <gi...@apache.org>.
xijiu commented on code in PR #17071:
URL: https://github.com/apache/kafka/pull/17071#discussion_r1751206898


##########
.github/scripts/junit.py:
##########
@@ -95,6 +96,9 @@ def parse_report(workspace_path, report_path, fp) -> Iterable[TestSuite]:
                 test_case_failed = False
             elif elem.tag == "failure":
                 failure_message = elem.get("message")
+                if failure_message:
+                    failure_message = failure_message.replace('\n', '<br>').replace('\r', '<br>')
+                    failure_message = html.escape(failure_message)

Review Comment:
   Yeah, you are right, I should adjust the order



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

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


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "xijiu (via GitHub)" <gi...@apache.org>.
xijiu commented on PR #17071:
URL: https://github.com/apache/kafka/pull/17071#issuecomment-2335010169

   > @xijiu thanks for the patch! I think we can replace newlines with `<br>` to preserve some of the formatting. Also, we should probably escape any HTML-looking things in the output to avoid similar formatting problems in the future.
   > 
   > In Python there is `html.escape` for this.
   > 
   > Also, a small tip: you can use the PR comments as a sandbox for testing Github flavored markdown.
   
   @mumrah   
   Hi David, thanks very much for the code review, and the tip is very useful.
   I have fixed the code, PTAL


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-17418: Fix the incorrect markdown of junit.py caused by newline character [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on PR #17071:
URL: https://github.com/apache/kafka/pull/17071#issuecomment-2326172142

   @xijiu Could you please rebase code to trigger github CI 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: jira-unsubscribe@kafka.apache.org

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