Skip to content

Conversation

mathieuchopstm
Copy link
Contributor

Commit e4650bc modified check_compliance to avoid false negatives when a commit has multiple signoff lines and the author's signoff line isn't the first one. To avoid this, a signoff line which matches exactly the author's name and email is searched instead of matching any line with the proper syntax and checking the fields.

While this solved the original issue, this also introduced a new issue: the old script distinguished a properly formed signoff line with the wrong author from a malformed signoff line, but the new method perfoms both the syntax and the author name/email checks at the same time. As such, if any of these fail, the script will report signoff line does not follow the syntax even though the signoff line DOES follow the syntax in the latter case. This makes the error message nothing but a misleading red herring, which is quite unfortunate considering this situation is much more likely to occur than the "malformed syntax" one.

Example here: https://github.com/zephyrproject-rtos/zephyr/actions/runs/16752997174/job/47427937294?pr=93699#step:10:47

Fix this issue - and improve the check - by actually verifying every signoff line in a commit's message body. Invalid syntax on any line is reported as a does not follow syntax failure, whereas inability to find the commit author is reported as a separate no signoff entry matches commit author failure as it should always have...

+ tiny commit to fix a potential issue reported by VS Code's linter that would occur if git show failed (this has presumably never happened since the bug is still here 🙂)

When checking for emails/sign-off, if parsing of the commit information
using 'git show' fails, the 'auth_name', 'auth_email' and 'body' variables
are unbound but accessed right afterwards, which would cause an error.

Skip straight to next iteration of the loop when such an error occurs to
ensure access to the unbound variables is never performed.

This error was reported by the VS Code Pylance analyzer.

Signed-off-by: Mathieu Choplain <[email protected]>
Commit e4650bc modified check_compliance
to avoid false negatives when a commit has multiple signoff lines and the
author's signoff line isn't the first one. To avoid this, a signoff line
which matches exactly the author's name and email is searched instead of
matching any line with the proper syntax and checking the fields.

While this solved the original issue, this also introduced a new issue:
whereas the old script would distinguish a properly formed signoff line
with the wrong author from a malformed signoff line, the new method now
checks both the syntax and the author name/email at the same time. As
such, the script will report "signoff line does not follow the syntax"
for both situations, but the signoff line DOES follow the syntax in the
latter case: the error message is then only a misleading red herring.

Fix this issue - and improve the check - by verifying every signoff line
in a commit's message body. Invalid syntax on any line is reported as a
"does not follow syntax" failure, whereas inability to find the commit
author is reported as a separate "no signoff entry matches commit author"
failure as it should always have...

Signed-off-by: Mathieu Choplain <[email protected]>
Copy link

sonarqubecloud bot commented Oct 1, 2025

@cfriedt cfriedt merged commit 33a7b65 into zephyrproject-rtos:main Oct 4, 2025
30 checks passed
@mathieuchopstm mathieuchopstm deleted the fix_compliance_signedoff branch October 7, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants