-
Notifications
You must be signed in to change notification settings - Fork 79
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
C H E C K S A P I S U P P O R T π€© #79
Conversation
omg Iβm in love!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a quick glance this looks awesome. I haven't had a chance to review the code yet, but love the functionality.
Is there any way we could "staff ship" this big of a change to allow people to opt in to the new behavior?
Could we separate out the upgrade to Probot 7.0 from the changes in functionality?
}, | ||
actions: [{ | ||
label: 'Set DCO to pass', | ||
description: 'would set status to passing', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to get eyes on this from a legal perspective to make sure that a this is worded properly. Something like "Accept DCO" and "I certify that my contributions fall under the Developer Certificate of Origin: https://developercertificate.org/"
@caniszczyk @mlinksva: could you recommend someone to help here?
Also, I wonder if there should be a separate "Dismiss" vs "Accept" buttons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's important to note this option is only accessible for users with write access to the repo.
We get quite a few requests for new users to not have to use git so painfully, so if the maintainers of a repo are happy with the user's comments that they "accept" the DCO, might as well give them a free status pass button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something, but this looks to me like a way for a maintainer to ignore the test, not for a contributor to agree their contributions are covered by the DCO.
Added: as @hiimbex wrote faster. π³
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, sorry, I totally wasn't thinking about who would be the one clicking the button.
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Brandon Keepers <[email protected]> Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Brandon Keepers <[email protected]> Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Brandon Keepers <[email protected]> Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Tests are now working! @bkeepers I'm blaming you 100% for the DCO failing (also a good motivator to implement #75 at some point).
I'm wondering if you still think this is necessary given that the 'set DCO to passing' otpion is only for those with write access. If you still this is something we should pursue, I'm not sure the best path forward for something like this. Maybe an additional .env variable? I personally don't think a staff ship is necessary since the only functionality change is giving maintainers a button and using checks not statuses (it should still work in the same way). The other big update that goes with this is updating the permissions the app uses; however, now we get to write a note explaining why! I'm happy to craft one explaining this PR super in depth, so our users know why this change is happening. But whenever you have β³ this is ready for π! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing this out locally now and will have more feedback, but first thing I noticed is that there a bunch of undefined
s in the tests. Is that just bad test data, or is there something broken?
test/dco.test.js
Outdated
const dcoObject = await getDCOStatus([{commit, author: { login: 'hiimbex' }, parents: []}], alwaysRequireSignoff, prInfo) | ||
|
||
expect(dcoObject).toEqual([{ | ||
url: 'https://github.com/hiimbex/testing-things/pull/1/commits/undefined', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkeepers I honestly thought I updated this. All that needs to change is the fake data passed into each test needs a sha
value, for example:
const dcoObject = await getDCOStatus([{commit, author: { login: 'bkeepers' }, parents: []}], alwaysRequireSignoff, prInfo)
should be:
const dcoObject = await getDCOStatus([{commit, author: { login: 'bkeepers' }, parents: [], sha: '318g9hnf02b49uthisisasha'}], alwaysRequireSignoff, prInfo)
The code that actually makes this change is here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave this a try and it looks pretty good. Eventually I'd love to chat about refactoring some of this code, but it can wait until after this feature lands.
} | ||
|
||
function handleMultipleCommits (pr, commitLength, dcoFailed) { | ||
return `You only have ${dcoFailed.length} commits incorrectly signed off! To fix, head to your local branch and run: \n\`\`\`bash\ngit rebase HEAD~${commitLength} --signoff\n\`\`\`\n Now your commits will have your sign off. Next run \n\`\`\`bash\ngit push --force origin ${pr.head.ref}\n\`\`\`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes the commits missing the DCO are always the last n
commits. What if I have 5 commits, but the one in the middle properly has the DCO?
Could we just have the user rebase based on the base
of the pull request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, butgit push --force origin ${pr.head.ref}
does exactly what you're describing. I was originally trying to do something fancy with commitLength
but I think it's actually dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so I forgot what I actually did. So commitLength
actually is the number of total commits in the PR, so you always rebase and sign off all of those commits, no matter which ones were wrong via:
git rebase HEAD~${commitLength} --signoff
which utilizes this rebase option. And then does:
git push --force origin ${pr.head.ref}
lib/dco.js
Outdated
@@ -22,23 +17,34 @@ module.exports = async function (commits, isRequiredFor) { | |||
} | |||
const match = regex.exec(commit.message) | |||
|
|||
const commitInfo = { | |||
sha, | |||
url: `https://github.com/${prInfo.owner}/${prInfo.repo}/pull/${prInfo.number}/commits/${sha}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using context.payload.pull_request.html_url
as the base for this?
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Just confirmed via hiimbex/testing-things#71 that the existing PRs that swap mid-way from the old statuses to checks don't need any special work or support. The re-written check will overwrite the status. |
Tests are failing due to jestjs/jest#6769 and will I think be fixed in a new Jest release? But it's compeltley unrelated to my changes. Would love a re-review based on the updates whenever you've got a chance @bkeepers π |
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Signed-off-by: Bex Warner <[email protected]>
Update docs to reflect swap to checks api
Consider it π’ d!! π |
THANK YOU!
β¦On Wed, Aug 22, 2018 at 2:09 PM, Bex Warner ***@***.***> wrote:
Consider it π’ d!! π
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#79 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD5ITSi2pbiUE9DCM8BlkCEvim5CCV8ks5uTaxtgaJpZM4VEr_o>
.
--
Cheers,
Chris Aniszczyk
http://aniszczyk.org
+1 512 961 6719
|
π This PR is included in version 1.0.0 π The release is available on GitHub release Your semantic-release bot π¦π |
What this PR does:
lib/dco.js
to return an array of error messages objects like:test/dco.test.js
to support that format πgit commit --amend --signoff
for a mistake in the most recent commitgit rebase Head~$numOfCommits --signoff
for mistakes in multiple commitsgit push --force origin $your-branch
LOOK AT HOW PRETTY IT IS
All commits are signed off:
One commit incorrectly signed off:
Multiple commits incorrectly signed off:
Override button (only visible for those with repo write access):
Todo:
test/index.test.js
to v7 and update tests. (tbh I don't fully understand how this test worked before, so not sure how to convert it!)cc/ @probot/maintainers @kytrinyx for π& π's