Skip to content

Commit 2664872

Browse files
authored
update deprecation template steps (#55163)
1 parent 15890fe commit 2664872

File tree

4 files changed

+166
-63
lines changed

4 files changed

+166
-63
lines changed

src/ghes-releases/lib/deprecation-steps.md

Lines changed: 74 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ labels:
88

99
# Deprecation steps for GHES releases
1010

11-
The day after a GHES version's [deprecation date](https://github.com/github/docs-internal/tree/main/src/ghes-releases/lib/enterprise-dates.json), a banner on the docs will say: `This version was deprecated on <date>.` This is all users need to know. However, we don't want to update those docs anymore or link to them in the nav. Follow the steps in this issue to **archive** the docs.
11+
The day after a GHES version's [deprecation date](https://github.com/github/docs-internal/tree/main/src/ghes-releases/lib/enterprise-dates.json), a banner on the docs will say: `This version was deprecated on <date>.` This lets users know that the release is deprecated. However, until the release is fully deprecated, it will show up in the Versions dropdown on the docs.github.com site.
12+
13+
When we fully deprecate the release, we remove all any content (YML, JSON, Markdown) versioned for that release or lower. Follow the steps in this issue to fully **deprecate** the docs.
1214

1315
**Note**: Each step below, except step 0, must be done in order. Only move on to the next step after successfully completing the previous step.
1416

@@ -17,38 +19,48 @@ The following large repositories are used throughout this checklist, it may be u
1719
- `github/github`
1820
- `github/docs-internal`
1921

20-
Additionally, you can download:
21-
22-
- [Azure Storage Explorer](https://aka.ms/portalfx/downloadstorageexplorer)
22+
## Step 0: Confirm the deprecation date
2323

24-
## Step 0: Before beginning the deprecation, ensure the date of the deprecation is correctly defined
25-
26-
- [ ] Completed step 0 ✅
24+
Before beginning the deprecation, ensure the date of the deprecation is correctly defined:
2725

2826
1. Check that the deprecation date is correct by looking up the version you are deprecating in the [release date list](https://github.com/github/enterprise-releases/blob/master/releases.json) and finding the corresponding `prp` owner. Send them a slack message to confirm that the date is correct. If the date is being pushed out, you can ask the `prp` to update the date in the release date list. If the release date list does not get updated (it doesn't always) we have to prepare that our version of that file (`src/ghes-releases/lib/enterprise-dates.json`) will also be inaccurate.
2927

30-
If there is no `prp` defined, reach out to our content friends for help in the #docs-content-enterprise Slack channel.
28+
If there is no `prp` defined, reach out to our content friends for help in the #docs-content-enterprise or #ghes-releases Slack channel.
3129

3230
1. If this release is being pushed out, update the target date of this issue and you can wait to proceed with any futher steps.
3331

34-
## Step 1: Remove deprecated version numbers from docs-content issue forms
32+
1. In the `docs-content` repo, remove the deprecated GHES version number from the `options` list in [`release-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tracking.yml).
33+
34+
1. When the PR is approved, merge it in.
3535

36-
- [ ] Completed step 1 ✅
36+
## Step 1: Create the new archived repository
3737

38-
**Note**: This step can be performed independently of all other steps, and can be done several days before or along with the other steps.
38+
All previously archived content lives in its own repository. For example, GHES 3.11 archived content is located in https://github.com/github/docs-ghes-3.11.
3939

40-
In the `docs-content` repo, remove the deprecated GHES version number from the `options` list in [`release-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tracking.yml).
40+
1. Create a new repository that will store the scraped deprecated files:
41+
42+
```shell
43+
npm run deprecate-ghes -- create-repo --version <release to deprecate>
44+
```
4145

42-
When the PR is approved, merge it in.
46+
For example, to deprecate GHES 3.11, you would run:
47+
48+
```shell
49+
npm run deprecate-ghes -- create-repo --version 3.11
50+
```
51+
52+
1. From the new repository's home page, click the gear icon next to the "About" section and deselect the "Releases", "Packages", and "Depployments" checkboxes. Click "Save changes".
4353

4454
## Step 2: Dry run: Scrape the docs and archive the files
4555

46-
- [ ] Completed step 2 ✅
56+
**Note:** You may want to perform the following dry run steps on a new temporary branch that you can delete after the dry run is complete.
4757

4858
1. If the release date documented in the [release date list](https://github.com/github/enterprise-releases/blob/master/releases.json) is incorrect or differs from what we have documented in `src/ghes-releases/lib/enterprise-dates.json`, update the date in `src/ghes-releases/lib/enterprise-dates.json` to the correct deprecation date before proceeding with the deprecation. A banner is displayed on each page with a version that will be deprecated soon. The banner uses the dates defined in `src/ghes-releases/lib/enterprise-dates.json`.
59+
4960
1. Ensure you have local clones of the [translation repositories](#configuring-the-translation-repositories).
61+
5062
1. Update all translation directories to the latest `main` branch.
51-
1. You can do this on the main branch or check out a new temporary branch.
63+
5264
1. Hide search component temporarily while scraping docs in `src/search/components/Search.tsx`, by adding the `visually-hidden` class to the `form` element:
5365

5466
```javascript
@@ -69,59 +81,78 @@ When the PR is approved, merge it in.
6981
1. Do a dry run by scraping a small amount of files to test locally on your machine. This command does not overwrite the references to asset files so they will render on your machine.
7082
7183
```shell
72-
npm run archive-version -- --dry-run --local-dev
84+
npm run deprecate-ghes -- archive --dry-run --local-dev
7385
```
7486
7587
1. Navigate to the scraped files directory (`tmpArchivalDir_<VERSION_TO_DEPRECATE>`) inside your docs-internal checkout. Open a few HTML files and ensure they render and drop-down pickers work correctly.
7688
7789
1. If the dry-run looks good, scrape all content files. This will take about 20-30 minutes. **Note:** This will overwrite the directory that was previously generated with new files. You can also create a specific output directory using the `--output` flag.
7890
7991
```shell
80-
npm run archive-version
92+
npm run deprecate-ghes -- archive
8193
```
8294
8395
1. Revert changes to `src/search/components/Search.tsx`.
8496
8597
1. Check in any change to `src/ghes-releases/lib/enterprise-dates.json`.
8698
87-
## Step 3: Upload the scraped content directory to Azure storage
99+
## Step 3: Commit the scraped docs to the new repository
88100
89-
- [ ] Completed step 3 ✅
101+
1. Copy the scraped files from the `tmpArchivalDir_<VERSION_TO_DEPRECATE>` directory in `docs-internal` over to the new `github/docs-ghes-<RELEASE_NUM>` repository.
90102
91-
1. Log in to the Azure portal from Okta. You'll first need to use the Azure JIT tile in Okta, and request access. Then either logout after being redirected to Azure and log back in, or log into the normal Azure tile from Okta. That will force a refresh on your access and give you write permissions to upload files.
103+
1. Commit the files. A GitHub Pages build should automatically begin, creating the static site that serves these docs.
92104
93-
1. Once in Azure, navigate to the [githubdocs Azure Storage Blob resource](https://portal.azure.com/#@githubazure.onmicrosoft.com/resource/subscriptions/fa6134a7-f27e-4972-8e9f-0cedffa328f1/resourceGroups/docs-production/providers/Microsoft.Storage/storageAccounts/githubdocs/overview).
105+
1. Preview a few pages, by navigating to the full URL checked into the repo. For example, for GHES 3.11, you can view `https://github.github.com/docs-ghes-3.11/en/[email protected]/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/about-notifications/index.html`.
94106

95-
1. Upload the files. You can do this directly from the UI or using the Microsoft Azure Storage Explorer app. The app allows you more insight into the status of the upload and allows you to delete directories.
107+
1. Remove the `tmpArchivalDir_<VERSION_TO_DEPRECATE>` directory from your `github/docs-internal` checkout.
96108

97-
UI method:
109+
## Step 4: Deprecate the GHES release in docs-internal
98110

99-
1. Click `Containers` in the left sidebar, then click the `enterprise` container.
111+
1. In your `docs-internal` checkout, create a new branch: `git checkout -b deprecate-<version>`.
100112

101-
1. Click `Upload` in the top bar. Drag and drop or click `Browse for files` to select the directory inside of `tmpArchivalDir_<VERSION_TO_DEPRECATE>`. For example, at the time of this writing, the directory name was `3.5`. The upload will take several minutes and the UI may not give feedback immediately. Don't close the browser tab or navigate away from the page until the upload is complete.
113+
1. In your `docs-internal` checkout, edit `src/versions/lib/enterprise-server-releases.js` by removing the version number to be deprecated from the `supported` array and move it to the `deprecatedWithFunctionalRedirects` array.
102114

103-
App method:
115+
1. Deprecate the automated pipelines data files:
104116

105-
1. Open the Microsoft Azure Storage Explorer app from the `Overview` tab [githubdocs Azure Storage Blob resource page](https://portal.azure.com/#@githubazure.onmicrosoft.com/resource/subscriptions/fa6134a7-f27e-4972-8e9f-0cedffa328f1/resourceGroups/docs-production/providers/Microsoft.Storage/storageAccounts/githubdocs/overview).
106-
1. You'll need to navigate to the correct subscription, resource, and container.
107-
1. To upload, Click "Upload" and select "Upload folder." Click the "Selected folder" input to navigate to the temp directory you just generated. Inside that temp directory, select the `<VERSION_TO_DEPRECATE>` directory (e.g., `3.2`). Leave the destination directory input blank.
117+
```shell
118+
npm run deprecate-ghes -- pipelines
119+
```
108120

109-
1. From the UI, click on the newly uploaded directory navigate to an HTML file. Clicking on the file will show you a metadata page for that file. Click the `URL` copy button. Navigate to that URL in your browser to see the rendered HTML page. Ensure that the pages render correctly and that the drop-down pickers work correctly.
121+
1. Remove deprecated content files and update the versions frontmatter:
110122

111-
1. Remove the temporarily created directory from your `github/docs-internal` checkout.
123+
```shell
124+
npm run deprecate-ghes -- content
125+
```
112126

113-
## Step 4: Deprecate the GHES release in docs-internal
127+
1. Remove deprecated Liquid from content and data files. **Note:** The previous step to update content file frontmatter must have run successfully for this step to work because the updated frontmatter is used to determine file versions.
114128

115-
- [ ] Completed step 4 ✅
129+
```shell
130+
npm run lint-content -- --paths content data --rules liquid-unused-conditional --fix
131+
```
116132

117-
This step will remove the version from the drop-down picker, effectively deprecating the version from a user's perspective. The content for the deprecated release will still exist in the Markdown files.
133+
1. There are some `data/variables/*.yml` files that can't be autofixed. These will show up as errors. You can manually make the changes to these files. For example, this means open file data/variables/code-scanning and find the code_scanning_thread_model_support key. Edit the key’s value to remove the deprecated liquid:
118134
119-
1. In your `docs-internal` checkout, create a new branch: `git checkout -b deprecate-<version>`.
135+
![Output from script that indicates manual fixes to variable files are needed](./variable-example.png)
120136
121-
1. In your `docs-internal` checkout, edit `src/versions/lib/enterprise-server-releases.js` by removing the version number to be deprecated from the `supported` array and move it to the `deprecatedWithFunctionalRedirects` array.
137+
1. Deprecate any data files that are now empty, remove data resuables references that were deleted:
138+
139+
```shell
140+
npm run deprecate-ghes -- data
141+
```
122142
123-
1. You can test that the static pages were generated correctly on localhost and on staging. Verify that the static pages are accessible by running `npm run dev` in your local `docs-internal` checkout and navigate to:
124-
`http://localhost:3000/enterprise/<version>/`.
143+
1. Run the linter again to remove whitespace and check for any other errors:
144+
145+
```shell
146+
npm run lint-content -- --fix
147+
```
148+
149+
1. Use VSCode find/replace to remove any remaining table pipes after liquid has been removed. For example lines that only contain 1 or two pipes: ` |` or ` | |`. You can use the following regexes: `^\|\s*\|$` and `^\s?\|\s?$`.
150+
151+
1. Test the changes by running the site locally:
152+
153+
```shell
154+
npm run start
155+
```
125156
126157
1. Poke around several deprecated pages by navigating to `docs.github.com/enterprise/<DEPRECATED VERSION>`, and ensure that:
127158
- Stylesheets are working properly
@@ -131,38 +162,18 @@ This step will remove the version from the drop-down picker, effectively depreca
131162
- You should see a banner on the top of every deprecated page with the date that the version was deprecated.
132163
- You should see a banner at the top of every page for the oldes currently supported version with the date that it will be deprecated in the ~3 months.
133164
134-
1. If everything looks good, check in the changes to `src/versions/lib/enterprise-server-releases.js` and create a pull request.
165+
1. If everything looks good, check in all changes and create a pull request.
135166
136167
1. Ensure that CI is passing or make any changes to content needed to get tests to pass.
137168
169+
1. Add the PR to the [docs-content review board](https://github.com/orgs/github/projects/2936/views/2).
170+
138171
1. 🚢 Ship the change.
139172
140173
## Step 5: Create a tag
141174
142-
- [ ] ✅ Completed step 5
143-
144175
1. Create a new tag for the most recent commit on the `main` branch so that we can keep track of where in commit history we removed the GHES release. Create a tag called `enterprise-<release number>-release`. To create only a tag and not a release, you can [create a new release](https://github.com/github/docs-internal/releases), which allows you to "Choose a tag." Select add a new tag and use the tag name as the release title. After creating the new release, you will see the new tag as well. You can then delete the release.
145176
146-
## Step 6: Remove static files and liquid conditionals for the version
147-
148-
- [ ] Completed step 6
149-
150-
1. In your `docs-internal` checkout, create a new branch: `git checkout -b remove-<version>-content`.
151-
152-
1. Run `src/ghes-releases/scripts/sync-automated-pipeline-data.js` and commit results.
153-
154-
1. Remove the outdated Liquid markup and frontmatter. **Note:** There are typically a few bugs in the updated Markdown, which will be caught by the content linter or CI. Fix any bugs you find. For example, a liquid end tag may be removed but the start tag still exists. There are typically only a few bugs to fix. The script does a pretty great job of fixing most use cases, so this is typically a lightweight task. If there are several errors, something is likely broken and should be fixed in the script.
155-
156-
```shell
157-
npm run remove-version-markup -- --release <number>
158-
```
159-
160-
1. If data reusables were deleted automatically, you'll need to remove references to the deleted reusable in the content. Using VSCode to find the occurrences is quick and there are typically only a few to update. If you have any questions, reach out to the docs-content team in #docs-content to ask for help updating the Markdown files.
161-
162-
1. Open a new PR. When the CI is 🍏, add the PR to the [docs-content review board](https://github.com/orgs/github/projects/2936/views/2).
163-
164-
1. When the PR is approved, merge it in. 🚢
165-
166177
## Step 7: Deprecate the OpenAPI description in `github/github`
167178
168179
1. In `github/github`, edit the release's config file in `app/api/description/config/releases/`, and change `deprecated: false` to `deprecated: true`.
@@ -200,9 +211,9 @@ TRANSLATIONS_ROOT_DE_DE=${TRANSLATIONS}/docs-internal.de-de
200211
201212
## Re-scraping a page or all pages
202213
203-
Occasionally, a change will need to be added to our archived enterprise versions. If this occurs, you can check out the `enterprise-<release number>-release` branch and re-scrape the page or all pages using `npm run archive-version`. To scrape a single page you can use the `—page <page relative path>` option.
214+
Occasionally, a change will need to be added to our archived enterprise versions. If this occurs, you can check out the `enterprise-<release number>-release` branch and re-scrape the page or all pages using `npm run deprecate-ghes -- archive`. To scrape a single page you can use the `—page <page relative path>` option.
204215
205-
For each language, upload the new file to Azure blob storage in the `enterprise` container.
216+
For each language, upload the new file to the `github/docs-ghes-<RELEASE_NUM>` repo.
206217
207218
After uploading the new files, you will need to purge the Fastly cache for the single page. From Okta, go to Fastly and select `docs`. Click `Purge` then `Purge URL`. If you need to purge a whole path, just do a `Purge All`
208219
599 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# This script creates a new repository for an archived version of GitHub Enterprise Server documentation.
2+
# Please update the version variable first.
3+
# You may wish to run this script a little bit at a time instead of all at once incase there are any errors.
4+
5+
version=$1
6+
cd ~/Documents/gh/github
7+
echo "--- Creating repository for github/docs-ghes-$version"
8+
echo "--- gh repo create"
9+
gh repo create \
10+
"github/docs-ghes-$version" \
11+
--add-readme \
12+
--clone \
13+
--description="Archived docs for GHES $version" \
14+
--disable-issues \
15+
--disable-wiki \
16+
--license="CC-BY-4.0" \
17+
--private \
18+
--team="docs-engineering" \
19+
--homepage="https://github.github.com/docs-ghes-$version/"
20+
echo "--- gh repo edit"
21+
gh repo edit \
22+
"github/docs-ghes-$version" \
23+
--add-topic="docs-ghes-archive" \
24+
--allow-update-branch \
25+
--delete-branch-on-merge \
26+
--enable-auto-merge \
27+
--enable-projects=false \
28+
--enable-merge-commit=false \
29+
--enable-rebase-merge=false
30+
echo "--- github/docs-engineering as admin"
31+
gh api -X PUT "/orgs/github/teams/docs-engineering/repos/github/docs-ghes-$version" \
32+
-f 'permission=admin' --silent
33+
echo "--- github/employees as read"
34+
gh api -X PUT "/orgs/github/teams/employees/repos/github/docs-ghes-$version" --silent
35+
echo "--- Require a pull request review before merging"
36+
repositoryId="$(gh api graphql -f query="{repository(owner:\"github\",name:\"docs-ghes-$version\"){id}}" -q .data.repository.id)"
37+
gh api graphql -f query='
38+
mutation($repositoryId:ID!,$branch:String!,$requiredReviews:Int!) {
39+
createBranchProtectionRule(input: {
40+
repositoryId: $repositoryId
41+
pattern: $branch
42+
requiresApprovingReviews: true
43+
requiredApprovingReviewCount: $requiredReviews
44+
requiresCodeOwnerReviews: true
45+
}) { clientMutationId }
46+
}' -f repositoryId="$repositoryId" -f branch=main -F requiredReviews=1 --silent
47+
echo "--- Enable GitHub Pages, set source to main in root directory, and make the pages site public"
48+
gh api -X POST "/repos/github/docs-ghes-$version/pages" \
49+
-f "source[branch]=main" -f "source[path]=/" -f "public=true" --silent
50+
echo "--- Update custom properties"
51+
gh api --method PATCH /repos/github/docs-ghes-$version/properties/values \
52+
-f "properties[][property_name]=ownership-name" \
53+
-f "properties[][value]=@github/docs-engineering" \
54+
-f "properties[][property_name]=ownership-type" \
55+
-f "properties[][value]=Team" \
56+
--silent
57+
echo "--- FILE UPDATES"
58+
cd "docs-ghes-$version"
59+
echo "--- docs engineering as codeowners"
60+
touch CODEOWNERS
61+
echo "* @github/docs-engineering" > CODEOWNERS
62+
echo "--- add index.html file"
63+
touch index.html
64+
echo "<h1>GitHub Enterprise Server $version Docs</h1>" > index.html
65+
echo "--- add .gitignore"
66+
touch .gitignore
67+
echo ".DS_Store" > .gitignore
68+
echo "--- add .nojekyll"
69+
touch .nojekyll
70+
echo "--- push"
71+
git add .
72+
git commit -am "initial commit"
73+
git push
74+
cd ..
75+
echo "--- END FILE UPDATES"
76+
echo "--- MANUAL NOTES"
77+
echo "Manually disable releases, packages, and deployments"

0 commit comments

Comments
 (0)