Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb3e92f

Browse files
committedJul 20, 2023
Add project governance documentation
Explains how Maintainers are selected and their responsibilities. Explains the Pull Request review workflow. Adds config for Mergify to enforce this workflow. Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 parent 211b36a commit cb3e92f

File tree

7 files changed

+323
-36
lines changed

7 files changed

+323
-36
lines changed
 

‎.github/mergify.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
pull_request_rules:
2+
- name: automatic merge for Dependabot pull requests
3+
conditions:
4+
- author=dependabot[bot]
5+
- check-success=build-workflow-complete
6+
- label!=hold
7+
actions:
8+
merge:
9+
method: merge
10+
11+
- name: automatic merge conditions for main
12+
conditions:
13+
- "#approved-reviews-by>=2"
14+
- "#review-requested=0"
15+
- "#changes-requested-reviews-by=0"
16+
- base=main
17+
- label!=hold
18+
- label!=work-in-progress
19+
- check-success=DCO
20+
- check-success=build-workflow-complete
21+
actions:
22+
merge:
23+
method: merge
24+
25+
- name: Warn on conflicts
26+
conditions:
27+
- conflict
28+
actions:
29+
comment:
30+
message: "@{{author}}, this pull request is now in conflict and requires a rebase."
31+
label:
32+
add:
33+
- needs-rebase
34+
35+
- name: remove conflict label if not needed
36+
conditions:
37+
- -conflict
38+
actions:
39+
label:
40+
remove:
41+
- needs-rebase

‎.github/workflows/ci.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-aya
1+
name: aya-ci
22

33
on:
44
push:
@@ -48,6 +48,7 @@ jobs:
4848
--workspace
4949
5050
build-test-aya:
51+
needs: ["lint"]
5152
strategy:
5253
fail-fast: false
5354
matrix:
@@ -95,6 +96,7 @@ jobs:
9596
--workspace
9697
9798
build-test-aya-bpf:
99+
needs: ["lint"]
98100
strategy:
99101
fail-fast: false
100102
matrix:
@@ -133,7 +135,7 @@ jobs:
133135
134136
integration-test:
135137
runs-on: macos-latest
136-
138+
needs: ["lint", "build-test-aya", "build-test-aya-bpf"]
137139
steps:
138140
- uses: actions/checkout@v3
139141
with:

‎CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* @aya-rs/aya-maintainers
2+
aya/src/public-api.txt @alessandrod

‎CONTRIBUTING.md

+120-34
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,134 @@
1-
# Contributing to Aya
1+
# Contributing Guide
22

