Yicong-Huang opened a new pull request, #4696:
URL: https://github.com/apache/texera/pull/4696

   ### What changes were proposed in this PR?
   
   Direct backports currently append the `(backported from commit X)` note at 
the very end of the commit message. Because GitHub's squash-merge messages 
already carry a trailer block (`Co-Authored-By:` etc.) at the end, the note 
ends up *after* the trailers:
   
   ```
   fix: foo
   
   Body.
   
   Closes #123.
   
   Co-Authored-By: Claude Opus 4.7 <[email protected]>
   
   (backported from commit abc1234)        ← currently here
   ```
   
   Git treats the trailer block as the contiguous run of `Key: value` lines at 
the very end of the message, separated from the body by a blank line. With a 
non-trailer line trailing the trailer block, `git interpret-trailers --parse` 
sees zero trailers — tools that read Co-Authored-By, Signed-off-by, etc. lose 
the metadata for backport commits.
   
   This PR re-orders the composition so the body comes first, then the 
`(backported from commit X)` note as its own paragraph, then the trailer block 
at the very end:
   
   ```
   fix: foo
   
   Body.
   
   Closes #123.
   
   (backported from commit abc1234)        ← moved here
   
   Co-Authored-By: Claude Opus 4.7 <[email protected]>
   ```
   
   A small Python step inside the workflow splits the original message at the 
trailer boundary using the standard `^[A-Za-z][A-Za-z0-9-]*:\s` heuristic and 
reassembles. Cases handled:
   
   | input | output |
   |---|---|
   | body + trailers | body + blank + note + blank + trailers |
   | body, no trailers | body + blank + note |
   | multiple trailers | body + blank + note + blank + all trailers contiguous |
   
   ### Any related issues, documentation, discussions?
   
   None — incidental fix to the backport job alongside the broader CI cleanup 
work.
   
   ### How was this PR tested?
   
   Ran the assembled Python step locally against three synthetic messages 
(body+1 trailer, no trailers, multiple trailers) and verified the output places 
the note before the trailer block in every case. The next direct-backport CI 
run on this branch's merge will exercise the path end-to-end.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7, 1M context)
   


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