diff --git a/.github/actions-scripts/create-enterprise-issue.js b/.github/actions-scripts/create-enterprise-issue.js index 6d94daa626..07b9493537 100755 --- a/.github/actions-scripts/create-enterprise-issue.js +++ b/.github/actions-scripts/create-enterprise-issue.js @@ -5,7 +5,7 @@ import path from 'path' import { getOctokit } from '@actions/github' import { latest, oldestSupported } from '../../lib/enterprise-server-releases.js' const enterpriseDates = JSON.parse( - await fs.readFile(path.join(process.cwd(), 'lib/enterprise-dates.json')) + await fs.readFile(path.join(process.cwd(), 'src/ghes-releases/lib/enterprise-dates.json')) ) const acceptedMilestones = ['release', 'deprecation'] @@ -23,7 +23,8 @@ const numberOfdaysBeforeDeprecationToOpenIssue = 15 // // When a milestone is within the specified number of days, a new issue is // created using the templates in -// .github/actions-scripts/enterprise-server-issue-templates. +// src/ghes-releases/lib/release-steps.md +// and src/ghes-releases/lib/deprecation-steps.md. // // Release issues are then added to the docs content squad board for triage. // Deprecations issues are owned by docs engineering and are added to the @@ -53,7 +54,7 @@ async function run() { if (!versionNumber) { console.log( - `Could not find the next version number after ${latest} in enterprise-dates.json. Try running script/update-enterprise-dates.js, then rerun this script.` + `Could not find the next version number after ${latest} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.` ) process.exit(0) } @@ -62,7 +63,7 @@ async function run() { if (!datesForVersion) { console.log( - `Could not find ${versionNumber} in enterprise-dates.json. Try running script/update-enterprise-dates.js, then rerun this script.` + `Could not find ${versionNumber} in enterprise-dates.json. Try running src/ghes-releases/scripts/update-enterprise-dates.js, then rerun this script.` ) process.exit(0) } @@ -79,10 +80,7 @@ async function run() { } const milestoneSteps = await fs.readFile( - path.join( - process.cwd(), - `.github/actions-scripts/enterprise-server-issue-templates/${milestone}-issue.md` - ), + path.join(process.cwd(), `src/ghes-releases/lib/${milestone}-steps.md`), 'utf8' ) const issueLabels = diff --git a/.github/workflows/enterprise-dates.yml b/.github/workflows/enterprise-dates.yml index 858fa76647..eb0ddcd5b9 100644 --- a/.github/workflows/enterprise-dates.yml +++ b/.github/workflows/enterprise-dates.yml @@ -1,8 +1,10 @@ name: Enterprise date updater -# **What it does**: Runs on a schedule to update lib/enterprise-dates.json. -# **Why we have it**: The lib/enterprise-dates.json file needs to be up-to-date -# for the .github/workflows/open-enterprise-issue.yml workflow and the +# **What it does**: Runs on a schedule to update +# src/ghes-releases/lib/enterprise-dates.json. +# **Why we have it**: The src/ghes-releases/lib/enterprise-dates.json +# file needs to be up-to-date for the +# .github/workflows/open-enterprise-issue.yml workflow and the # tests/content/search.js test. # **Who does it impact**: Docs engineering, docs content. @@ -40,9 +42,9 @@ jobs: - uses: ./.github/actions/node-npm-setup - - name: Run script/update-enterprise-dates.js + - name: Run src/ghes-releases/scripts/update-enterprise-dates.js run: | - script/update-enterprise-dates.js + src/ghes-releases/scripts/update-enterprise-dates.js env: GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }} @@ -55,8 +57,8 @@ jobs: with: # need to use a token with repo and workflow scopes for this step token: ${{ secrets.GITHUB_TOKEN }} - commit-message: '🤖 ran script/update-enterprise-dates.js' - title: 🤖 lib/enterprise-dates.json update + commit-message: '🤖 ran src/ghes-releases/scripts/update-enterprise-dates.js' + title: 🤖 src/ghes-releases/lib/enterprise-dates.json update body: "Hello! The GitHub Enterprise Server release dates have changed.\n\n If CI passes, this PR will be auto-merged. :green_heart:\n\n diff --git a/.github/workflows/open-enterprise-issue.yml b/.github/workflows/open-enterprise-issue.yml index a307a9df58..2776329e90 100644 --- a/.github/workflows/open-enterprise-issue.yml +++ b/.github/workflows/open-enterprise-issue.yml @@ -33,7 +33,7 @@ jobs: - name: Update enterprise dates if: steps.existingIssue.outputs.deprecationIssue == 'false' || steps.existingIssue.outputs.releaseIssue == 'false' run: | - script/update-enterprise-dates.js + src/ghes-releases/scripts/update-enterprise-dates.js env: GITHUB_TOKEN: ${{ secrets.DOCS_BOT_FR }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e37ab19de..00a7bcfaf4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: { name: 'content', path: 'tests/content', }, { name: 'automated-pipelines', path: 'src/automated-pipelines/tests', }, { name: 'events', path: 'src/events/tests', }, + { name: 'ghes-releases', path: 'src/ghes-releases/tests', }, { name: 'graphql', path: 'src/graphql/tests', }, { name: 'rest', path: 'src/rest/tests', }, { name: 'webhooks', path: 'src/webhooks/tests', }, diff --git a/data/release-notes/enterprise-server/README.md b/data/release-notes/enterprise-server/README.md index 9915b5c498..6fbc2d1b06 100644 --- a/data/release-notes/enterprise-server/README.md +++ b/data/release-notes/enterprise-server/README.md @@ -4,12 +4,12 @@ Rendered here: https://docs.github.com/en/enterprise-server@latest/admin/release ## Adding release notes to a deprecated GitHub Enterprise Server release -During the deprecation of a GitHub Enterprise Server release per [this issue template](/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md), Docs Engineering removes the YAML files with the version's release notes from `github/docs-internal`. +During the deprecation of a GitHub Enterprise Server release per [this issue template](/src/ghes-releases/lib/deprecation-steps.md), Docs Engineering removes the YAML files with the version's release notes from `github/docs-internal`. If a stakeholder requests an update to deprecated release notes, you can update the notes by completing the following steps. 1. Check out the long-running branch enterprise-VERSION-release and create a PR to update the release notes for the deprecated version on that branch. -2. Reach out to #docs-engineering to request a re-scrape and update of the content stored in Azure. See the section about re-scraping content in the [deprecation checklist](/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md). +2. Reach out to #docs-engineering to request a re-scrape and update of the content stored in Azure. See the section about re-scraping content in the [deprecation checklist](/src/ghes-releases/lib/deprecation-steps.md). ## How it works diff --git a/lib/enterprise-server-releases.js b/lib/enterprise-server-releases.js index 75b6122175..d3b5093935 100644 --- a/lib/enterprise-server-releases.js +++ b/lib/enterprise-server-releases.js @@ -1,12 +1,9 @@ -import path from 'path' import fs from 'fs/promises' import semver from 'semver' import versionSatisfiesRange from './version-satisfies-range.js' -export const dates = JSON.parse( - await fs.readFile(path.join(process.cwd(), './lib/enterprise-dates.json')) -) +export const dates = JSON.parse(await fs.readFile('src/ghes-releases/lib/enterprise-dates.json')) // GHES Release Lifecycle Dates: // enterprise-releases/docs/supported-versions.md#release-lifecycle-dates diff --git a/package-lock.json b/package-lock.json index 255383aed5..ae8f440f2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -160,7 +160,8 @@ "start-server-and-test": "^2.0.0", "typescript": "^5.0.2", "unist-util-remove": "^3.1.1", - "unist-util-visit-parents": "^5.1.3" + "unist-util-visit-parents": "^5.1.3", + "website-scraper": "^5.3.1" }, "engines": { "node": "^16 || ^18" @@ -169,7 +170,7 @@ "esm": "^3.2.25", "jest-puppeteer": "^5.0.4", "puppeteer": "^9.1.1", - "website-scraper": "^5.0.0" + "website-scraper": "^5.3.1" } }, "node_modules/@actions/core": { @@ -7268,7 +7269,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-url-parser/-/css-url-parser-1.1.3.tgz", "integrity": "sha512-KO4HrqK3lAlrnobbBEHib/lFRw7kGOlQTLYhwTwWzDEGilGTYIYOpI22d+6euyZiqfZpV96pii87ZufifbxpqA==", - "optional": true + "dev": true }, "node_modules/css-what": { "version": "6.1.0", @@ -9328,7 +9329,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "optional": true, + "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -13210,7 +13211,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "optional": true, + "dev": true, "dependencies": { "universalify": "^2.0.0" }, @@ -15372,7 +15373,7 @@ "version": "7.3.4", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz", "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==", - "optional": true, + "dev": true, "dependencies": { "eventemitter3": "^4.0.7", "p-timeout": "^5.0.2" @@ -15388,7 +15389,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "optional": true, + "dev": true, "engines": { "node": ">=12" }, @@ -17122,7 +17123,7 @@ "version": "1.6.3", "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", - "optional": true, + "dev": true, "dependencies": { "truncate-utf8-bytes": "^1.0.0" } @@ -17622,8 +17623,8 @@ }, "node_modules/srcset": { "version": "5.0.0", + "dev": true, "license": "MIT", - "optional": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -18346,7 +18347,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", - "optional": true, + "dev": true, "dependencies": { "utf8-byte-length": "^1.0.1" } @@ -18732,7 +18733,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "optional": true, + "dev": true, "engines": { "node": ">= 10.0.0" } @@ -18810,7 +18811,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==", - "optional": true + "dev": true }, "node_modules/util-deprecate": { "version": "1.0.2", @@ -19197,7 +19198,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/website-scraper/-/website-scraper-5.3.1.tgz", "integrity": "sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==", - "optional": true, + "dev": true, "dependencies": { "cheerio": "1.0.0-rc.12", "css-url-parser": "^1.0.0", @@ -19217,7 +19218,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", - "optional": true, + "dev": true, "engines": { "node": ">=12.20" }, @@ -24460,7 +24461,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/css-url-parser/-/css-url-parser-1.1.3.tgz", "integrity": "sha512-KO4HrqK3lAlrnobbBEHib/lFRw7kGOlQTLYhwTwWzDEGilGTYIYOpI22d+6euyZiqfZpV96pii87ZufifbxpqA==", - "optional": true + "dev": true }, "css-what": { "version": "6.1.0" @@ -25787,7 +25788,7 @@ "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "optional": true, + "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -28586,7 +28587,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "optional": true, + "dev": true, "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" @@ -29863,7 +29864,7 @@ "version": "7.3.4", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.4.tgz", "integrity": "sha512-esox8CWt0j9EZECFvkFl2WNPat8LN4t7WWeXq73D9ha0V96qPRufApZi4ZhPwXAln1uVVal429HVVKPa2X0yQg==", - "optional": true, + "dev": true, "requires": { "eventemitter3": "^4.0.7", "p-timeout": "^5.0.2" @@ -29873,7 +29874,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", - "optional": true + "dev": true }, "p-try": { "version": "2.2.0", @@ -30951,7 +30952,7 @@ "version": "1.6.3", "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.3.tgz", "integrity": "sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==", - "optional": true, + "dev": true, "requires": { "truncate-utf8-bytes": "^1.0.0" } @@ -31275,7 +31276,7 @@ }, "srcset": { "version": "5.0.0", - "optional": true + "dev": true }, "stack-utils": { "version": "2.0.5", @@ -31722,7 +31723,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", - "optional": true, + "dev": true, "requires": { "utf8-byte-length": "^1.0.1" } @@ -31962,7 +31963,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "optional": true + "dev": true }, "unpipe": { "version": "1.0.0" @@ -32006,7 +32007,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==", - "optional": true + "dev": true }, "util-deprecate": { "version": "1.0.2" @@ -32267,7 +32268,7 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/website-scraper/-/website-scraper-5.3.1.tgz", "integrity": "sha512-gogqPXD2gVsxoyd2yRiympw3rA5GuEpD1CaDEJ/J8zzanx7hkbTtneoO1SGs436PpLbWVcUge+6APGLhzsuZPA==", - "optional": true, + "dev": true, "requires": { "cheerio": "1.0.0-rc.12", "css-url-parser": "^1.0.0", @@ -32284,7 +32285,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-7.2.0.tgz", "integrity": "sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==", - "optional": true + "dev": true } } }, diff --git a/package.json b/package.json index 844d935fdb..29125c842c 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,8 @@ "start-server-and-test": "^2.0.0", "typescript": "^5.0.2", "unist-util-remove": "^3.1.1", - "unist-util-visit-parents": "^5.1.3" + "unist-util-visit-parents": "^5.1.3", + "website-scraper": "^5.3.1" }, "engines": { "node": "^16 || ^18" @@ -174,7 +175,7 @@ "esm": "^3.2.25", "jest-puppeteer": "^5.0.4", "puppeteer": "^9.1.1", - "website-scraper": "^5.0.0" + "website-scraper": "^5.3.1" }, "private": true, "repository": "https://github.com/github/docs", diff --git a/script/README.md b/script/README.md index a9c7bca1fe..de5941f023 100644 --- a/script/README.md +++ b/script/README.md @@ -256,57 +256,6 @@ This script is run on a writer's machine while developing Early Access content l --- -### [`enterprise-server-deprecations/archive-version.js`](enterprise-server-deprecations/archive-version.js) - -Run this script during the Enterprise deprecation process to download static copies of all pages for the oldest supported Enterprise version. See the Enterprise deprecation issue template for instructions. - -NOTE: If you get this error: - - Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'website-scraper' ... - -it's because you haven't installed all the *optional* dependencies. To do that, run: - - npm install --include=optional - - ---- - - -### [`enterprise-server-deprecations/remove-static-files.js`](enterprise-server-deprecations/remove-static-files.js) - -This script removes the static GraphQL, REST, and webhook files for any deprecated GHES versions. - ---- - - -### [`enterprise-server-deprecations/remove-version-markup.js`](enterprise-server-deprecations/remove-version-markup.js) - -Run this script after an Enterprise deprecation to remove Liquid statements and frontmatter that contain the deprecated Enterprise version. See the Enterprise deprecation issue template for instructions. - ---- - - -### [`enterprise-server-releases/create-graphql-files.js`](enterprise-server-releases/create-graphql-files.js) - -This script creates the static GraphQL files for a new version. - ---- - - -### [`enterprise-server-releases/create-webhook-files.js`](enterprise-server-releases/create-webhook-files.js) - -This script creates new static webhook payload files for a new version. - ---- - - -### [`enterprise-server-releases/release-banner.js`](enterprise-server-releases/release-banner.js) - -This script creates or removes a release candidate banner for a specified version. - ---- - - ### [`find-orphaned-assets.js`](find-orphaned-assets.js) Print a list of all the asset files that can't be found mentioned in any of the source files (content & code). @@ -388,13 +337,6 @@ Pass this script any old dotcom path (e.g., `articles/foo` or `foo.md`) and it w ---- - - -### [`helpers/get-version-blocks.js`](helpers/get-version-blocks.js) - - - --- @@ -412,19 +354,6 @@ Pass this script any old dotcom path (e.g., `articles/foo` or `foo.md`) and it w --- -### [`helpers/remove-deprecated-frontmatter.js`](helpers/remove-deprecated-frontmatter.js) - - - ---- - - -### [`helpers/remove-liquid-statements.js`](helpers/remove-liquid-statements.js) - - - ---- - ### [`helpers/retry-on-error-test.js`](helpers/retry-on-error-test.js) @@ -726,13 +655,6 @@ Find and replace lightweight feature flags for GitHub AE content. --- -### [`update-enterprise-dates.js`](update-enterprise-dates.js) - -This script fetches data from https://github.com/github/enterprise-releases/blob/master/releases.json and updates `lib/enterprise-dates.json`, which the site uses for various functionality. - ---- - - ### [`update-internal-links.js`](update-internal-links.js) Run this script to find internal links in all content and data Markdown files, check if either the title or link (or both) are outdated, and automatically update them if so. diff --git a/src/ghes-releases/README.md b/src/ghes-releases/README.md new file mode 100644 index 0000000000..28b0a6f921 --- /dev/null +++ b/src/ghes-releases/README.md @@ -0,0 +1,20 @@ +# GHES releases + +New GHES releases are cut about every 3 months and around the same time, the oldest release is deprecated (or unofficially supported). The release schedule is located here: src/ghes-releases/lib/enterprise-dates.json + +## How does it work + +The docs content team creates new releases and the docs engineering team deprecates releases. An issue reminding the teams about releases and deprecations are opened up automatically in the docs-content (for releases) and docs-engineering repos (for deprecations). + +## About this directory + +- `src/ghes-releases/lib` - The release and deprecation issue templates used as a checklist. +- `src/ghes-releases/scripts` - The scripts used to create new releases and deprecations for GHES. +- `src/ghes-releases/tests` - The tests used to verify the GHES releases and deprecations + +## How to get help + +Slack: `#docs-engineering` +Repo: `github/docs-engineering` + +If you have a question about this feature, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with this feature, you can open an issue in the `github/docs-engineering` repository. diff --git a/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md b/src/ghes-releases/lib/deprecation-steps.md similarity index 93% rename from .github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md rename to src/ghes-releases/lib/deprecation-steps.md index 5b415386e4..c6311ffe12 100644 --- a/.github/actions-scripts/enterprise-server-issue-templates/deprecation-issue.md +++ b/src/ghes-releases/lib/deprecation-steps.md @@ -1,6 +1,6 @@ ## Overview -The day after a GHES version's [deprecation date](https://github.com/github/docs-internal/tree/main/lib/enterprise-dates.json), a banner on the docs will say: `This version was deprecated on .` 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. +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 .` 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. **Note**: Do each step below in a separate PR. Only move on to the next step when the previous PR has been merged. @@ -33,7 +33,7 @@ Additionally, download: ``` Then run the archive script: ``` - $ script/enterprise-server-deprecations/archive-version.js + $ src/ghes-releases/scripts/archive-version.js ``` This will generate a directory in `github/docs-internal` called `tmpArchivalDir_`. For example 'tmpArchivalDir_3.0'. You can also create a specific output directory using the `--output` flag. @@ -120,7 +120,7 @@ Poke around several pages, ensure that the stylesheets are working properly, ima **Note:** We do not remove the old content for GHES release notes. New release notes can be added after we perform a deprecation in some rare cases, and not removing this content makes it easier for us to re-scrape the content to add to Azure Blob Storage. - [ ] In your `docs-internal` checkout, create a new branch `remove--static-files` branch: `git checkout -b remove--static-files` (you can branch off of `main` or from your `deprecate-` branch, up to you). -- [ ] Run `script/enterprise-server-deprecations/remove-static-files.js` and commit results. +- [ ] Run `src/ghes-releases/scripts/remove-static-files.js` and commit results. - [ ] Re-generate the static files by running `src/rest/scripts/update-files.js --decorate-only`. - [ ] Open a new PR. - [ ] Get a review from docs-engineering and merge. This step can be merged independently from step 6. The purpose of splitting up steps 5 and 6 is to focus the review on specific files. @@ -129,7 +129,7 @@ Poke around several pages, ensure that the stylesheets are working properly, ima - [ ] In your `docs-internal` checkout, create a new branch `remove--markup` branch: `git checkout -b remove--markup` (you can branch off of `main` or from your `deprecate-` branch, up to you). - [ ] Remove the outdated Liquid markup and frontmatter. - - [ ] Run the script: `script/enterprise-server-deprecations/remove-version-markup.js --release `. + - [ ] Run the script: `src/ghes-releases/scripts/remove-version-markup.js --release `. - [ ] Spot check a few changes. Content, frontmatter, and data files should all have been updated. - [ ] Open a PR with the results. The diff may be large and complex, so make sure to get a review from `@github/docs-content`. - [ ] Debug any test failures or unexpected results -- it's very likely manual updates will be necessary, the script does a lot of work but doesn't automate everything and can't 100% replace human intent. @@ -152,7 +152,7 @@ Poke around several pages, ensure that the stylesheets are working properly, ima ## Re-scraping a page or all pages -Occasionally, a change will need to be added to our archived enterprise versions. If this occurs, you can check out the `enterprise--release` branch and re-scrape the page or all pages using `script/enterprise-server-deprecations/archive-version.js`. To scrape a single page you can use the `—page ` option. +Occasionally, a change will need to be added to our archived enterprise versions. If this occurs, you can check out the `enterprise--release` branch and re-scrape the page or all pages using `src/ghes-releases/scripts/archive-version.js`. To scrape a single page you can use the `—page ` option. For each language, upload the new file to Azure blob storage in the `enterprise` container. @@ -162,4 +162,4 @@ After uploading the new files, you will need to purge the Fastly cache for the s Enter the URL or path and do a soft purge. -![](/contributing/images/fastly_purge_url.jpg) +![](/contributing/images/fastly_purge_url.jpg) \ No newline at end of file diff --git a/lib/enterprise-dates.json b/src/ghes-releases/lib/enterprise-dates.json similarity index 100% rename from lib/enterprise-dates.json rename to src/ghes-releases/lib/enterprise-dates.json diff --git a/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md b/src/ghes-releases/lib/release-steps.md similarity index 95% rename from .github/actions-scripts/enterprise-server-issue-templates/release-issue.md rename to src/ghes-releases/lib/release-steps.md index 7eb3f2a227..a5d3a69355 100644 --- a/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md +++ b/src/ghes-releases/lib/release-steps.md @@ -16,7 +16,7 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng - [ ] Run the script to update the dates file: ``` - script/update-enterprise-dates.js + src/ghes-releases/scripts/update-enterprise-dates.js ``` - [ ] Create REST files based on previous version. Copy the latest GHES release data to a new directory for new release. For example, if the current release is 3.8 and the new release is 3.9: ``` @@ -253,7 +253,7 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng - [ ] If this is a release candidate release, add a Release Candidate banner: ``` - script/enterprise-server-releases/release-banner.js --action create --version + src/ghes-releases/scripts/release-banner.js --action create --version script/copy-fixture-data.js // This updates the fixtures to match the updated data/variables/release_candidate.yml file ``` @@ -283,11 +283,11 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng #### `Node.js tests / test content` failures -If the `Node.js tests / test content` check fails with the following message, the `lib/enterprise-dates.json` file is not up-to-date: +If the `Node.js tests / test content` check fails with the following message, the `src/ghes-releases/lib/enterprise-dates.json` file is not up-to-date: > FAIL tests/content/search.js ● search › has remote indexNames in every language for every supported GHE version -This file should be automatically updated, but you can also run `script/update-enterprise-dates.js` to update it. **Note:** If the test is still failing after running this script, look at the dates for this release. If the date is still inaccurate, it may be an issue with the source at https://github.com/github/enterprise-releases/blob/master/docs/supported-versions.md#release-lifecycle-dates. If that is the case, manually update the dates in the `lib/enterprise-dates.json` file. +This file should be automatically updated, but you can also run `src/ghes-releases/scripts/update-enterprise-dates.js` to update it. **Note:** If the test is still failing after running this script, look at the dates for this release. If the date is still inaccurate, it may be an issue with the source at https://github.com/github/enterprise-releases/blob/master/docs/supported-versions.md#release-lifecycle-dates. If that is the case, manually update the dates in the `src/ghes-releases/lib/enterprise-dates.json` file. ### Before shipping the release branch @@ -324,4 +324,4 @@ This file should be automatically updated, but you can also run `script/update-e - [ ] You (or they) can now remove your blocking review on the auto-generated "Update OpenAPI Descriptions" PR in public REST API description (the `rest-api-descriptions` repo). (although it's likely newer PRs have been created since yours with the blocking review, in which case the Ecosystem-API team will close your PR and perform the next step on the most recent PR). - [ ] The Ecosystem-API team will merge the latest auto-generated "Update OpenAPI Descriptions" PR (which will contain the OpenAPI schema config that changed `published` to `true` for the release). - [ ] After unfreezing, if there were significant or highlighted GraphQL changes in the release, consider manually running the [GraphQL update workflow](https://github.com/github/docs-internal/actions/workflows/update-graphql-files.yml) to update our GraphQL schemas. By default this workflow only runs once every 24 hours. -- [ ] After the release, in the `docs-content` repo, add the now live version number to the "Specific GHES version(s)" section in [`.github/ISSUE_TEMPLATE/release-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tracking.yml). When the PR is approved, merge it in. +- [ ] After the release, in the `docs-content` repo, add the now live version number to the "Specific GHES version(s)" section in [`.github/ISSUE_TEMPLATE/release-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tracking.yml). When the PR is approved, merge it in. \ No newline at end of file diff --git a/script/enterprise-server-deprecations/archive-version.js b/src/ghes-releases/scripts/archive-version.js similarity index 93% rename from script/enterprise-server-deprecations/archive-version.js rename to src/ghes-releases/scripts/archive-version.js index 85de8a6170..939cc2db65 100755 --- a/script/enterprise-server-deprecations/archive-version.js +++ b/src/ghes-releases/scripts/archive-version.js @@ -6,15 +6,6 @@ // static copies of all pages for the oldest supported Enterprise version. // See the Enterprise deprecation issue template for instructions. // -// NOTE: If you get this error: -// -// Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'website-scraper' ... -// -// it's because you haven't installed all the *optional* dependencies. -// To do that, run: -// -// npm install --include=optional -// // [end-readme] import path from 'path' @@ -25,11 +16,11 @@ import { program } from 'commander' import { rimraf } from 'rimraf' import http from 'http' -import createApp from '../../lib/app.js' -import EnterpriseServerReleases from '../../lib/enterprise-server-releases.js' -import loadRedirects from '../../lib/redirects/precompile.js' -import { loadPageMap } from '../../lib/page-data.js' -import { languageKeys } from '../../lib/languages.js' +import createApp from '../../../lib/app.js' +import EnterpriseServerReleases from '../../../lib/enterprise-server-releases.js' +import loadRedirects from '../../../lib/redirects/precompile.js' +import { loadPageMap } from '../../../lib/page-data.js' +import { languageKeys } from '../../../lib/languages.js' const port = '4001' const host = `http://localhost:${port}` diff --git a/script/helpers/get-version-blocks.js b/src/ghes-releases/scripts/get-version-blocks.js similarity index 96% rename from script/helpers/get-version-blocks.js rename to src/ghes-releases/scripts/get-version-blocks.js index 57757051fc..46ff0dd63c 100644 --- a/script/helpers/get-version-blocks.js +++ b/src/ghes-releases/scripts/get-version-blocks.js @@ -1,4 +1,4 @@ -import supportedOperators from '../../lib/liquid-tags/ifversion-supported-operators.js' +import supportedOperators from '../../../lib/liquid-tags/ifversion-supported-operators.js' // Turn an array of Liquid conditional objects that results from ./get-liquid-conditionals.js into a more // detailed array of objects that includes GHES versioning information. diff --git a/script/enterprise-server-releases/release-banner.js b/src/ghes-releases/scripts/release-banner.js similarity index 96% rename from script/enterprise-server-releases/release-banner.js rename to src/ghes-releases/scripts/release-banner.js index 1d2dfa1637..8d5f65ab25 100755 --- a/script/enterprise-server-releases/release-banner.js +++ b/src/ghes-releases/scripts/release-banner.js @@ -10,7 +10,8 @@ import fs from 'fs/promises' import path from 'path' import { program } from 'commander' import yaml from 'js-yaml' -import { allVersions } from '../../lib/all-versions.js' + +import { allVersions } from '../../../lib/all-versions.js' const releaseCandidateFile = 'data/variables/release_candidate.yml' const releaseCandidateYaml = path.join(process.cwd(), releaseCandidateFile) diff --git a/script/helpers/remove-deprecated-frontmatter.js b/src/ghes-releases/scripts/remove-deprecated-frontmatter.js similarity index 100% rename from script/helpers/remove-deprecated-frontmatter.js rename to src/ghes-releases/scripts/remove-deprecated-frontmatter.js diff --git a/script/helpers/remove-liquid-statements.js b/src/ghes-releases/scripts/remove-liquid-statements.js similarity index 96% rename from script/helpers/remove-liquid-statements.js rename to src/ghes-releases/scripts/remove-liquid-statements.js index be7f34fb46..f4f8e71816 100644 --- a/script/helpers/remove-liquid-statements.js +++ b/src/ghes-releases/scripts/remove-liquid-statements.js @@ -1,8 +1,10 @@ -import { getLiquidConditionalsWithContent } from './get-liquid-conditionals.js' -import getVersionBlocks from './get-version-blocks.js' -import { allVersions } from '../../lib/all-versions.js' -import supportedOperators from '../../lib/liquid-tags/ifversion-supported-operators.js' import { Tokenizer } from 'liquidjs' + +import { getLiquidConditionalsWithContent } from '../../../script/helpers/get-liquid-conditionals.js' +import getVersionBlocks from './get-version-blocks.js' +import { allVersions } from '../../../lib/all-versions.js' +import supportedOperators from '../../../lib/liquid-tags/ifversion-supported-operators.js' + const supportedShortVersions = Object.values(allVersions).map((v) => v.shortName) const ghaeRangeRegex = new RegExp(`ghae (${supportedOperators.join('|')})`) const updateRangeKeepGhes = 'updateRangeKeepGhes' @@ -14,9 +16,10 @@ const tokenize = (str) => { const tokenizer = new Tokenizer(str) return tokenizer.readTopLevelTokens() } -// This module is used by script/enterprise-server-deprecations/remove-version-markup.js to remove +// This module is used by +// src/ghes-releases/scripts/remove-version-markup.js to remove // and update Liquid conditionals when a GHES release is being deprecated. It is also used by -// tests/content/remove-liquid-statements.js. +// src/ghes-releases/tests/remove-liquid-statements.js. export default function removeLiquidStatements(content, release, nextOldestRelease, file) { let newContent = content diff --git a/script/enterprise-server-deprecations/remove-static-files.js b/src/ghes-releases/scripts/remove-static-files.js similarity index 93% rename from script/enterprise-server-deprecations/remove-static-files.js rename to src/ghes-releases/scripts/remove-static-files.js index 54e28bfd6a..860f0cf678 100755 --- a/script/enterprise-server-deprecations/remove-static-files.js +++ b/src/ghes-releases/scripts/remove-static-files.js @@ -2,7 +2,8 @@ // [start-readme] // -// This script removes the static GraphQL, REST, and webhook files for any deprecated GHES versions. +// This script removes the static GraphQL, REST, and webhook files for any +// deprecated GHES versions. // // [end-readme] @@ -10,8 +11,9 @@ import fs from 'fs' import path from 'path' import { rimraf } from 'rimraf' import walk from 'walk-sync' -import { allVersions } from '../../lib/all-versions.js' -import { deprecated } from '../../lib/enterprise-server-releases.js' + +import { allVersions } from '../../../lib/all-versions.js' +import { deprecated } from '../../../lib/enterprise-server-releases.js' const graphqlDataDir = path.join(process.cwd(), 'data/graphql') const webhooksStaticDir = path.join(process.cwd(), 'src/webhooks/data') diff --git a/script/enterprise-server-deprecations/remove-version-markup.js b/src/ghes-releases/scripts/remove-version-markup.js similarity index 89% rename from script/enterprise-server-deprecations/remove-version-markup.js rename to src/ghes-releases/scripts/remove-version-markup.js index 7a4f1974c4..ecb0da717e 100755 --- a/script/enterprise-server-deprecations/remove-version-markup.js +++ b/src/ghes-releases/scripts/remove-version-markup.js @@ -9,11 +9,12 @@ import fs from 'fs' import { program } from 'commander' -import frontmatter from '../../lib/read-frontmatter.js' -import removeLiquidStatements from '../../script/helpers/remove-liquid-statements.js' -import removeDeprecatedFrontmatter from '../../script/helpers/remove-deprecated-frontmatter.js' -import { all, getNextReleaseNumber } from '../../lib/enterprise-server-releases.js' -import walkFiles from '../helpers/walk-files.js' + +import frontmatter from '../../../lib/read-frontmatter.js' +import removeLiquidStatements from './remove-liquid-statements.js' +import removeDeprecatedFrontmatter from './remove-deprecated-frontmatter.js' +import { all, getNextReleaseNumber } from '../../../lib/enterprise-server-releases.js' +import walkFiles from '../../../script/helpers/walk-files.js' program .description( diff --git a/script/update-enterprise-dates.js b/src/ghes-releases/scripts/update-enterprise-dates.js similarity index 90% rename from script/update-enterprise-dates.js rename to src/ghes-releases/scripts/update-enterprise-dates.js index 4968677e78..1ed382c863 100755 --- a/script/update-enterprise-dates.js +++ b/src/ghes-releases/scripts/update-enterprise-dates.js @@ -3,16 +3,17 @@ // [start-readme] // // This script fetches data from https://github.com/github/enterprise-releases/blob/master/releases.json -// and updates `lib/enterprise-dates.json`, which the site uses for various functionality. +// and updates `src/ghes-releases/lib/enterprise-dates.json`, which the site uses for various functionality. // // [end-readme] import { fileURLToPath } from 'url' import path from 'path' -import { getContents } from './helpers/git-utils.js' import fs from 'fs/promises' -const __dirname = path.dirname(fileURLToPath(import.meta.url)) +import { getContents } from '../../../script/helpers/git-utils.js' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) const enterpriseDatesFile = path.join(__dirname, '../lib/enterprise-dates.json') const enterpriseDatesString = await fs.readFile(enterpriseDatesFile, 'utf8') diff --git a/tests/fixtures/remove-liquid-statements/and-greater-than1.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/and-greater-than1.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/and-greater-than1.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/and-greater-than1.md diff --git a/tests/fixtures/remove-liquid-statements/and-greater-than2.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/and-greater-than2.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/and-greater-than2.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/and-greater-than2.md diff --git a/tests/fixtures/remove-liquid-statements/equals.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/equals.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/equals.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/equals.md diff --git a/tests/fixtures/remove-liquid-statements/frontmatter1.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/frontmatter1.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/frontmatter1.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/frontmatter1.md diff --git a/tests/fixtures/remove-liquid-statements/frontmatter2.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/frontmatter2.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/frontmatter2.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/frontmatter2.md diff --git a/tests/fixtures/remove-liquid-statements/greater-than.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/greater-than.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/greater-than.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/greater-than.md diff --git a/tests/fixtures/remove-liquid-statements/less-than-next-oldest.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/less-than-next-oldest.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/less-than-next-oldest.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/less-than-next-oldest.md diff --git a/tests/fixtures/remove-liquid-statements/not-equals.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/not-equals.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/not-equals.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/not-equals.md diff --git a/tests/fixtures/remove-liquid-statements/unnecessary.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/unnecessary.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/unnecessary.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/unnecessary.md diff --git a/tests/fixtures/remove-liquid-statements/whitespace.md b/src/ghes-releases/tests/fixtures/remove-liquid-statements/whitespace.md similarity index 100% rename from tests/fixtures/remove-liquid-statements/whitespace.md rename to src/ghes-releases/tests/fixtures/remove-liquid-statements/whitespace.md diff --git a/tests/content/remove-liquid-statements.js b/src/ghes-releases/tests/remove-liquid-statements.js similarity index 97% rename from tests/content/remove-liquid-statements.js rename to src/ghes-releases/tests/remove-liquid-statements.js index 57b02eb1a8..1a1baf917f 100644 --- a/tests/content/remove-liquid-statements.js +++ b/src/ghes-releases/tests/remove-liquid-statements.js @@ -3,10 +3,10 @@ import path from 'path' import cheerio from 'cheerio' import matter from 'gray-matter' import fs from 'fs/promises' -import removeLiquidStatements from '../../script/helpers/remove-liquid-statements' -import removeDeprecatedFrontmatter from '../../script/helpers/remove-deprecated-frontmatter' +import removeLiquidStatements from '../scripts/remove-liquid-statements' +import removeDeprecatedFrontmatter from '../scripts/remove-deprecated-frontmatter' const __dirname = path.dirname(fileURLToPath(import.meta.url)) -const removeLiquidStatementsFixtures = path.join(__dirname, '../fixtures/remove-liquid-statements') +const removeLiquidStatementsFixtures = path.join(__dirname, './fixtures/remove-liquid-statements') // Hardcode values so tests don't go out of date const versionToDeprecate = '2.13'