Skip to content

Commit b77e51a

Browse files
tac0turtleaaronclikhita-809
authored
docs: add adr/rfc section to contributing (#15385)
Co-authored-by: Aaron Craelius <[email protected]> Co-authored-by: Likhita Polavarapu <[email protected]>
1 parent 5680f82 commit b77e51a

File tree

4 files changed

+140
-19
lines changed

4 files changed

+140
-19
lines changed

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [Pull Request Templates](#pull-request-templates)
99
* [Requesting Reviews](#requesting-reviews)
1010
* [Updating Documentation](#updating-documentation)
11+
* [RFC & ADR](#RFC & ADR)
1112
* [Dependencies](#dependencies)
1213
* [`go.work`](#gowork)
1314
* [`go.mod`](#gomod)
@@ -163,6 +164,14 @@ If you open a PR on the Cosmos SDK, it is mandatory to update the relevant docum
163164

164165
When writing documentation, follow the [Documentation Writing Guidelines](./docs/DOC_WRITING_GUIDELINES.md).
165166

167+
### RFC & ADR
168+
169+
Within the Cosmos SDK we have two forms of documenting decisions, Request For Comment (RFC) & Architecture Design Record (ADR). They perform two different functions. The process for assessing if something needs an RFC is located in the respective folders:
170+
171+
* [RFC Process](./docs/rfc/process.md)
172+
* [ADR Process](./docs/adr/process.md)
173+
174+
166175
## Dependencies
167176

168177
We use [Go Modules](https://github.com/golang/go/wiki/Modules) to manage

docs/architecture/PROCESS.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@
66
4. Add an entry to a list in the [README](./README.md) file.
77
5. Create a Pull Request to propose a new ADR.
88

9-
## ADR life cycle
9+
## What is an ADR?
10+
11+
An ADR is a document to document an implementation and design that may or may not have been discussed in an RFC. While an RFC is meant to replace synchoronus communication in a distributed environment, an ADR is meant to document an already made decision. An ADR wont come with much of a communication overhead because the discussion was recorded in an RFC or a synchronous discussion. If the consensus came from a synchoronus discussion then a short excerpt should be added to the ADR to explain the goals.
1012

11-
ADR creation is an **iterative** process. Instead of trying to solve all decisions in a single ADR pull request, we MUST firstly understand the problem and collect feedback through a GitHub Issue.
13+
## ADR life cycle
1214

13-
1. Every proposal SHOULD start with a new GitHub Issue or be a result of existing Issues. The Issue should contain just a brief proposal summary.
15+
ADR creation is an **iterative** process. Instead of having a high amount of communication overhead, an ADR is used when there is already a decision made and implementation details need to be added. The ADR should document what the collective consensus for the specific issue is and how to solve it.
1416

15-
2. Once the motivation is validated, a GitHub Pull Request (PR) is created with a new document based on the `adr-template.md`.
17+
1. Every ADR should start with either an RFC or discussion where consensus has been met.
1618

17-
3. An ADR doesn't have to arrive to `main` with an _accepted_ status in a single PR. If the motivation is clear and the solution is sound, we SHOULD be able to merge it and keep a _proposed_ status. It's preferable to have an iterative approach rather than long, not merged Pull Requests.
19+
2. Once consensus is met, a GitHub Pull Request (PR) is created with a new document based on the `adr-template.md`.
1820

19-
4. If a _proposed_ ADR is merged, then it should clearly document outstanding issues either in ADR document notes or in a GitHub Issue.
21+
3. If a _proposed_ ADR is merged, then it should clearly document outstanding issues either in ADR document notes or in a GitHub Issue.
2022

21-
5. The PR SHOULD always be merged. In the case of a faulty ADR, we still prefer to merge it with a _rejected_ status. The only time the ADR SHOULD NOT be merged is if the author abandons it.
23+
4. The PR SHOULD always be merged. In the case of a faulty ADR, we still prefer to merge it with a _rejected_ status. The only time the ADR SHOULD NOT be merged is if the author abandons it.
2224

23-
6. Merged ADRs SHOULD NOT be pruned.
25+
5. Merged ADRs SHOULD NOT be pruned.
2426

2527
### ADR status
2628

docs/rfc/PROCESS.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# RFC Creation Process
2+
3+
1. Copy the `rfc-template.md` file. Use the following filename pattern: `rfc-next_number-title.md`
4+
2. Create a draft Pull Request if you want to get an early feedback.
5+
3. Make sure the context and a solution is clear and well documented.
6+
4. Add an entry to a list in the [README](./README.md) file.
7+
5. Create a Pull Request to propose a new ADR.
8+
9+
## What is an RFC?
10+
11+
An RFC is a sort of async whiteboarding session. It is meant to replace the need for a distributed team to come together to make a decision. Currently, the Cosmos SDK team and contributors are distributed around the world. The team conducts working groups to have a synchronous discussion and an RFC can be used to capture the discussion for a wider audience to better understand the changes that are coming to the software.
12+
13+
The main difference the Cosmos SDK is defining as a differentiation between RFC and ADRs is that one is to come to consensus and circulate information about a potential change or feature. An ADR is used if there is already consensus on a feature or change and there is not a need to articulate the change coming to the software. An ADR will articulate the changes and have a lower amount of communication .
14+
15+
## RFC life cycle
16+
17+
RFC creation is an **iterative** process. An RFC is meant as a distributed colloboration session, it may have many comments and is usually the bi-product of no working group or synchornous communication
18+
19+
1. Proposals could start with a new GitHub Issue, be a result of existing Issues or a discussion.
20+
21+
2. An RFC doesn't have to arrive to `main` with an _accepted_ status in a single PR. If the motivation is clear and the solution is sound, we SHOULD be able to merge it and keep a _proposed_ status. It's preferable to have an iterative approach rather than long, not merged Pull Requests.
22+
23+
3. If a _proposed_ RFC is merged, then it should clearly document outstanding issues either in the RFC document notes or in a GitHub Issue.
24+
25+
4. The PR SHOULD always be merged. In the case of a faulty RFC, we still prefer to merge it with a _rejected_ status. The only time the RFC SHOULD NOT be merged is if the author abandons it.
26+
27+
5. Merged RFCs SHOULD NOT be pruned.
28+
29+
6. If there is consensus and enough feedback then the RFC can be accepted.
30+
31+
> Note: An RFC is written when there is no working group or team session on the problem. RFC's are meant as a distributed white boarding session. If there is a working group on the proposal there is no need to have an RFC as there is synchornous whiteboarding going on.
32+
33+
### RFC status
34+
35+
Status has two components:
36+
37+
```text
38+
{CONSENSUS STATUS}
39+
```
40+
41+
#### Consensus Status
42+
43+
```text
44+
DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEDED by ADR-xxx
45+
\ |
46+
\ |
47+
v v
48+
ABANDONED
49+
```
50+
51+
* `DRAFT`: [optional] an ADR which is work in progress, not being ready for a general review. This is to present an early work and get an early feedback in a Draft Pull Request form.
52+
* `PROPOSED`: an ADR covering a full solution architecture and still in the review - project stakeholders haven't reached an agreed yet.
53+
* `LAST CALL <date for the last call>`: [optional] clear notify that we are close to accept updates. Changing a status to `LAST CALL` means that social consensus (of Cosmos SDK maintainers) has been reached and we still want to give it a time to let the community react or analyze.
54+
* `ACCEPTED`: ADR which will represent a currently implemented or to be implemented architecture design.
55+
* `REJECTED`: ADR can go from PROPOSED or ACCEPTED to rejected if the consensus among project stakeholders will decide so.
56+
* `SUPERSEEDED by ADR-xxx`: ADR which has been superseded by a new ADR.
57+
* `ABANDONED`: the ADR is no longer pursued by the original authors.
58+
59+
## Language used in RFC
60+
61+
* The background/goal should be written in the present tense.
62+
* Avoid using a first, personal form.

docs/rfc/rfc-template.md

+59-11
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,69 @@
22

33
## Changelog
44

5-
- {date}: {changelog}
5+
* {date}: {changelog}
66

7-
## Abstract
7+
## Background
88

9-
> A brief high-level synopsis of the topic of discussion for this RFC, ideally
10-
> just a few sentences. This should help the reader quickly decide whether the
11-
> rest of the discussion is relevant to their interest.
9+
> The next section is the "Background" section. This section should be at least two paragraphs and can take up to a whole
10+
> page in some cases. The guiding goal of the background section is: as a newcomer to this project (new employee, team
11+
> transfer), can I read the background section and follow any links to get the full context of why this change is
12+
> necessary?
13+
>
14+
> If you can't show a random engineer the background section and have them acquire nearly full context on the necessity
15+
> for the RFC, then the background section is not full enough. To help achieve this, link to prior RFCs, discussions, and
16+
> more here as necessary to provide context so you don't have to simply repeat yourself.
17+
18+
19+
## Proposal
20+
21+
> The next required section is "Proposal" or "Goal". Given the background above, this section proposes a solution.
22+
> This should be an overview of the "how" for the solution, but for details further sections will be used.
23+
24+
25+
## Abandoned Ideas (Optional)
26+
27+
> As RFCs evolve, it is common that there are ideas that are abandoned. Rather than simply deleting them from the
28+
> document, you should try to organize them into sections that make it clear they're abandoned while explaining why they
29+
> were abandoned.
30+
>
31+
> When sharing your RFC with others or having someone look back on your RFC in the future, it is common to walk the same
32+
> path and fall into the same pitfalls that we've since matured from. Abandoned ideas are a way to recognize that path
33+
> and explain the pitfalls and why they were abandoned.
34+
35+
## Descision
36+
37+
> This section describes alternative designs to the chosen design. This section
38+
> is important and if an adr does not have any alternatives then it should be
39+
> considered that the ADR was not thought through.
40+
41+
## Consequences (optional)
42+
43+
> This section describes the resulting context, after applying the decision. All
44+
> consequences should be listed here, not just the "positive" ones. A particular
45+
> decision may have positive, negative, and neutral consequences, but all of them
46+
> affect the team and project in the future.
47+
48+
### Backwards Compatibility
49+
50+
> All ADRs that introduce backwards incompatibilities must include a section
51+
> describing these incompatibilities and their severity. The ADR must explain
52+
> how the author proposes to deal with these incompatibilities. ADR submissions
53+
> without a sufficient backwards compatibility treatise may be rejected outright.
54+
55+
### Positive
56+
57+
> {positive consequences}
58+
59+
### Negative
60+
61+
> {negative consequences}
62+
63+
### Neutral
64+
65+
> {neutral consequences}
1266
13-
## Background
1467

15-
> Any context or orientation needed for a reader to understand and participate
16-
> in the substance of the Discussion. If necessary, this section may include
17-
> links to other documentation or sources rather than restating existing
18-
> material, but should provide enough detail that the reader can tell what they
19-
> need to read to be up-to-date.
2068

2169
### References
2270

0 commit comments

Comments
 (0)