Skip to content

Conversation

@JakobJingleheimer
Copy link
Member

Co-authorship lines contain an email address which is very likely longer than 72 characters (any github-anonymised email address), which cannot be broken across multiple lines.

@JakobJingleheimer
Copy link
Member Author

@targos strangely, I can't tag people for review O.o

cc @joyeecheung

// Skip lines with URLs.
if (/https?:\/\//.test(line)) { continue }
// Skip co-authorship.
if (line.startsWith('Co-Authored-By')) { continue }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more useful to properly validate the format (i.e. flag Co-authored-by: Author Name But No Email, etc.)

Also, could you add tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email is what causes the issue though

JakobJingleheimer and others added 4 commits December 22, 2025 10:40
Co-authored-by: Michaël Zasso <targos@protonmail.com>
per existing `co-authored-by-is-trailer` rule's regex
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Comment on lines 141 to 144
message: `
fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>
`
Copy link
Contributor

@aduh95 aduh95 Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good test, it passes without your patch because of the leading spaces

Suggested change
message: `
fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>
`
message: [
'fixup!: apply case-insensitive suggestion',
'Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>',
].join('\n')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should fail though, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good regression test fails without the patch, and passes with it. Currently the test passes with and without your patch. If we want a good regression test (we do), we want one that fails without the patch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean it seems suspicious that it isn't failing, which would suggest the implementation is bugged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered why the test is suspiciously passing:

// Skip quoted lines, e.g. for original commit messages of V8 backports.
if (line.startsWith(' ')) { continue }

Copy link
Member Author

@JakobJingleheimer JakobJingleheimer Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(@aduh95 I don't know what to do about it)

// Skip lines with URLs.
if (/https?:\/\//.test(line)) { continue }
// Skip co-authorship.
if (/^co-authored-by:/i.test(line)) { continue }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm not sure it's worth doing, but we could have a shared util to avoid duplicating the regex

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I think if we need it in a third place, then it's worth having a shared util.

@Ewelkaka

This comment was marked as off-topic.

@JakobJingleheimer JakobJingleheimer force-pushed the feat/support-coauthorship branch 2 times, most recently from 73cd024 to 8016e6a Compare January 12, 2026 19:36
@JakobJingleheimer JakobJingleheimer force-pushed the feat/support-coauthorship branch from 8016e6a to f05715d Compare January 12, 2026 19:39
Comment on lines +141 to +142
const overlongMessage = `fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>`
Copy link
Contributor

@aduh95 aduh95 Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const overlongMessage = `fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>`
const overlongMessage = [
'fixup!: apply case-insensitive suggestion',
'Co-authored-by Michaël Zasso <37011812+targos@users.noreply.github.com>'
].join('\n')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test-case is asserting it correctly errors. Your proposed change would cause it to not error (and then it's the same case as the other one added in this PR).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it not error? Mind the lack of :, it should error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (lack of) leading spaces

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how relevant are the leading spaces for the code you're adding, it feels much more likely to me that someone would forgot to add / remove by mistake the colon rather than add leading spaces. Anyway, I'm just trying to suggest something to help you get a green CI, feel free to fix the test another way

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You requested this test-case though. If you don't want it, I'll just remove it and CI will be green.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I did, removing it sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants