Skip to content

dev: update from main #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
20a3024
Run respec without sandbox
ralfhandl Feb 13, 2025
d368f35
Describe publishing process
ralfhandl Feb 14, 2025
72cb498
Bump vitest from 3.0.5 to 3.0.6
dependabot[bot] Feb 20, 2025
57962a3
Merge pull request #4371 from OAI/dependabot/npm_and_yarn/vitest-3.0.6
ralfhandl Feb 20, 2025
4f0379b
Merge pull request #4358 from OAI/ralfhandl-respec-no-sandbox
lornajane Feb 20, 2025
d27078e
Update CONTRIBUTING.md
lornajane Feb 20, 2025
f9a2302
Merge pull request #4363 from ralfhandl/main-contributing-schema-publish
lornajane Feb 20, 2025
e26c74c
Update style-guide.md
ralfhandl Feb 20, 2025
c7e9bd8
Merge pull request #4377 from OAI/ralfhandl-style-guide-yaml-comments
lornajane Feb 23, 2025
bb8aac5
Bump vitest from 3.0.6 to 3.0.7
dependabot[bot] Feb 25, 2025
ce098b8
Merge pull request #4381 from OAI/dependabot/npm_and_yarn/vitest-3.0.7
ralfhandl Feb 25, 2025
bb50d43
style guide: no requirements in "Examples" sections
ralfhandl Feb 25, 2025
5bc34d8
Update agenda.md
duncanbeevers Feb 27, 2025
b5ab378
Merge pull request #4385 from duncanbeevers/patch-1
lornajane Feb 27, 2025
4ffcb64
Update style-guide.md
ralfhandl Feb 28, 2025
1dd2c02
Create sync-main-to-dev.yaml
ralfhandl Feb 28, 2025
70a5c94
Other versions links in frontmatter
ralfhandl Mar 1, 2025
3e40ee4
Merge pull request #4382 from OAI/ralfhandl-style-guide-no-requirements
lornajane Mar 2, 2025
428007d
Merge pull request #4401 from ralfhandl/main-respec-other-versions
ralfhandl Mar 3, 2025
fa1f64a
Create check-restricted-files.yaml
ralfhandl Mar 2, 2025
9f91e54
Google Tag Manager
ralfhandl Mar 4, 2025
a963ad6
Simplified approach
ralfhandl Mar 4, 2025
249dcef
Merge pull request #4407 from ralfhandl/main-protect-files-simpler
lornajane Mar 5, 2025
b58c0a9
Add notes on the new workflow
lornajane Mar 5, 2025
037ebed
check-restricted-files.yaml: check for allowed PRs
ralfhandl Mar 6, 2025
bc7aaf3
Merge pull request #4393 from OAI/main-workflow-sync-main-to-devf
lornajane Mar 6, 2025
0932cde
Create sync-dev-to-vX.Y-dev.yaml
ralfhandl Mar 1, 2025
ac04d8f
Document new workflow
ralfhandl Mar 6, 2025
79ff798
Merge pull request #4398 from OAI/main-workflow-sync-dev-to-vX.Y-dev
lornajane Mar 6, 2025
5215c11
Bump vitest from 3.0.7 to 3.0.8
dependabot[bot] Mar 7, 2025
c4f0205
Merge pull request #4420 from OAI/dependabot/npm_and_yarn/vitest-3.0.8
ralfhandl Mar 7, 2025
f3c113a
Merge pull request #4409 from OAI/main-check-restricted-files-and-all…
miqui Mar 9, 2025
41b6657
Update CONTRIBUTING.md
ralfhandl Mar 13, 2025
506cc68
Document release process
ralfhandl Mar 14, 2025
2800909
Merge pull request #4436 from ralfhandl/main-sync-CONTRIBUTING.md
handrews Mar 14, 2025
7f5e1cf
Merge pull request #4403 from ralfhandl/main-move-up-google-analytics
handrews Mar 14, 2025
dd92b6e
Merge pull request #4437 from ralfhandl/main-document-release-process
lornajane Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/templates/agenda.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Meetings take place over Zoom: [https://zoom.us/j/975841675](https://zoom.us/j/9

| Blur My Background | Raise Hand |
|-|-|
| <img width="323" alt="Screenshot of Zoom UI showing the 'Stop Video' and 'Blur My Background' control" src="https://github.com/OAI/OpenAPI-Specification/assets/7367/7e43dbbb-6529-46e6-8b04-4c1aa852d9dd"> | <img width="323" alt="Screenshot of Zoom UI showing the 'Reaction' and 'Raise Hand' control" src="https://github.com/OAI/OpenAPI-Specification/assets/7367/f991722f-4651-40aa-9bc4-7e9a2a165a6a"> |
| <img width="323" alt="Screenshot of Zoom UI showing the 'Stop Video' and 'Blur My Background' control" src="https://github.com/OAI/OpenAPI-Specification/assets/7367/7e43dbbb-6529-46e6-8b04-4c1aa852d9dd"> | <img width="323" alt="Screenshot of Zoom UI showing the 'Reaction' and 'Raise Hand' control" src="https://github.com/user-attachments/assets/bf19ee70-59b1-410e-b893-645f26c2c96e"> |

### Agenda Structure

Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/check-restricted-files.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: check-restricted-files

# Author: @ralfhandl
# Issue: https://github.com/OAI/OpenAPI-Specification/issues/3432

# This workflow fails if restricted files are changed in a pull request

on:
pull_request:
paths:
- 'schemas/**/*.yaml'
- 'versions/*.md'

jobs:
check-files:
runs-on: ubuntu-latest
steps:
- name: Check changed files
shell: bash
run: |
if [[ "${{ github.event.pull_request.head.repo.full_name }}" == "OAI/OpenAPI-Specification" ]] && \
[[ "${{ github.event.pull_request.base.repo.full_name }}" == "OAI/OpenAPI-Specification" ]]; then

if [[ "${{ github.event.pull_request.head.ref }}" == "main" ]] && \
[[ "${{ github.event.pull_request.base.ref }}" == "dev" ]]; then
echo Sync from main to dev
exit 0
fi

if [[ "${{ github.event.pull_request.head.ref }}" == "dev" ]] && \
[[ "${{ github.event.pull_request.base.ref }}" =~ ^v[0-9]+\.[0-9]+-dev$ ]]; then
echo Sync from dev to ${{ github.event.pull_request.base.ref }}
exit 0
fi

if [[ "${{ github.event.pull_request.head.ref }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rel$ ]] && \
[[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo Release from ${{ github.event.pull_request.head.ref }} to main
exit 0
fi
fi

echo This PR contains changes to files that should not be changed
exit 1
45 changes: 45 additions & 0 deletions .github/workflows/sync-dev-to-vX.Y-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: sync-dev-to-vX.Y-dev

# author: @ralfhandl

#
# This workflow creates PRs to update the vX.Y-dev branch with the latest changes from dev
#

# run this on push to dev
on:
push:
branches:
- dev

jobs:
sync-branches:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create pull requests
id: pull_requests
shell: bash
run: |
DEV_BRANCHES=$(git branch -r --list origin/v?.?-dev)
for DEV_BRANCH in $DEV_BRANCHES; do
BASE=${DEV_BRANCH:7}
EXISTS=$(gh pr list --base $BASE --head $HEAD \
--json number --jq '.[] | .number')
if [ ! -z "$EXISTS" ]; then
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
continue
fi

gh pr create --base $BASE --head $HEAD \
--label "Housekeeping" \
--title "$BASE: update from $HEAD" \
--body "Merge \`$HEAD\` into \`$BASE\`."
done
env:
GH_TOKEN: ${{ github.token }}
HEAD: dev
40 changes: 40 additions & 0 deletions .github/workflows/sync-main-to-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: sync-main-to-dev

# author: @ralfhandl

#
# This workflow creates PRs to update the dev branch with the latest changes from main
#

# run this on push to main
on:
push:
branches:
- main

jobs:
sync-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create pull request
id: pull_request
shell: bash
run: |
EXISTS=$(gh pr list --base $BASE --head $HEAD \
--json number --jq '.[] | .number')
if [ ! -z "$EXISTS" ]; then
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
exit 0
fi

gh pr create --base $BASE --head $HEAD \
--label "Housekeeping" \
--title "$BASE: update from $HEAD" \
--body "Merge \`$HEAD\` into \`$BASE\`."
env:
GH_TOKEN: ${{ github.token }}
HEAD: main
BASE: dev
60 changes: 55 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ This might apply to, for example, Markdown files, automation, and scripts.
For all pull requests, if they should not be merged yet for any reason (they depend on something else, you would like feedback from a specific reviewer), mark them as draft and they will not be merged while in that state.
Draft pull requests can still be reviewed while in draft state.

### Preview specification HTML locally

The markdown source files are converted to HTML before publishing.
To do this locally, please

1. Install [Node.js](https://nodejs.org/)
2. Check out this repo, go to the repo root, and switch to a development branch
3. Execute `npm install` (once, repeat after merging upstream changes)
4. Execute `npm run build-src` after changing `src/oas.md` (this first executes `npm run validate-markdown`, which can also be run separately)
5. Open output file `deploy-preview/oas.html` with a browser and check your changes

Please make sure the markdown validates and builds using the above steps before creating a pull request or marking a draft pull request as ready for review.

## Reviewers

> [!NOTE]
Expand All @@ -177,13 +190,38 @@ Reviews requesting changes should have their changes addressed regardless of how

## Publishing

The specification 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 then merged to `main`.
The HTML versions of the OAS are automatically generated from the `versions` directory on `main`.
### Specification Versions

The specification versions 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 then merged to `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).

The schemas are published [in the schema section on the spec site](https://spec.openapis.org/#openapi-specification-schemas).
As part of the publishing process, the `WORK-IN-PROGRESS` placeholders are replaced with dates as appropriate.
Schemas are published/updated independently from the specification releases.
The steps for creating a `vX.Y.Z-rel` branch are:

1. Update `EDITORS.md` on `main`
2. Merge `main` into `dev` and `dev` into `vX.Y-dev` via PRs
- Sync PRs are automatically created by workflows `sync-main-to-dev` and `sync-dev-to-vX.Y-dev`
3. Prepare spec files in `vX.Y-dev`
- `npm run format-markdown`
- `npm run build-src`
- open `deploy-preview/oas.html` in browser and verify correct formatting
- adjust and repeat until done
- merge changes to `src/oas.md` back into `vX.Y-dev` via PR
4. Create `vX.Y.Z-rel` from `vX.Y-dev` and adjust it
- move `src/oas.md` to `versions/X.Y.Z.md`
- copy `EDITORS.md` to `versions/X.Y.Z-editors.md`
- delete `src/schemas`
- delete `tests/schema`
5. Merge `vX.Y.Z-rel` into `main` via PR
- this PR should only add files `versions/X.Y.Z.md` and `versions/X.Y.Z-editors.md`

The HTML renderings of the specification versions are automatically generated from the `versions` directory on `main` by the [`respec` workflow](https://github.com/OAI/OpenAPI-Specification/blob/main/.github/workflows/respec.yaml), which generates a pull request for publishing the HTML renderings to the [spec site](https://spec.openapis.org).

### Schema Iterations

The schema iterations are published independently from the specification releases [in the schema section on the spec site](https://spec.openapis.org/#openapi-specification-schemas).
Schemas are updated in and directly published from the `vX.Y-dev` branches.

As part of the publishing process, the YAML source files are converted to JSON, renamed to the relevant last-changed dates, and `WORK-IN-PROGRESS` placeholders are replaced with these dates as appropriate. This is usually done by the `schema-publish` workflow which detects changes on each `vX.Y-dev` branch, which generates a pull request for publishing the new schema iterations to the [spec site](https://spec.openapis.org). The workflow can also be run manually if required.

## Release Process and Scope

Expand Down Expand Up @@ -299,6 +337,7 @@ For information on the branch and release strategy for OAS 3.0.4 and 3.1.1 and e

* `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`.
* `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.
Changes on `main` are automatically included in a pull request to `dev` (see the (section on [branch sync](#branch-sync-automation)).
* `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.
* `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.

Expand Down Expand Up @@ -417,6 +456,17 @@ gitGraph TB:
commit id:"3.3 work"
```

### Branch sync automation

To keep changes in sync, we have some GitHub actions that open pull requests to take changes from `main` onto the `dev` branch, and from `dev` to each active version branch.

- `sync-main-to-dev` opens a pull request with all the changes from the `main` branch that aren't yet included on `dev`.
- `sync-dev-to-vX.Y-dev` opens pull requests with all the changes from `dev` that aren't yet included on the corresponding `vX.Y-dev` branch.

These need a single approval from either maintainers or TSC and can be merged.
The aim is to bring build script and repository documentation changes to the other branches.
Published versions of the specifications and schemas will also move across branches with this approach.

## Appendix: Issue Automation

### Automated closure of issues Process
Expand Down
Loading