Skip to content

Commit f3161e5

Browse files
authored
Merge pull request #4186 from handrews/reorg2
CONTRIBUTING.md: Schema development process, improved mermaid diagram, etc.
2 parents a0800fc + 46383f3 commit f3161e5

File tree

1 file changed

+89
-34
lines changed

1 file changed

+89
-34
lines changed

CONTRIBUTING.md

+89-34
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,100 @@ If in doubt about a policy, please [ask on our Slack](https://communityinviter.c
1414

1515
No changes, ***no matter how trivial***, are ever made to the contents of published specifications. The only potential changes to those documents are updates to link URLs _if and only if_ the targeted document is moved by a 3rd party. Other changes to link URLs are not allowed.
1616

17-
### Changing the schemas
18-
19-
Schemas are only changed _after_ the specification is changed.
20-
Changes are made to the YAML versions on the `main` branch.
21-
The JSON versions are generated when published to the [spec site](https://spec.openapis.org/), at which time the `WORK-IN-PROGRESS` URI placeholders are replaced with the publication date.
22-
2317
### Authoritative source of truth
2418

2519
The [spec site](https://spec.openapis.org) is the source of truth.
2620

2721
This changed in 2024, as the markdown files on `main` do not include certain credits and citations.
2822

29-
## Development and publication process
23+
## Development process
3024

31-
As of October 2024 (post-OAS 3.0.4 and 3.1.1), the OAS is developed in the `src/oas.md` file on minor release `X.Y-dev` branches that are derived from the baseline `dev` branch.
25+
As of October 2024 (post-OAS 3.0.4 and 3.1.1), the OAS is developed in the `src/oas.md` file on minor release `vX.Y-dev` branches that are derived from the baseline `dev` branch.
3226

33-
All work **MUST be done on a fork**, using a branch from the _earliest relevant and [active](#active-branches)_ `X.Y-dev` branch, and then submitted as a PR to that `X.Y-dev` branch.
34-
For example, if a change in November 2024 apples to both 3.1 and 3.2, the PR would go to the `v3.1-dev` branch, which will be merged up to `v3.2-dev` before the next 3.2 release.
27+
Schema changes are made on the same branch, but can be released independently. When making a specification change for a new minor or major release that has a schema impact, including the schema change in the PR is preferred. Patch releases cannot contain changes that _require_ a schema update.
3528

36-
Releases are published to the [spec site](https://spec.opanapis.org) by creating an `X.Y.Z-rel` branch where `src/oas.md` is renamed to the appropriate `versions/X.Y.Z.md` file and them merged to `main`. The HTML versions of the OAS are automatically generated from the `versions` directory on `main`. This renaming on the `X.Y.Z-rel` branch preserves the commit history for the published file on `main` when using `git log --follow` (as is the case for all older published files).
29+
### Branch roles
3730

38-
For information on the branch and release strategy for OAS 3.0.4 and 3.1.1 and earlier, see the comments in [issue #3677](https://github.com/OAI/OpenAPI-Specification/issues/3677).
31+
* `main` is used to publish finished work and hold the authoritative versions of general documentation such as this document, which can be merged out to other branches as needed. The `src` tree is ***not*** present on `main`.
32+
* `dev` is the primary branch for working with the `src` tree, which is kept up-to-date with the most recent release on the most recent minor (X.Y) release line, and serves as the base for each new minor release line. Development infrastructure that is not needed on `main` is maintained here, and can be merged out to other non-`main` branches as needed.
33+
* `vX.Y-dev` is the minor release line development branch for X.Y, including both the initial X.Y.0 minor version and all subsequent X.Y.Z patch versions. All PRs are made to oldest active `vX.Y-dev` branch to which the change is relevant, and then merged forward as shown in the diagram further down in this document.
34+
* `vX.Y.Z-rel` is the release branch for an X.Y.Z release (including when Z == 0). It exists primarily for `git mv`-ing `src/oas.md` to the appropriate `versions/X.Y.Z.md` location before merging back to `main`, and can also be used for any emergency post-release fixes that come up, such as when a 3rd party changes URLs in a way that breaks published links.
3935

40-
### Branch diagram (3.1.2, 3.2.0, and later)
36+
### Using forks
4137

42-
Initial steps:
38+
All work **MUST be done on a fork**, using a branch from the _earliest relevant and [active](#active-branches)_ `vX.Y-dev` branch, and then submitted as a PR to that `vX.Y-dev` branch.
39+
For example, if a change in November 2024 apples to both 3.1 and 3.2, the PR would go to the `v3.1-dev` branch, which will be merged up to `v3.2-dev` before the next 3.2 release.
4340

44-
* `dev` branches from `main` at the 3.1.1 release commit
45-
* Each `X.Y-dev` branches from `dev`
41+
## Publishing
4642

47-
Upon release:
43+
The specification and schemas are published to the [spec site](https://spec.openapis.org) by creating an `vX.Y.Z-rel` branch where `src/oas.md` is renamed to the appropriate `versions/X.Y.Z.md` file and them merged to `main`. The HTML versions of the OAS are automatically generated from the `versions` directory on `main`. This renaming on the `vX.Y.Z-rel` branch preserves the commit history for the published file on `main` when using `git log --follow` (as is the case for all older published files).
4844

49-
* Each `X.Y.Z-rel` branches from the corresponding `X.Y-dev`
50-
* After renaming `src/oas.md`, `X.Y.Z-rel` merges to `main`
51-
* Publishing to the [spec site](https://spec.openapis.org) is triggered by the merge to `main`
45+
The publishing process for schemas is still under discussion (see issues [#3715](https://github.com/OAI/OpenAPI-Specification/issues/3715) and [#3716](https://github.com/OAI/OpenAPI-Specification/issues/3716)), with the current proposal being to release them directly from the `vX.Y-dev` branch without merging to `main`, as the schemas in source control have placeholder identifiers and are not intended to be used as-is.
5246

53-
Initiating the next minor release after releasing `X.Y.0`:
47+
### Historical branch strategy
5448

55-
* The same `X.Y-dev` commit that is the base of `X.Y.0-rel` is merged back to `dev` to keep `src/oas.md` on `dev` in sync with the last minor release
56-
* This `X.Y.0` commit on `dev` is the base of `X.Y+1-dev`
49+
For information on the branch and release strategy for OAS 3.0.4 and 3.1.1 and earlier, see the comments in [issue #3677](https://github.com/OAI/OpenAPI-Specification/issues/3677).
5750

58-
Other notes:
51+
### Branching and merging (3.1.2, 3.2.0, and later)
5952

60-
* Patch releases are _not_ merged to `dev`
53+
Upon release:
54+
55+
* Pre-release steps:
56+
* The most recent _published_ patch release from the previoius line is merged up to `vX.Y-dev`, if relevant
57+
* If doing simultaneous releases on multiple lines, do them from the oldest to newest line
58+
* If the release is the most recent on the current line, merge `vX.Y-dev` to `dev`
59+
* For example, if releasing 3.1.3 and 3.2.0:
60+
* release 3.1.3 first, including merging `v3.1-dev` to `dev` as 3.1 is current at that moment
61+
* release 3.2.0 second, also merging `v3.2-dev` to `dev` as 3.2 becomes current at that point
62+
* any subsequent 3.1.4 would **_not_** trigger a merge of `v3.1-dev` to `dev`, as 3.1 would no longer be current
63+
* Release branching and merging:
64+
* branch `vX.Y.Z-rel` from `vX.Y-dev` (same commit that was merged to `dev` if relevant)
65+
* After renaming `src/oas.md` to `versions/X.Y.Z.md`, merge `vX.Y.Z-rel` to `main`
66+
* Publishing to the [spec site](https://spec.openapis.org) is triggered by the merge to `main`
67+
* Post-release steps:
68+
* If this was a major or minor release (Z == 0), branch `vX.Y+1-dev` from `dev`, from the commit where `vX.Y-dev` was merged to `dev`
69+
70+
_Release lines are grouped by color, although the colors of `dev` and `main` are not significant as these diagrams are limited to only 8 colors._
6171

6272
```mermaid
73+
---
74+
config:
75+
themeVariables:
76+
git0: "#5588bb"
77+
git1: "#cc8899"
78+
git2: "#eedd88"
79+
git3: "#ccbb66"
80+
git4: "#aa9944"
81+
git5: "#887722"
82+
git6: "#99ccff"
83+
git7: "#77aadd"
84+
gitBranchLabel1: "#000000"
85+
gitBranchLabel2: "#000000"
86+
gitBranchLabel3: "#000000"
87+
gitBranchLabel4: "#000000"
88+
gitBranchLabel5: "#ffffff"
89+
gitBranchLabel6: "#000000"
90+
gitBranchLabel7: "#000000"
91+
---
6392
gitGraph TB:
6493
commit id:"merge 3.1.1.md to main" tag:"3.1.1"
6594
branch dev order:1
6695
commit id:"rename 3.1.1.md to src/oas.md"
6796
branch v3.1-dev order:2
6897
commit id:"update version in src/oas.md to 3.1.2"
6998
checkout dev
70-
branch v3.2-dev order:5
99+
branch v3.2-dev order:6
71100
commit id:"update version in src/oas.md to 3.2.0"
72101
commit id:"some 3.2.0 work"
73102
checkout v3.1-dev
74103
commit id:"a 3.1.x fix"
104+
checkout v3.2-dev
105+
merge v3.1-dev id:"merge 3.1.2 fixes"
106+
checkout v3.1-dev
75107
branch v3.1.2-rel order:3
76108
commit id:"rename src/oas.md to versions/3.1.2.md"
109+
checkout dev
110+
merge v3.1-dev id:"update dev with active line patch release"
77111
checkout main
78112
merge v3.1.2-rel tag:"3.1.2"
79113
checkout v3.2-dev
@@ -83,30 +117,51 @@ gitGraph TB:
83117
commit id:"another 3.1.x fix"
84118
checkout v3.2-dev
85119
commit id:"still more 3.2.0 work"
86-
merge v3.1-dev id:"merge 3.1.x fixes before releasing"
120+
merge v3.1-dev id:"merge 3.1.3 fixes before releasing"
121+
checkout dev
122+
merge v3.1-dev id:"update dev with last pre-minor release patch release"
123+
merge v3.2-dev id:"update dev with minor release"
87124
checkout v3.1-dev
88125
branch v3.1.3-rel order:4
89126
commit id:"rename src/oas.md to versions/3.1.3.md"
90127
checkout v3.2-dev
91-
branch v3.2.0-rel order:6
128+
branch v3.2.0-rel order:7
92129
commit id:"rename src/oas.md to versions/3.2.0.md"
93130
checkout main
94131
merge v3.1.3-rel tag:"3.1.3"
95132
merge v3.2.0-rel tag:"3.2.0"
96133
checkout dev
97-
merge v3.2-dev id:"update dev with minor release"
98-
branch v3.3-dev order:7
134+
branch v3.3-dev order:9
99135
checkout v3.1-dev
100136
commit id:"update version in src/oas.md to 3.1.4"
101137
checkout v3.2-dev
102138
commit id:"update version in src/oas.md to 3.2.1"
103139
checkout v3.3-dev
104140
commit id:"update version in src/oas.md to 3.3.0"
105-
```
106141
107-
### Schema development
108-
109-
Development of schemas [currently occurs on `main`](#changing-the-schemas), but the process is [being re-evaluated and is likely to change](https://github.com/OAI/OpenAPI-Specification/issues/3715).
142+
checkout v3.1-dev
143+
commit id:"a 3.1.4 fix"
144+
checkout v3.2-dev
145+
commit id:"a 3.2.1 fix"
146+
merge v3.1-dev id:"merge 3.1.4 fixes before releasing"
147+
checkout v3.3-dev
148+
merge v3.2-dev id:"merge 3.1.4 / 3.2.1 fixes"
149+
checkout dev
150+
merge v3.2-dev id:"merge patch from active release line"
151+
checkout v3.1-dev
152+
branch v3.1.4-rel order:5
153+
commit id:"rename src/oas.md to versions/3.1.4.md"
154+
checkout v3.2-dev
155+
branch v3.2.1-rel order:8
156+
commit id:"rename src/oas.md to versions/3.2.1.md"
157+
checkout main
158+
merge v3.1.4-rel tag:"3.1.4"
159+
merge v3.2.1-rel tag:"3.2.1"
160+
checkout v3.2-dev
161+
commit id:"update version in src/oas.md to 3.2.2"
162+
checkout v3.3-dev
163+
commit id:"3.3 work"
164+
```
110165

111166
#### Active branches
112167

0 commit comments

Comments
 (0)