Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use commit.comitter instead of commit.author in validation #40

Closed
wants to merge 2 commits into from

Conversation

bndw
Copy link

@bndw bndw commented Sep 29, 2017

Uses commit.commiter instead of commit.author in name and email validation. Related to #39

Signed-off-by: bndw benjamindwoodward@gmail.com

Signed-off-by: bndw <benjamindwoodward@gmail.com>
Signed-off-by: bndw <benjamindwoodward@gmail.com>
Copy link
Contributor

@hiimbex hiimbex left a comment

Choose a reason for hiding this comment

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

LGTM! I wonder if instead of adding that conditional which makes the tests pass, we should should update the tests to use a mock committer object instead of that of an author

Copy link
Contributor

@bkeepers bkeepers left a comment

Choose a reason for hiding this comment

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

Thanks for opening the pull request!

I think we'll want to consult with someone more familiar with the DCO to check if this is valid.

@mkdolan @caniszczyk: Is there someone you recommend that we could nominate as our ombud for this issue and future questions about the DCO?

@@ -27,14 +27,17 @@ module.exports = function (commits) {
signedOff = false
defaults.failure.description = `The sign-off is missing.`
} else {
if (!validator.validate(commit.author.email)) {
let email = commit.committer ? commit.committer.email : commit.author.email
let name = commit.committer ? commit.committer.name : commit.author.name
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that I'm seeing this, I wonder if it should attempt to check against both committer and author.

For example, I could open a pull request with:

  1. commits from me, in which case it could match either committer or author
  2. commits from someone else that already included a sign-off, in which case it would match the author
  3. commits from someone that didn't include a sign-off but I added a sign-off, in which case it would match the committer

Copy link
Author

Choose a reason for hiding this comment

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

The issue I ran into that prompted this PR was the case where I had signed a commit with one account (committer and email are the same) and later rebased and signed the commit with a different account (only committer). In this case, the author and committer will be different which was unexpected because, in my case, there was only a single commit on a PR and I could visually see it was signed by email address b (but the DCO check was looking for address a)

Copy link
Author

Choose a reason for hiding this comment

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

I agree checking both committer and author seems like the more robust solution. And, really, the above situation I got in is likely one that could be solved outside of this tool, perhaps by updating the README with more details on how this works and common troubleshooting steps.

@hiimbex
Copy link
Contributor

hiimbex commented Sep 29, 2017

I wonder if it should attempt to check against both committer and author.

Yea I mentioned that in the issue too. I'm not sure whether the committer or author should be the default or whether to use both. If we do use both, which makes more sense to display in the error message?

@mkdolan
Copy link

mkdolan commented Oct 2, 2017

I'm not sure I understand enough about how probot works, but the DCO allows for someone to assert that they have the rights to contribute code even if they were not the author. See DCO section (c), also (b).

@bndw
Copy link
Author

bndw commented Jan 3, 2018

@bkeepers was there a concrete change you were looking for here?

@bkeepers
Copy link
Contributor

bkeepers commented Jan 4, 2018

was there a concrete change you were looking for here?

I think it should match on either the committer or the author. Right now it uses the committer if present, or falls back to the author.

This will currently break if someone pushes a commit that already includes a signoff from another author.

@stale
Copy link

stale bot commented Apr 5, 2018

Is this still relevant? If so, please comment with any updates or addition details.

@stale stale bot added the wontfix label Apr 5, 2018
@stale stale bot closed this Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants