Giter VIP home page Giter VIP logo

Comments (14)

bndw avatar bndw commented on August 25, 2024 2

Ok that makes sense, I was able work around this by amending the author on my commit.

I'll leave this issue open since it sounds like there's some discussion to take place. Thanks again @hiimbex 😄

from app.

hiimbex avatar hiimbex commented on August 25, 2024

Hiya! Just commented in envoyproxy/envoy#1743 (comment) but basically, as long as the git config is set to the correct email, say email a. As long as the commit is signed with email a, the bot should correctly approve the commit.

from app.

bndw avatar bndw commented on August 25, 2024

Hey, thanks for the quick response!

git config --global -l
user.name=bndw
[email protected]

I just rebased, signed with that account, and force pushed envoyproxy/envoy@75c2374 to envoyproxy/envoy#1768, but it's still reporting:

DCO — Expected "bndw <[email protected]>", but got "bndw <[email protected]>"

Anything else to try?

from app.

hiimbex avatar hiimbex commented on August 25, 2024

Ah, you're completely right, I was able to recreate this here: probot/test#24. This is definitely an issue on our end.

This is not behavior I expect, but it appears to be due to our use of the GitHub API here: https://developer.github.com/v3/repos/commits/#compare-two-commits

The API call we're using has this data:

"commit": {
  "author": {
        "name": "Monalisa Octocat",
        "email": "[email protected]",
        "date": "2011-04-14T16:00:49Z"
      },
  "committer": {
        "name": "Monalisa Octocat",
        "email": "[email protected]",
        "date": "2011-04-14T16:00:49Z"
      }
 }

We do our checks using commit.author.email:
https://github.com/probot/dco/blob/3e486021f8333df5c957e9b12c53bca1d9c7ba5f/lib/dco.js#L30-L35

When you rebase, the committer email is probably the one that gets updated, and I think it should be the one we use. So, I think on our end we should swap to commit.comitter.email. Thoughts @bkeepers ?

from app.

bndw avatar bndw commented on August 25, 2024

Nice find! Another test potentially worth running would be to specify the author on the rebased commit and see if that updates the check?

But using commit.comitter.email makes sense to me.

from app.

hiimbex avatar hiimbex commented on August 25, 2024

Another test potentially worth running would be to specify the author on the rebased commit and see if that updates the check?

It would be my suspicion that that would work! Not super familiar with all the rebase options, so I didn't even realize you could update the author 🙇 let me know if that works!

from app.

bndw avatar bndw commented on August 25, 2024

Just tried this but it didn't appear to update the check. In my commit message, I specified the following but it's still using the old author:

My commit message

Signed-off-by: bndw <[email protected]>
Author:    bndw <[email protected]>

from app.

hiimbex avatar hiimbex commented on August 25, 2024

Hmm I believe it's because you need to use git commit --amend --author="Author Name <[email protected]>" after an interactive rebase (not my strong suit lol). But this worked here: probot/test#24 for me. I did git rebase -i my_commit and then added x git commit --amend --author="Author Name <[email protected]>" at the top and saved and force pushed.

from app.

bndw avatar bndw commented on August 25, 2024

Excellent, this workaround should unblock the linked PR!

Just to be clear, the steps to change the author were:

  1. interactive rebase
  2. In the commit message, add this line to the top, above the message? x git commit --amend --author="Author Name <[email protected]>"

from app.

hiimbex avatar hiimbex commented on August 25, 2024

Yes! To clarify, the x in interactive rebased represents exec, so I did this through vim (not in the commit message itself) and deleted the first line which was noop and replaced it with x git commit --amend --author="Author Name <[email protected]>" and upon saving that and then force pushing, that updated the author for me.

For the purposes of the future, I'm somewhat unsure of whether the DCO should be based on the author or the committer, so I'd be open to input from some of the linux folks who use the bot on what they think.

from app.

bkeepers avatar bkeepers commented on August 25, 2024

So, I think on our end we should swap to commit.comitter.email. Thoughts @bkeepers ?

👍 Great catch! Sounds good to me.

from app.

stale avatar stale commented on August 25, 2024

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

from app.

bndw avatar bndw commented on August 25, 2024

Looks like people are still hitting this issue, but I'm not able to allocate anymore time to it.

from app.

github-actions avatar github-actions commented on August 25, 2024

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

from app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.