Skip to content

Commit 2961524

Browse files
author
Jesse
authored
Add Developer Certificate of Origin requirement (#13)
Includes a GitHub Action which checks for a valid sign-off on every proposed commit
1 parent c8ab431 commit 2961524

File tree

3 files changed

+117
-11
lines changed

3 files changed

+117
-11
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- We welcome contributions. All patches must include a sign-off. Please see CONTRIBUTING.md for details -->
2+
3+
4+
## What type of PR is this?
5+
<!-- Check all that apply, delete what doesn't apply. -->
6+
7+
- [ ] Refactor
8+
- [ ] Feature
9+
- [ ] Bug Fix
10+
- [ ] Other
11+
12+
## Description
13+
14+
## How is this tested?
15+
16+
- [ ] Unit tests
17+
- [ ] E2E Tests
18+
- [ ] Manually
19+
- [ ] N/A
20+
21+
<!-- If Manually, please describe. -->
22+
23+
## Related Tickets & Documents

.github/workflows/dco-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: DCO Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check for DCO
10+
id: dco-check
11+
uses: tisonkun/[email protected]
12+
- name: Comment about DCO status
13+
uses: actions/github-script@v6
14+
if: ${{ failure() }}
15+
with:
16+
script: |
17+
github.rest.issues.createComment({
18+
issue_number: context.issue.number,
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
body: `Thanks for your contribution! To satisfy the DCO policy in our \
22+
[contributing guide](https://github.com/databricks/databricks-sql-python/blob/main/CONTRIBUTING.md) \
23+
every commit message must include a sign-off message. One or more of your commits is missing this message. \
24+
You can reword previous commit messages with an interactive rebase (\`git rebase -i main\`).`
25+
})

CONTRIBUTING.md

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,73 @@
1-
# Contributing
1+
# Contributing Guide
22

3-
To contribute to this repository, fork it and send pull requests.
3+
We happily welcome contributions to the `databricks-sql-connector` package. We use [GitHub Issues](https://github.com/databricks/databricks-sql-python/issues) to track community reported issues and [GitHub Pull Requests](https://github.com/databricks/databricks-sql-python/pulls) for accepting changes.
4+
5+
Contributions are licensed on a license-in/license-out basis.
6+
7+
## Communication
8+
Before starting work on a major feature, please reach out to us via GitHub, Slack, email, etc. We will make sure no one else is already working on it and ask you to open a GitHub issue.
9+
A "major feature" is defined as any change that is > 100 LOC altered (not including tests), or changes any user-facing behavior.
10+
We will use the GitHub issue to discuss the feature and come to agreement.
11+
This is to prevent your time being wasted, as well as ours.
12+
The GitHub review process for major features is also important so that organizations with commit access can come to agreement on design.
13+
If it is appropriate to write a design document, the document must be hosted either in the GitHub tracking issue, or linked to from the issue and hosted in a world-readable location.
14+
Specifically, if the goal is to add a new extension, please read the extension policy.
15+
Small patches and bug fixes don't need prior communication.
16+
17+
## Coding Style
18+
We follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) with one exception: lines can be up to 100 characters in length, not 79.
19+
20+
## Sign your work
21+
The sign-off is a simple line at the end of the explanation for the patch. Your signature certifies that you wrote the patch or otherwise have the right to pass it on as an open-source patch. The rules are pretty simple: if you can certify the below (from developercertificate.org):
22+
23+
```
24+
Developer Certificate of Origin
25+
Version 1.1
26+
27+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
28+
1 Letterman Drive
29+
Suite D4700
30+
San Francisco, CA, 94129
31+
32+
Everyone is permitted to copy and distribute verbatim copies of this
33+
license document, but changing it is not allowed.
34+
35+
36+
Developer's Certificate of Origin 1.1
37+
38+
By making a contribution to this project, I certify that:
39+
40+
(a) The contribution was created in whole or in part by me and I
41+
have the right to submit it under the open source license
42+
indicated in the file; or
43+
44+
(b) The contribution is based upon previous work that, to the best
45+
of my knowledge, is covered under an appropriate open source
46+
license and I have the right under that license to submit that
47+
work with modifications, whether created in whole or in part
48+
by me, under the same open source license (unless I am
49+
permitted to submit under a different license), as indicated
50+
in the file; or
51+
52+
(c) The contribution was provided directly to me by some other
53+
person who certified (a), (b) or (c) and I have not modified
54+
it.
55+
56+
(d) I understand and agree that this project and the contribution
57+
are public and that a record of the contribution (including all
58+
personal information I submit with it, including my sign-off) is
59+
maintained indefinitely and may be redistributed consistent with
60+
this project or the open source license(s) involved.
61+
```
62+
63+
Then you just add a line to every git commit message:
64+
65+
```
66+
Signed-off-by: Joe Smith <[email protected]>
67+
Use your real name (sorry, no pseudonyms or anonymous contributions.)
68+
```
69+
70+
If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`.
471

572
## Set up your environment
673

@@ -67,12 +134,3 @@ poetry run python3 -m black src --check
67134
Remove the `--check` flag to write reformatted files to disk.
68135

69136
To simplify reviews you can format your changes in a separate commit.
70-
## Pull Request Process
71-
72-
1. Update the [CHANGELOG.md](README.md) or similar documentation with details of changes you wish to make, if applicable.
73-
2. Add any appropriate tests.
74-
3. Make your code or other changes.
75-
4. Review guidelines such as
76-
[How to write the perfect pull request][github-perfect-pr], thanks!
77-
78-
[github-perfect-pr]: https://blog.github.com/2015-01-21-how-to-write-the-perfect-pull-request/

0 commit comments

Comments
 (0)