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

docs(dev): Add instructions for automating DCO checks #33

Merged
merged 7 commits into from Aug 8, 2019

Conversation

@StoneyJackson
Copy link
Collaborator

commented Aug 3, 2019

No description provided.

@StoneyJackson StoneyJackson requested a review from cradkowski Aug 3, 2019

docs(dev): Add instructions for automating DCO checks
Signed-off-by: Stoney Jackson <dr.stoney@gmail.com>

@StoneyJackson StoneyJackson force-pushed the automating-dco-checks branch from 2866035 to 20174e8 Aug 3, 2019

To enable DCO checks on GitHub, enable
[Probot's DCO bot](https://probot.github.io/apps/dco/).
Then, under `Settings` and `Branches`, you must protect `master` and turn on
`Require status checks to pass before merging` and then select `DCO`.

This comment has been minimized.

Copy link
@cradkowski

cradkowski Aug 3, 2019

Contributor

I tried doing this in a new test repository, is there something else you need to do to get DCO to show up as a status check besides installing the DCO bot and enabling it for the repository?

This comment has been minimized.

Copy link
@StoneyJackson

StoneyJackson Aug 4, 2019

Author Collaborator

Did you enable "status checks to pass before merging" and select "DCO" under that same section?

You know... I think a screen shot would be good... let me do that before you merge.

This comment has been minimized.

Copy link
@cradkowski

cradkowski Aug 4, 2019

Contributor

I installed and enabled the DCO bot for all repositories. For some reason it's no showing up in that box.
GitHub DCO status check

Is there something else you did when setting up the DCO bot to enable it as a status check for the repository so it shows up here?

This comment has been minimized.

Copy link
@StoneyJackson

StoneyJackson Aug 5, 2019

Author Collaborator

Strange. So I installed it on an organization, LibreFoodPantry. I can go to LibreFoodPantry's Settings and Installed GitHub Apps and I see the following:

Screen Shot 2019-08-05 at 8 40 57 AM

On this same page, I enabled DCO bot on specific repositories in LibreFoodPantry.

Screen Shot 2019-08-05 at 8 41 54 AM

When I view one of the repositories' Settings and Integrations & Services, I see

Screen Shot 2019-08-05 at 8 53 43 AM

Does any of this help?

This comment has been minimized.

Copy link
@cradkowski

cradkowski Aug 5, 2019

Contributor

I figured out the issue. In order for the DCO bot to show up as a status check in this window (under the Branch protection rule menu):
image

You have to have triggered the bot at least once previously (in the past week). You can do this by creating a new branch and a commit then making a pull request to the master branch where the DCO bot will then run for the first time. After this, it will then show up as a status check under the branch protection settings where you can then enable it.

This issue doesn't appear to be exclusive to the DCO bot. It seems that you have to have whatever GitHub app you want to run as a status to check to run at least one time before it will show up in the status checks box where you can then enable it as a branch protection as suggested by this CI article:
https://medium.com/meshstudio/continuous-integration-with-circleci-and-nodejs-44c3cf0074a0

StoneyJackson added some commits Aug 4, 2019

feat(docs(dev)): Add screenshot of enabling DCO bot in GitHub
Signed-off-by: Stoney Jackson <dr.stoney@gmail.com>
fix(docs(dev)): Fix link from CONTRIBUTING to automating-dco-checks
Signed-off-by: Stoney Jackson <dr.stoney@gmail.com>
@StoneyJackson

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 4, 2019

@cradkowski Does that help?

@kwurst

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2019

@cradkowski Can we do DCO checks on GitLab as well if (when) we switch platforms?

@StoneyJackson

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 4, 2019

@cradkowski @kwurst And if you figure out how, feel free to amend this PR.

@cradkowski

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2019

@StoneyJackson @kwurst
On GitLab it looks like we can make a DCO check part of a push rule for all commits:
https://docs.gitlab.com/ee/push_rules/push_rules.html#enabling-push-rules

We would have to create a regular expression that checks every commit to see if there is line somewhere that matches something like "Signed-off-by: 'firstName lastName' emailaddress@domain"

I'm currently trying to figure out the correct expression for this.

cradkowski added some commits Aug 4, 2019

docs(dev): Add instructions for automating DCO checks in GitLab
Signed-off-by: Chris Radkowski <cradkowski@worcester.edu>
fix(docs(dev)): Updated GitLab section to indicate this doesn't work …
…on GitLab Free edition

Signed-off-by: Chris Radkowski <cradkowski@worcester.edu>
@cradkowski

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2019

@StoneyJackson I added instructions for how to add DCO checking to a GitLab repository.

@cradkowski

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2019

A note about using GitLab push rules to check for DCO, this works a little differently than DCO bot does in GitHub and won't allow any commits to be pushed to any branch unless they are signed (this is including merge commits too).

In Git Bash the error looks like:
GitLab DCO Push Rule modified

@StoneyJackson StoneyJackson force-pushed the automating-dco-checks branch from 8a5bbdf to f72ea0d Aug 5, 2019

@StoneyJackson

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 5, 2019

WARNING: I just did a forced push. I don't think it will cause any problems on your end unless you pulled that TEST commit. The forced push simply removed this commit. So we are back to the commit the last commit that @cradkowski made f72ea0d .

feat(docs(dev)): Add more complete DCO check docs for GitHub
Signed-off-by: Stoney Jackson <dr.stoney@gmail.com>

@StoneyJackson StoneyJackson requested a review from cradkowski Aug 5, 2019

@StoneyJackson

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 5, 2019

@cradkowski Please see if the more complete documentation for GitHub work for you.

@cradkowski

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

@StoneyJackson Figured out the problem. See my above comment.

We might want to add this information into the document.

@StoneyJackson

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 6, 2019

@cradkowski I agree. Would you mind adding the information?

This would probably be a few more steps in the middle of (5). One showing the screen shot of "Sorry we couldn't find any..." then what to do to trigger the bot for the first time, and then some working changes into the screen shot of DCO checked.

But do what you think is best.

@cradkowski

This comment has been minimized.

Copy link
Contributor

commented Aug 8, 2019

@StoneyJackson I'm merging this pull request since we no longer need GitHub documentation.

@cradkowski cradkowski merged commit 24e6e3b into master Aug 8, 2019

1 check passed

DCO DCO
Details

@cradkowski cradkowski deleted the automating-dco-checks branch Aug 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.