Skip to content

Commit 674295a

Browse files
authored
Community templates (gakonst#587)
* Add bug report form * Add labels for bugs * Add feature request form * Link to support Telegram * Ask for command in bug form * Ask for Solidity snippets in bug form * Add PR template * Badges nit * Add contributing guidelines * Refer to Foundry book Also cleans up some other parts of the README * Add forge version field to bug form * Replace EVM abstraction with Foundry GHA * Fix typos in contributing guidelines
1 parent 9de25d1 commit 674295a

File tree

6 files changed

+333
-109
lines changed

6 files changed

+333
-109
lines changed

.github/ISSUE_TEMPLATE/BUG-FORM.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Bug report
2+
description: File a bug report
3+
labels: ["T-bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please ensure that the bug has not already been filed in the issue tracker.
9+
10+
Thanks for taking the time to report this bug!
11+
- type: dropdown
12+
attributes:
13+
label: Component
14+
description: What component is the bug in?
15+
multiple: true
16+
options:
17+
- Forge
18+
- Cast
19+
- Foundryup
20+
- Other (please describe)
21+
validations:
22+
required: true
23+
- type: checkboxes
24+
attributes:
25+
label: Have you ensured that all of these are up to date?
26+
options:
27+
- label: Foundry
28+
- label: Foundryup
29+
validations:
30+
required: true
31+
- type: input
32+
attributes:
33+
label: What version of Foundry are you on?
34+
placeholder: "Run forge --version and paste the output here"
35+
- type: input
36+
attributes:
37+
label: What command(s) is the bug in?
38+
description: Leave empty if not relevant
39+
placeholder: "For example: forge test"
40+
- type: dropdown
41+
attributes:
42+
label: Operating System
43+
description: What operating system are you on?
44+
options:
45+
- Windows
46+
- macOS (amd)
47+
- macOS (M1)
48+
- Linux
49+
- type: textarea
50+
attributes:
51+
label: Describe the bug
52+
description: Please include relevant Solidity snippets as well if relevant.
53+
validations:
54+
required: true
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest a feature
3+
labels: ["T-feature"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please ensure that the feature has not already been requested in the issue tracker.
9+
10+
Thanks for helping us improve Foundry!
11+
- type: dropdown
12+
attributes:
13+
label: Component
14+
description: What component is the feature for?
15+
multiple: true
16+
options:
17+
- Forge
18+
- Cast
19+
- Foundryup
20+
- Other (please describe)
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: Describe the feature you would like
26+
description: Please also describe what the feature is aiming to solve, if relevant.
27+
validations:
28+
required: true
29+
- type: textarea
30+
attributes:
31+
label: Additional context
32+
description: Add any other context to the feature (like screenshots, resources)

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Support
4+
url: https://t.me/foundry_support
5+
about: This issue tracker is only for bugs and feature requests. Support is available on Telegram!

.github/PULL_REQUEST_TEMPLATE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!--
2+
Thank you for your Pull Request. Please provide a description above and review
3+
the requirements below.
4+
5+
Bug fixes and new features should include tests.
6+
-->
7+
8+
## Motivation
9+
10+
<!--
11+
Explain the context and why you're making that change. What is the problem
12+
you're trying to solve? In some cases there is not a problem and this can be
13+
thought of as being the motivation for your change.
14+
-->
15+
16+
## Solution
17+
18+
<!--
19+
Summarize the solution and provide any necessary context needed to understand
20+
the code change.
21+
-->

CONTRIBUTING.md

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
## Contributing to Foundry
2+
3+
Thanks for your interest in improving Foundry!
4+
5+
There are multiple opportunities to contribute at any level. If doesn't matter if you are just getting started with Rust or are the most weathered expert, we can use your help.
6+
7+
**No contribution is too small and all contributions are valued.**
8+
9+
This document will help you get started. **Do not let the document intimidate you**.
10+
It should be considered as a guide to help you navigate the process.
11+
12+
The [dev Telegram][dev-tg] is available for any concerns you may have that are not covered in this guide.
13+
14+
### Code of Conduct
15+
16+
The Foundry project adheres to the [Rust Code of Conduct][rust-coc]. This code of conduct describes the _minimum_ behavior expected from all contributors.
17+
18+
Instances of violations of the Code of Conduct can be reported by contacting the team at [[email protected]](mailto:[email protected]).
19+
20+
### Ways to contribute
21+
22+
There are fundamentally four ways an individual can contribute:
23+
24+
1. **By opening an issue:** For example, if you believe that you have uncovered a bug
25+
in Foundry, creating a new issue in the issue tracker is the way to report it.
26+
2. **By adding context:** Providing additional context to existing issues,
27+
such as screenshots, code snippets and helps resolve issues.
28+
3. **By resolving issues:** Typically this is done in the form of either
29+
demonstrating that the issue reported is not a problem after all, or more often,
30+
by opening a pull request that fixes the underlying problem, in a concrete and
31+
reviewable manner.
32+
33+
**Anybody can participate in any stage of contribution**. We urge you to participate in the discussion
34+
around bugs and participate in reviewing PRs.
35+
36+
### Asking for help
37+
38+
If you have reviewed existing documentation and still have questions, or you are having problems, you can get help in the following ways:
39+
40+
- **Asking in the support Telegram:** The [Foundry Support Telegram][support-tg] is a fast and easy way to ask questions.
41+
- **Opening a discussion:** This repository comes with a discussions board where you can also ask for help. Click the "Discussions" tab in the top.
42+
43+
As Foundry is still in heavy development, the documentation can be a bit scattered.
44+
The [Foundry Book][foundry-book] is our current best-effort attempt at keeping up-to-date information.
45+
46+
### Submitting a bug report
47+
48+
When filing a new bug report in the issue tracker, you will be presented with a basic form to fill out.
49+
50+
If you believe that you have uncovered a bug, please fill out the form to the best of your ability. Do not worry if you cannot answer every detail,
51+
just fill in what you can. Contributors will ask follow up questions if something is unclear.
52+
53+
The most important pieces of information we need in a bug report are:
54+
55+
- The Foundry version you are on (and that it is up to date)
56+
- The platform you are on (Windows, macOS, an M1 Mac or Windows)
57+
- Code snippets if this is happening in relation to testing or building code
58+
- Concrete steps to reproduce the bug
59+
60+
In order to rule out the possibility of the bug being in your project, the code snippets should be as minimal
61+
as possible. It is better if you can reproduce the bug with a small snippet as opposed to an entire project!
62+
63+
See [this guide][mcve] on how to create a minimal, complete, and verifiable example.
64+
65+
### Submitting a feature request
66+
67+
When adding a feature request in the issue tracker, you will be presented with a basic form to fill out.
68+
69+
Please include as detailed of an explanation as possible of the feature you would like, adding additional context if necessary.
70+
71+
If you have examples of other tools that have the feature you are requesting, please include them as well.
72+
73+
### Resolving an issue
74+
75+
Pull requests are the way concrete changes are made to the code, documentation, and dependencies of Foundry.
76+
77+
Even tiny pull requests, like fixing wording, are greatly appreciated. Before making a large change, it is usually
78+
a good idea to first open an issue describing the change to solicit feedback and guidance. This will increase
79+
the likelihood of the PR getting merged.
80+
81+
Please also make sure that the following commands pass if you have changed the code:
82+
83+
```sh
84+
cargo check --all
85+
cargo test --all --all-features
86+
cargo +nightly fmt -- --check
87+
cargo +nightly clippy -all --all-features -- -D warnings
88+
```
89+
90+
If you are working on a larger feature, we encourage you to open up a draft pull request, to make sure that other contributors are not duplicating work.
91+
92+
#### Adding tests
93+
94+
If the change being proposed alters code, it is either adding new functionality to Foundry, or fixing existing, broken functionality.
95+
In both of these cases, the pull request should include one or more tests to ensure that Foundry does not regress
96+
in the future.
97+
98+
Types of tests include:
99+
100+
- **Unit tests**: Functions which have very specific tasks should be unit tested.
101+
- **Integration tests**: For general purpose, far reaching functionality, integration tests should be added.
102+
The best way to add a new integration test is to look at existing ones and follow the style.
103+
104+
#### Commits
105+
106+
It is a recommended best practice to keep your changes as logically grouped as possible within individual commits. There is no limit to the number of commits any single pull request may have, and many contributors find it easier to review changes that are split across multiple commits.
107+
108+
That said, if you have a number of commits that are "checkpoints" and don't represent a single logical change, please squash those together.
109+
110+
#### Opening the pull request
111+
112+
From within GitHub, opening a new pull request will present you with a template that should be filled out. Please try your best at filling out the details, but feel free to skip parts if you're not sure what to put.
113+
114+
#### Discuss and update
115+
116+
You will probably get feedback or requests for changes to your pull request.
117+
This is a big part of the submission process, so don't be discouraged! Some contributors may sign off on the pull request right away, others may have more detailed comments or feedback.
118+
This is a necessary part of the process in order to evaluate whether the changes are correct and necessary.
119+
120+
**Any community member can review a PR, so you might get conflicting feedback**.
121+
Keep an eye out for comments from code owners to provide guidance on conflicting feedback.
122+
123+
#### Reviewing pull requests
124+
125+
**Any Foundry community member is welcome to review any pull request**.
126+
127+
All contributors who choose to review and provide feedback on pull requests have a responsibility to both the project and individual making the contribution. Reviews and feedback must be helpful, insightful, and geared towards improving the contribution as opposed to simply blocking it. If there are reasons why you feel the PR should not be merged, explain what those are. Do not expect to be able to block a PR from advancing simply because you say "no" without giving an explanation. Be open to having your mind changed. Be open to working *with* the contributor to make the pull request better.
128+
129+
Reviews that are dismissive or disrespectful of the contributor or any other reviewers are strictly counter to the Code of Conduct.
130+
131+
When reviewing a pull request, the primary goals are for the codebase to improve and for the person submitting the request to succeed. **Even if a pull request is not merged, the submitter should come away from the experience feeling like their effort was not unappreciated**. Every PR from a new contributor is an opportunity to grow the community.
132+
133+
##### Review a bit at a time
134+
135+
Do not overwhelm new contributors.
136+
137+
It is tempting to micro-optimize and make everything about relative performance, perfect grammar, or exact style matches. Do not succumb to that temptation..
138+
139+
Focus first on the most significant aspects of the change:
140+
141+
1. Does this change make sense for Foundry?
142+
2. Does this change make Foundry better, even if only incrementally?
143+
3. Are there clear bugs or larger scale issues that need attending?
144+
4. Are the commit messages readable and correct? If it contains a breaking change, is it clear enough?
145+
146+
Note that only **incremental** improvement is needed to land a PR. This means that the PR does not need to be perfect, only better than the status quo. Follow-up PRs may be opened to continue iterating.
147+
148+
When changes are necessary, *request* them, do not *demand* them, and **do not assume that the submitter already knows how to add a test or run a benchmark**.
149+
150+
Specific performance optimization techniques, coding styles and conventions change over time. The first impression you give to a new contributor never does.
151+
152+
Nits (requests for small changes that are not essential) are fine, but try to avoid stalling the pull request. Most nits can typically be fixed by the Foundry maintainers merging the pull request, but they can also be an opportunity for the contributor to learn a bit more about the project.
153+
154+
It is always good to clearly indicate nits when you comment, e.g.: `Nit: change foo() to bar(). But this is not blocking`.
155+
156+
If your comments were addressed but were not folded after new commits, or if they proved to be mistaken, please, [hide them][hiding-a-comment] with the appropriate reason to keep the conversation flow concise and relevant.
157+
158+
##### Be aware of the person behind the code
159+
160+
Be aware that *how* you communicate requests and reviews in your feedback can have a significant impact on the success of the pull request. Yes, we may merge a particular change that makes Foundry better, but the individual might just not want to have anything to do with Foundry ever again. The goal is not just having good code.
161+
162+
##### Abandoned or stale pull requests
163+
164+
If a pull request appears to be abandoned or stalled, it is polite to first check with the contributor to see if they intend to continue the work before checking if they would mind if you took it over (especially if it just has nits left). When doing so, it is courteous to give the original contributor credit for the work they started, either by preserving their name and e-mail address in the commit log, or by using the `Author: ` or `Co-authored-by: ` metadata tag in the commits.
165+
166+
_Adapted from the [ethers-rs contributing guide](https://github.com/gakonst/ethers-rs/blob/master/CONTRIBUTING.md)_.
167+
168+
### Releasing
169+
170+
Releases are automatically done by the release workflow when a tag is pushed, however, these steps still need to be taken:
171+
172+
1. Ensure that the versions in the relevant `Cargo.toml` files are up-to-date.
173+
2. Update documentation links
174+
3. Perform a final audit for breaking changes.
175+
176+
[rust-coc]: https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md
177+
[dev-tg]: https://t.me/foundry_rs
178+
[foundry-book]: https://github.com/onbjerg/foundry-book
179+
[support-tg]: https://t.me/foundry_support
180+
[mcve]: https://stackoverflow.com/help/mcve
181+
[hiding-a-comment]: https://help.github.com/articles/managing-disruptive-comments/#hiding-a-comment

0 commit comments

Comments
 (0)