Skip to content

Commit 5dabae3

Browse files
authored
remove openapi dereferenced static files (github#33297)
1 parent 82a5519 commit 5dabae3

31 files changed

+55
-8535941
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ docs/
77
node_modules/
88
script/
99
tests/
10-
lib/rest/static/dereferenced
1110
# Folder is cloned during the preview + prod workflows, the assets are merged into other locations for use before the build
1211
docs-early-access/
1312
# During the preview deploy untrusted user code may be cloned into this directory

.github/actions-scripts/enterprise-server-issue-templates/release-issue.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
1818
```
1919
script/update-enterprise-dates.js
2020
```
21-
- [ ] Create REST files based on previous version. Copy the latest GHES version of the dereferenced file from `lib/rest/static/dereferenced` to a new file in the same directory for the new GHES release. Ex, `cp lib/rest/static/dereferenced/ghes-3.4.deref.json lib/rest/static/dereferenced/ghes-3.5.deref.json`. Then run `script/rest/update-files.js --decorate-only` and check in the resulting files.
21+
- [ ] Create REST files based on previous version. Copy the latest GHES version of the decorate file from `lib/rest/static/decorated` to a new file in the same directory for the new GHES release. Ex, `cp lib/rest/static/decorated/ghes-3.4.json lib/rest/static/decorated/ghes-3.5.json`.
2222
2323
- [ ] Create GraphQL files based on previous version:
2424
@@ -76,16 +76,6 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng
7676
7777
### Troubleshooting
7878
79-
#### `OpenAPI dev mode check / check-schema-versions` failures
80-
81-
If the `OpenAPI dev mode check / check-schema-versions` check fails with the following message:
82-
83-
> :construction::warning: Your decorated and dereferenced schema files don't match. Ensure you're using decorated and dereferenced schemas from the automatically created pull requests by the 'github-openapi-bot' user. For more information, see 'script/rest/README.md'
84-
85-
- run `git checkout origin/main lib/rest/static/*`
86-
- run `script/enterprise-server-releases/create-rest-files.js --oldVersion enterprise-server@<LATEST PUBLIC RELEASE NUMBER> --newVersion enterprise-server@<NEW RELEASE NUMBER>`
87-
- push the resulting changes
88-
8979
#### `Node.js tests / test content` failures
9080
9181
If the `Node.js tests / test content` check fails with the following message, the `lib/enterprise-dates.json` file is not up-to-date:
@@ -104,7 +94,7 @@ This file should be automatically updated, but you can also run `script/update-e
10494
- [ ] [Freeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) at least 1-2 days before the release, and post an announcement in Slack so everybody knows. It's helpful to freeze the repos before doing the OpenAPI merges to avoid changes to the megabranch while preparing and deploying.
10595
- [ ] Alert the Neon Squad (formally docs-ecosystem team) 1-2 days before the release to deploy to `github/github`. A PR should already be open in `github/github`, to change the OpenAPI schema config `published` to `true` in `app/api/description/config/releases/ghes-<NEXT RELEASE NUMBER>.yaml`. They will need to:
10696
- [ ] Get the required approval from `@github/ecosystem-api-reviewers` then deploy the PR to dotcom. This process generally takes 30-90 minutes.
107-
- [ ] Once the PR merges, make sure that the auto-generated PR titled "Update OpenAPI Descriptions" in doc-internal contains both the dereferenced and decorated JSON files for the new GHES release. If everything looks good, merge the "Update OpenAPI Description" PR into the GHES release megabranch. **Note:** Be careful about resolving the conflicts correctly—you may wish to delete the existing OpenAPI files for the release version from the megabranch (that is, delete the GHES release version `lib/rest/static` decorated and dereferenced JSON files), so there are no conflicts to resolve and to ensure that the incoming artifacts are the correct ones.
97+
- [ ] Once the PR merges, make sure that the auto-generated PR titled "Update OpenAPI Descriptions" in doc-internal contains the decorated JSON files for the new GHES release. If everything looks good, merge the "Update OpenAPI Description" PR into the GHES release megabranch. **Note:** Don't attempt to resolve conflicts for changes to the `lib/rest/static/decorated` files. Instead delete the existing OpenAPI files for the release version from the megabranch (that is, revert the changes to the `lib/rest/static` decorated JSON files, e.g., from the megabranch do a `git checkout origin/main lib/rest/static/*`), so there are no conflicts to resolve and to ensure that the incoming artifacts are the correct ones.
10898
- [ ] Alert the Ecosystem-API team in #ecosystem-api about the pending release freeze and incoming blocking review of OpenAPI updates in the public REST API description (the `rest-api-descriptions` repo). They'll need to block any future "Update OpenAPI Descriptions" PRs in the public REST API description until after the ship.
10999
- [ ] Add a blocking review to the auto-generated "Update OpenAPI Descriptions" PR in the public REST API description. (You or they will remove this blocking review once the GHES release ships.)
110100

.github/actions-scripts/openapi-schema-branch.js

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/openapi-decorate.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,16 @@ jobs:
6565
env:
6666
# Disable pre-commit hooks; they don't play nicely with add-and-commit
6767
HUSKY: '0'
68+
69+
- name: Remove the dereferenced files
70+
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
71+
with:
72+
# The arguments for the `git add` command
73+
remove: '["lib/rest/static/dereferenced/*"]'
74+
75+
# The message for the commit
76+
message: 'Removed dereferenced OpenAPI schema files'
77+
78+
env:
79+
# Disable pre-commit hooks; they don't play nicely with add-and-commit
80+
HUSKY: '0'

.github/workflows/openapi-schema-check.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

lib/rest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
Generated by `script/rest/update-files.js`:
1515

16-
* `lib/rest/static/dereferenced` - dereferenced OpenAPI schema file for each version of GitHub
1716
* `lib/rest/static/decorated` - files generated from the dereferenced OpenAPI schema with the Markdown descriptions rendered in HTML
17+
* `lib/rest/static/dereferenced` - **NOTE** These are only generated if you pass the --keep-dereferenced-files option and are not checked into the repository. This option is for debug only.
1818

1919
## Rendering docs
2020

0 commit comments

Comments
 (0)