Skip to content

Commit

Permalink
Create ghes release features (#36718)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmari authored May 1, 2023
1 parent 2876eda commit 7c7ec90
Show file tree
Hide file tree
Showing 32 changed files with 116 additions and 175 deletions.
14 changes: 6 additions & 8 deletions .github/actions-scripts/create-enterprise-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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 =
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/enterprise-dates.yml
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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 }}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/open-enterprise-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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', },
Expand Down
4 changes: 2 additions & 2 deletions data/release-notes/enterprise-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>enterprise-<em>VERSION</em>-release</code> 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

Expand Down
5 changes: 1 addition & 4 deletions lib/enterprise-server-releases.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
53 changes: 27 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
Loading

0 comments on commit 7c7ec90

Please sign in to comment.