diff --git a/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md b/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md index bb57869add..7eb3f2a227 100644 --- a/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md +++ b/.github/actions-scripts/enterprise-server-issue-templates/release-issue.md @@ -18,18 +18,29 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng ``` script/update-enterprise-dates.js ``` -- [ ] Create REST files based on previous version. Copy the latest GHES version of the decorate file from `src/rest/data` to a new file in the same directory for the new GHES release. Ex, `cp src/rest/data/ghes-3.4.json src/rest/data/ghes-3.5.json`. +- [ ] 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: + ``` + cp -rf src/rest/data/ghes-3.8 src/rest/data/ghes-3.9 + ``` -- [ ] Create GraphQL files based on previous version: +- [ ] Create GraphQL 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: ``` - script/enterprise-server-releases/create-graphql-files.js --oldVersion --newVersion + cp -rf src/graphql/data/ghes-3.8 src/graphql/data/ghes-3.9 + cp -rf data/graphql/ghes-3.8 data/graphql/ghes-3.9 ``` -- [ ] Create webhook files based on previous version: +- [ ] Create webhook 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: ``` - script/enterprise-server-releases/create-webhook-files.js --oldVersion --newVersion + cp -rf src/webhooks/data/ghes-3.8 src/webhooks/data/ghes-3.9 ``` + +- [ ] Create GitHub App 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: + + ``` + cp -rf src/github-apps/data/ghes-3.8 src/github-apps/data/ghes-3.9 + ``` + - [ ] Create a placeholder release notes file called `data/release-notes///PLACEHOLDER.yml`. For example `data/release-notes/enterprise-server/3-1/PLACEHOLDER.yml`. Add the following placeholder content to the file: **Note:** All of the content in this file will be updated when the release notes are created in the megabranch including the filename `PLACEHOLDER.yml`. You can update the date or leave it as-is and wait to update it when the release notes are finalized. @@ -243,6 +254,7 @@ If you aren't comfortable going through the steps alone, sync up with a docs eng ``` script/enterprise-server-releases/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 ``` - [ ] Create a PR with the above changes. This PR is used to track all docs changes and smoke tests associated with the release. For example https://github.com/github/docs-internal/pull/22286. diff --git a/script/enterprise-server-releases/create-graphql-files.js b/script/enterprise-server-releases/create-graphql-files.js deleted file mode 100755 index 7af92a9036..0000000000 --- a/script/enterprise-server-releases/create-graphql-files.js +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env node - -// [start-readme] -// -// This script creates the static GraphQL files for a new version. -// -// [end-readme] - -import fs from 'fs/promises' -import path from 'path' -import { program } from 'commander' -import { mkdirp } from 'mkdirp' -import { allVersions } from '../../lib/all-versions.js' - -const graphqlStaticDir = path.join(process.cwd(), 'src/graphql/data') -const graphqlDataDir = path.join(process.cwd(), 'data/graphql') - -program - .description('Create GraphQL files in src/graphql/data based on an existing version.') - .option( - '-n, --newVersion ', - 'The version to copy the files to. Must be in format.' - ) - .option( - '-o, --oldVersion ', - 'The version to copy the files from. Must be in format.' - ) - .parse(process.argv) - -const newVersion = program.opts().newVersion -const oldVersion = program.opts().oldVersion - -if (!(newVersion && oldVersion)) { - console.log('Error! You must provide --newVersion and --oldVersion.') - process.exit(1) -} - -if ( - !(Object.keys(allVersions).includes(newVersion) && Object.keys(allVersions).includes(oldVersion)) -) { - console.log( - 'Error! You must provide the full name of a currently supported version, e.g., enterprise-server@2.22.' - ) - process.exit(1) -} - -const newVersionId = allVersions[newVersion].miscVersionName -const oldVersionId = allVersions[oldVersion].miscVersionName - -// copy the schema file wholesale (there are separate schema files per version) -const newSchemaFile = path.join(graphqlStaticDir, `schema-${newVersionId}.json`) -const oldSchemaFile = path.join(graphqlStaticDir, `schema-${oldVersionId}.json`) -await fs.copyFile(oldSchemaFile, newSchemaFile) - -// check that it worked -try { - await fs.readFile(newSchemaFile) -} catch (e) { - console.log(`Error! Can't find ${newSchemaFile}.`) - process.exit(1) -} - -// the other files are objects with versions as keys, so we need to require them -const previewsFile = path.join(graphqlStaticDir, 'previews.json') -const changesFile = path.join(graphqlStaticDir, 'upcoming-changes.json') - -const previews = JSON.parse(await fs.readFile(previewsFile)) -const changes = JSON.parse(await fs.readFile(changesFile)) - -previews[newVersionId] = previews[oldVersionId] -changes[newVersionId] = changes[oldVersionId] - -// check that it worked -if (!Object.keys(previews).includes(newVersionId)) { - console.log(`Error! Can't find ${newVersionId} in ${previewsFile}.`) - process.exit(1) -} - -if (!Object.keys(changes).includes(newVersionId)) { - console.log(`Error! Can't find ${newVersionId} in ${changesFile}.`) - process.exit(1) -} - -// write the new files -await fs.writeFile(previewsFile, JSON.stringify(previews, null, 2)) -await fs.writeFile(changesFile, JSON.stringify(changes, null, 2)) - -// now create the new version directory in data/graphql -const srcDir = path.join(graphqlDataDir, oldVersionId) -const destDir = path.join(graphqlDataDir, newVersionId) -await mkdirp(destDir) - -// copy the files -const files = await fs.readdir(srcDir) -for (const file of files) { - const srcFile = path.join(srcDir, file) - const destFile = path.join(destDir, file) - await fs.copyFile(srcFile, destFile) -} - -// check that it worked -try { - const destDirResult = await fs.readdir(destDir) - if (!destDirResult.length) { - console.log(`Error! The directory created at ${destDir} is empty.`) - process.exit(1) - } -} catch (e) { - console.log(`Error! A new directory was not successfully created at ${destDir}.`) - process.exit(1) -} - -// print success message -console.log(`Done! Copied ${oldVersion} GraphQL files to ${newVersion} files.`) diff --git a/script/enterprise-server-releases/create-webhook-files.js b/script/enterprise-server-releases/create-webhook-files.js deleted file mode 100755 index 32465c49a5..0000000000 --- a/script/enterprise-server-releases/create-webhook-files.js +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env node - -// [start-readme] -// -// This script creates new static webhook payload files for a new version. -// -// [end-readme] - -import fs from 'fs' -import { mkdirp } from 'mkdirp' -import path from 'path' -import { program } from 'commander' -import { allVersions } from '../../lib/all-versions.js' - -const payloadsDir = 'src/webhooks/data' - -program - .description( - 'Create new payload files in src/webhooks/data/ based on an existing version.' - ) - .option( - '-n, --newVersion ', - 'The version to copy the payloads to. Must be in format.' - ) - .option( - '-o, --oldVersion ', - 'The version to copy the payloads from. Must be in format.' - ) - .parse(process.argv) - -const newVersion = program.opts().newVersion -const oldVersion = program.opts().oldVersion - -if (!(newVersion && oldVersion)) { - console.log('Error! You must provide --newVersion and --oldVersion.') - process.exit(1) -} - -if ( - !(Object.keys(allVersions).includes(newVersion) && Object.keys(allVersions).includes(oldVersion)) -) { - console.log( - 'Error! You must provide the full name of a currently supported version, e.g., enterprise-server@2.22.' - ) - process.exit(1) -} - -const newVersionDirName = allVersions[newVersion].miscVersionName -const oldVersionDirName = allVersions[oldVersion].miscVersionName - -const srcDir = path.join(payloadsDir, oldVersionDirName) -const destDir = path.join(payloadsDir, newVersionDirName) - -// create the new directory -await mkdirp(destDir) - -// copy the files -fs.readdirSync(srcDir).forEach((file) => { - const srcFile = path.join(srcDir, file) - const destFile = path.join(destDir, file) - fs.copyFileSync(srcFile, destFile) -}) - -// check that it worked -if (!fs.existsSync(destDir)) { - console.log(`Error! A new directory was not successfully created at ${destDir}.`) - process.exit(1) -} - -if (!fs.readdirSync(destDir).length) { - console.log(`Error! The directory created at ${destDir} is empty.`) - process.exit(1) -} - -// print success message -console.log(`Done! Copied ${srcDir} to ${destDir}.`) diff --git a/tests/fixtures/README.md b/tests/fixtures/README.md index 8fd77347d6..299a404857 100644 --- a/tests/fixtures/README.md +++ b/tests/fixtures/README.md @@ -58,9 +58,9 @@ ROOT=tests/fixtures jest tests/rendering-fixtures/ ### Exceptions -The top-level product names in the fixture content needs to be a pefect +The top-level product names in the fixture content needs to be a perfect subset of the product names in the real content. That's because they -get compiled in to the Next rewrite functionalty so we can support +get compiled in to the Next rewrite functionality so we can support URLs that actually are `free-pro-team@latest` without mentioning it in the URL.