3-
Thanks for your help improving the project!
3+
* [New Contributor Guide](#contributing-guide)
4+
* [Ways to Contribute](#ways-to-contribute)
5+
* [Find an Issue](#find-an-issue)
6+
* [Ask for Help](#ask-for-help)
7+
* [Pull Request Lifecycle](#pull-request-lifecycle)
8+
* [Development Environment Setup](#development-environment-setup)
9+
* [Signoff Your Commits](#signoff-your-commits)
10+
* [Pull Request Checklist](#pull-request-checklist)
411

5-
## Reporting issues
12+
Welcome! We are glad that you want to contribute to our project! 💖
613

7-
If you believe you've discovered a bug in aya, please check if the bug is
8-
already known or [create an issue](https://github.com/aya-rs/aya/issues) on
9-
github. Please also report an issue if you find documentation that you think is
10-
confusing or could be improved.
14+
As you get started, you are in the best position to give us feedback on areas of
15+
our project that we need help with including:
1116

12-
When creating a new issue, make sure to include as many details as possible to
13-
help us understand the problem. When reporting a bug, always specify which
14-
version of aya you're using and which version of the linux kernel.
17+
* Problems found during setting up a new developer environment
18+
* Gaps in our Quickstart Guide or documentation
19+
* Bugs in our automation scripts
1520

16-
## Documentation
21+
If anything doesn't make sense, or doesn't work when you run it, please open a
22+
bug report and let us know!
1723

18-
If you find an API that is not documented, unclear or missing examples, please
19-
file an issue. If you make changes to the documentation, please read
20-
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html and make sure
21-
your changes conform to the format outlined here
22-
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#documenting-components.
24+
## Ways to Contribute
2325

24-
If you want to make changes to the Aya Book, see the readme in the book repo
25-
https://github.com/aya-rs/book.
26+
We welcome many different types of contributions including:
2627

27-
## Fixing bugs and implementing new features
28+
* New features
29+
* Builds, CI/CD
30+
* Bug fixes
31+
* Documentation
32+
* Issue Triage
33+
* Answering questions on Discord
34+
* Web design
35+
* Communications / Social Media / Blog Posts
36+
* Release management
2837

29-
Make sure that your work is tracked by an issue or a (draft) pull request, this
30-
helps us avoid duplicating work. If your work includes publicly visible changes,
31-
make sure those are properly documented as explained in the section above.
38+
Not everything happens through a GitHub pull request. Please come to our
39+
[Discord](https://discord.gg/xHW2cb2N6G) and let's discuss how we can work
40+
together.
3241

33-
### Running tests
34-
Run the unit tests with `cargo test`. See [Aya Integration Tests](https://github.com/aya-rs/aya/blob/main/test/README.md) regarding running the integration tests.
42+
## Find an Issue
3543

36-
### Commits
44+
We have good first issues for new contributors and help wanted issues suitable
45+
for any contributor. [good first issue](https://github.com/aya-rs/aya/labels/good%20first%20issue) has extra information to
46+
help you make your first contribution. [help wanted](https://github.com/aya-rs/aya/labels/help%20wanted) are issues
47+
suitable for someone who isn't a core maintainer and is good to move onto after
48+
your first pull request.
49+
50+
Sometimes there won’t be any issues with these labels. That’s ok! There is
51+
likely still something for you to work on. If you want to contribute but you
52+
don’t know where to start or can't find a suitable issue, you can reach out to us on Discord and we will be happy to help.
53+
54+
Once you see an issue that you'd like to work on, please post a comment saying
55+
that you want to work on it. Something like "I want to work on this" is fine.
56+
57+
## Ask for Help
58+
59+
The best way to reach us with a question when contributing is to ask on:
60+
61+
* The original github issue
62+
* Our Discord
63+
64+
## Pull Request Lifecycle
65+
66+
Pull requests are managed by Mergify.
67+
68+
Our process is currently as follows:
69+
70+
1. When you open a PR a maintainer will automatically be assigned for review
71+
1. Make sure that your PR is passing CI - if you need help with failing checks please feel free to ask!
72+
1. Once it is passing all CI checks, a maintainer will review your PR and you may be asked to make changes.
73+
1. When you have received at two approving reviews from a maintainer, your PR will be merged automiatcally.
74+
75+
In some cases, other changes may conflict with your PR. If this happens, you will get notified by a comment in the issue that your PR requires a rebase, and the `needs-rebase` label will be applied. Once a rebase has been performed, this label will be automatically removed.
76+
77+
## Development Environment Setup
78+
79+
[Instructions](https://bpfd.netlify.app/building-bpfd/#development-environment-setup)
80+
81+
## Signoff Your Commits
82+
83+
### DCO
84+
85+
Licensing is important to open source projects. It provides some assurances that
86+
the software will continue to be available based under the terms that the
87+
author(s) desired. We require that contributors sign off on commits submitted to
88+
our project's repositories. The [Developer Certificate of Origin
89+
(DCO)](https://probot.github.io/apps/dco/) is a way to certify that you wrote and
90+
have the right to contribute the code you are submitting to the project.
91+
92+
You sign-off by adding the following to your commit messages. Your sign-off must
93+
match the git user and email associated with the commit.
94+
95+
This is my commit message
96+
97+
Signed-off-by: Your Name <your.name@example.com>
98+
99+
Git has a `-s` command line option to do this automatically:
100+
101+
git commit -s -m 'This is my commit message'
102+
103+
If you forgot to do this and have not yet pushed your changes to the remote
104+
repository, you can amend your commit with the sign-off by running
105+
106+
git commit --amend -s
107+
108+
## Logical Grouping of Commits
37109

38110
It is a recommended best practice to keep your changes as logically grouped as
39111
possible within individual commits. If while you're developing you prefer doing
40112
a number of commits that are "checkpoints" and don't represent a single logical
41113
change, please squash those together before asking for a review.
114+
When addressing review comments, please perform an interactive rebase and edit commits directly rather than adding new commits with messages like "Fix review comments".
42115

43-
#### Commit message guidelines
116+
## Commit message guidelines
44117

45118
A good commit message should describe what changed and why.
46119

47120
1. The first line should:
48-
49-
* contain a short description of the change (preferably 50 characters or less,
121+
122+
* contain a short description of the change (preferably 50 characters or less,
50123
and no more than 72 characters)
51-
* be entirely in lowercase with the exception of proper nouns, acronyms, and
124+
* be entirely in lowercase with the exception of proper nouns, acronyms, and
52125
the words that refer to code, like function/variable names
53-
* be prefixed with the name of the sub crate being changed
126+
* be prefixed with the name of the sub crate being changed
54127

55128
Examples:
56129

57-
* aya: handle reordered functions
58-
* aya-bpf: SkSkbContext: add ::l3_csum_replace
130+
* bpfd: validate program section names
131+
* bpf: add dispatcher program test slot
59132

60133
2. Keep the second line blank.
61134
3. Wrap all other lines at 72 columns (except for long URLs).
@@ -66,8 +139,8 @@ A good commit message should describe what changed and why.
66139

67140
Examples:
68141

69-
- `Fixes: #1337`
70-
- `Refs: #1234`
142+
* `Fixes: #1337`
143+
* `Refs: #1234`
71144

72145
Sample complete commit message:
73146

@@ -86,3 +159,16 @@ nicely even when it is indented.
86159
Fixes: #1337
87160
Refs: #453, #154
88161
```
162+
163+
## Pull Request Checklist
164+
165+
When you submit your pull request, or you push new commits to it, our automated
166+
systems will run some checks on your new code. We require that your pull request
167+
passes these checks, but we also have more criteria than just that before we can
168+
accept and merge it. We recommend that you check the following things locally
169+
before you submit your code:
170+
171+
* That Rust code has been formatted with `cargo +nightly fmt` and that all clippy lints have been fixed - you can find failing lints with `cargo +nightly clippy`
172+
* That Go code has been formatted and linted
173+
* That unit tests are passing locally with `cargo test`
174+
* That integration tests are passing locally `cargo xtask integration-test`

0 commit comments

Comments
 (0)
Please sign in to comment.