Problem
When the webhook server cherry-picks a squash-merged commit, the DCO check on the cherry-pick PR fails because:
- GitHub squash-merge rewrites the commit author email to the noreply format (e.g.,
86722603+user@users.noreply.github.com)
- The
Signed-off-by trailer preserves the original email (e.g., user@redhat.com)
git cherry-pick replays the commit with the mismatched emails
- The DCO app checks that
Signed-off-by email matches the commit author email → fails
This requires manual sign-off approval for every cherry-picked PR.
Root Cause
GitHub's squash-merge changes the commit author identity from the real email to the GitHub noreply format, but preserves the original Signed-off-by trailer verbatim. The cherry-pick faithfully reproduces this mismatch.
Solution
Add _restore_original_author_for_cherry_pick() to runner_handler.py that:
- Extracts the
Signed-off-by trailer from the cherry-picked commit message
- Compares the sign-off email against the current commit author email
- If they differ, amends the commit author to match the sign-off (restoring the original PR owner's identity)
- Called after successful cherry-pick (clean or AI-resolved) before push
Deliverables
References
Problem
When the webhook server cherry-picks a squash-merged commit, the DCO check on the cherry-pick PR fails because:
86722603+user@users.noreply.github.com)Signed-off-bytrailer preserves the original email (e.g.,user@redhat.com)git cherry-pickreplays the commit with the mismatched emailsSigned-off-byemail matches the commit author email → failsThis requires manual sign-off approval for every cherry-picked PR.
Root Cause
GitHub's squash-merge changes the commit author identity from the real email to the GitHub noreply format, but preserves the original
Signed-off-bytrailer verbatim. The cherry-pick faithfully reproduces this mismatch.Solution
Add
_restore_original_author_for_cherry_pick()torunner_handler.pythat:Signed-off-bytrailer from the cherry-picked commit messageDeliverables
_restore_original_author_for_cherry_pick()method toRunnerHandlercherry_pick()before pushReferences