unknowntpo opened a new pull request, #24410: URL: https://github.com/apache/kafka/pull/24410
The PR Linter re-wraps the PR description and writes it back. To do that, it has to guess the structure of the text. A wrong guess damages the description: adjacent trailers are joined into one line, and the rows of a Markdown table are joined into one paragraph. The re-wrap was added for the merge queue (KAFKA-19013). The merge queue is not in use on apache/kafka, and GitHub wraps long lines by itself when it builds the default squash commit message. So this PR removes the re-wrap. - `pr-format.py` only reads the PR. It never edits the description. - `pr-reviewers-trailer.py` is the only script that edits the description. It changes only the `Reviewers:` trailer in the last paragraph and keeps all other text byte for byte. - GitHub does not indent the lines that it wraps, and git does not read a wrapped `Reviewers:` line without indentation as a trailer. So the script folds the `Reviewers:` trailer itself. It breaks the line only after a comma, and each continuation line starts with a space. It also joins several `Reviewers:` trailers into one. - The script also runs when the description is edited. A committer can add reviewers by hand, separated by commas, and the script takes care of the format. - The PR Linter now fails when a `Reviewers:` line is not in a last paragraph that has only trailers. Before, git did not read such a line and the reviewers lost their credit without a warning. - There are unit tests for both scripts, and a workflow that runs them when the scripts change. The limits of this approach are listed in KAFKA-21579. I tested this on my fork with a real PR: edits of the description, the PR Linter status, and the commit message in the squash merge dialog. The review and comment triggers are covered only by the unit tests. -- 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]
