Skip to content

Commit 95d7a2a

Browse files
authored
Remove references to review server (#55494)
1 parent bbd2f5d commit 95d7a2a

File tree

6 files changed

+17
-70
lines changed

6 files changed

+17
-70
lines changed

.github/workflows/review-comment.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ jobs:
4040
- name: check out repo content
4141
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4242
- uses: ./.github/actions/node-npm-setup
43-
# We're setting the URLs manually until we merge in-progress work. We can utilize review server and its helper functions in a later iteration.
43+
4444
- name: Set APP_URL
4545
run: |
4646
if [[ "${{ github.repository }}" == "github/docs-internal" ]]; then
47-
echo "APP_URL=https://docs-review.github.com" >> $GITHUB_ENV
47+
echo "APP_URL=https://docs-internal-staging-TREE.githubapp.com/en" >> $GITHUB_ENV
4848
elif [[ "${{ github.repository }}" == 'github/docs' ]]; then
49-
echo "APP_URL=https://os-docs-review.github.com" >> $GITHUB_ENV
49+
echo "APP_URL=https://adjective-noun-hash-4000.app.github.dev" >> $GITHUB_ENV
5050
fi
5151
- name: Find code changes comment
5252
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
@@ -60,13 +60,9 @@ jobs:
6060
timeout-minutes: 30
6161
env:
6262
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
REVIEW_SERVER: o
64-
REVIEW_SERVER_ACCESS_TOKEN: ${{ secrets.REVIEW_SERVER_ACCESS_TOKEN }}
6563
APP_URL: ${{ env.APP_URL }}
6664
BASE_SHA: ${{ github.event.pull_request.base.sha }}
6765
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
68-
# HEAD_BRANCH isn't necessary for the table comment, but lets us list the branch in the review server menu bar
69-
HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
7066
run: npm run content-changes-table-comment
7167
- name: Update comment
7268
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
@@ -88,9 +84,9 @@ jobs:
8884
8985
<details><summary>Table of review links</summary>
9086
91-
⚠️ **Warning**: Our review server is experiencing latency issues.
87+
**Note**: Please update the URL for your staging server or codespace.
9288
93-
${{ steps.changes.outputs.changesTable && 'The table shows the files in the `content` directory that were changed in this pull request. This helps you review your changes on the review server. Changes to the `data` directory are not included in this table.' || '' }}
89+
${{ steps.changes.outputs.changesTable && 'The table shows the files in the `content` directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the `data` directory are not included in this table.' || '' }}
9490
9591
${{ steps.changes.outputs.changesTable || '_This pull request contains code changes, so we will not generate a table of review links._' }}
9692

src/bookmarklets/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Clicking the bookmark will then execute the JavaScript.
1717

1818
[`src/bookmarklets/view-in-development.js`](./view-in-development.js)
1919

20-
When you're looking at a page on docs.github.com or a review server, clicking this bookmarklet will load the same path you're viewing but on your local server running at localhost:4000.
20+
When you're looking at a page on docs.github.com, clicking this bookmarklet will load the same path you're viewing but on your local server running at localhost:4000.
2121

2222
## "View in production" toggle
2323

2424
[`src/bookmarklets/view-in-production.js`](./view-in-production.js)
2525

26-
When you're looking at a page on a review server or your local server running at localhost:4000, clicking this bookmarklet will load the same path you're viewing but on the live documentation site at docs.github.com.
26+
When you're looking at a page on your local server running at localhost:4000, clicking this bookmarklet will load the same path you're viewing but on the live documentation site at docs.github.com.
2727

2828
## Open a docs article in VS Code
2929

src/deployments/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Documentation and build files for our deployments.
44

55
- For production deploys: [src/deployments/production](./production/)
6-
- For staging deploys (includes review servers): [src/deployments/staging](./staging/)
6+
- For staging deploys: [src/deployments/staging](./staging/)

src/deployments/staging/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> [!NOTE]
44
> For internal documentation, please see the `Moda` directory in the internal Docs Engineering repo.
55
6-
When you make a code change and want to review it in a live environment, you can use a staging server. If your change only touches content files e.g. `content/` and `data/` directories, please use the [review server](../../review-server/README.md) instead.
6+
When you make a code change and want to review it in a live environment, you can use a staging server.
77

88
To review code changes on a staging server:
99

src/workflows/content-changes-table-comment-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ program
3030

3131
const args = program.args
3232
const [owner, repo, baseSHA, headSHA] = args
33-
console.log(await main(owner, repo, baseSHA, headSHA, { isFork: false }))
33+
console.log(await main(owner, repo, baseSHA, headSHA))

src/workflows/content-changes-table-comment.ts

Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ import { allVersionShortnames } from '@/versions/lib/all-versions.js'
2424
import readFrontmatter from '@/frame/lib/read-frontmatter.js'
2525
import { inLiquid } from './lib/in-liquid'
2626

27-
const {
28-
GITHUB_TOKEN,
29-
REVIEW_SERVER,
30-
REVIEW_SERVER_ACCESS_TOKEN,
31-
APP_URL,
32-
HEAD_BRANCH,
33-
BASE_SHA,
34-
HEAD_SHA,
35-
} = process.env
27+
const { GITHUB_TOKEN, APP_URL, BASE_SHA, HEAD_SHA } = process.env
3628
const context = github.context
3729

3830
// the max size of the comment (in bytes)
@@ -46,32 +38,17 @@ const PROD_URL = 'https://docs.github.com'
4638

4739
// When this file is invoked directly from action as opposed to being imported
4840
if (import.meta.url.endsWith(process.argv[1])) {
49-
const isFork = context.payload.pull_request!.head.repo.fork
50-
51-
const headOwner = context.payload.pull_request!.head.repo.owner.login
52-
const headRepo = context.payload.pull_request!.head.repo.name
53-
5441
const baseOwner = context.payload.pull_request!.base.repo.owner.login
5542
const baseRepo = context.payload.pull_request!.base.repo.name
5643

5744
const baseSHA = BASE_SHA || context.payload.pull_request!.base.sha
5845
const headSHA = HEAD_SHA || context.payload.pull_request!.head.sha
5946

60-
const markdownTable = await main(baseOwner, baseRepo, baseSHA, headSHA, {
61-
isFork,
62-
headOwner,
63-
headRepo,
64-
})
47+
const markdownTable = await main(baseOwner, baseRepo, baseSHA, headSHA)
6548
core.setOutput('changesTable', markdownTable)
6649
}
6750

68-
async function main(
69-
owner: string,
70-
repo: string,
71-
baseSHA: string,
72-
headSHA: string,
73-
{ isFork, headOwner, headRepo }: { isFork: boolean; headOwner?: string; headRepo?: string },
74-
) {
51+
async function main(owner: string, repo: string, baseSHA: string, headSHA: string) {
7552
if (!GITHUB_TOKEN) {
7653
throw new Error(`GITHUB_TOKEN environment variable not set`)
7754
}
@@ -84,29 +61,6 @@ async function main(
8461
auth: `token ${GITHUB_TOKEN}`,
8562
})
8663

87-
// we'll attach the branch or sha right after this
88-
let queryParams = ''
89-
if (REVIEW_SERVER) {
90-
const searchParams = new URLSearchParams({
91-
'review-server-repository': isFork ? `${headOwner}/${headRepo}` : `${owner}/${repo}`,
92-
})
93-
94-
// this token will be available in the internal repo only, skip it for the open source repo
95-
if (REVIEW_SERVER_ACCESS_TOKEN) {
96-
searchParams.append('review-server-access-token', REVIEW_SERVER_ACCESS_TOKEN)
97-
}
98-
99-
// this script compares with SHAs only, so this allows us
100-
// to surface the branch name for the review server bar
101-
if (HEAD_BRANCH) {
102-
searchParams.append('review-server-branch', HEAD_BRANCH)
103-
} else if (headSHA) {
104-
searchParams.append('review-server-sha', headSHA)
105-
}
106-
107-
queryParams = `?${searchParams.toString()}`
108-
}
109-
11064
// get the list of file changes from the PR
11165
// this works even if the head commit is from a fork
11266
const response = await octokit.rest.repos.compareCommitsWithBasehead({
@@ -178,7 +132,7 @@ async function main(
178132
return
179133
}
180134

181-
return makeRow({ file, fileName, sourceUrl, fileUrl, queryParams, data })
135+
return makeRow({ file, fileName, sourceUrl, fileUrl, data })
182136
}),
183137
)
184138

@@ -193,7 +147,6 @@ async function main(
193147
fileName,
194148
sourceUrl: file.blob_url,
195149
fileUrl,
196-
queryParams,
197150
data,
198151
fromReusable: true,
199152
})
@@ -239,15 +192,13 @@ type File = {
239192
function makeRow({
240193
file,
241194
fileUrl,
242-
queryParams,
243195
fileName,
244196
sourceUrl,
245197
data,
246198
fromReusable,
247199
}: {
248200
file: File
249201
fileUrl: string
250-
queryParams: string
251202
fileName: string
252203
sourceUrl: string
253204
data: any
@@ -282,12 +233,12 @@ function makeRow({
282233
if (versions.toString() === nonEnterpriseDefaultVersion) {
283234
// omit version from fpt url
284235

285-
reviewCell += `[${plan}](${APP_URL}/${fileUrl}${queryParams})<br>`
236+
reviewCell += `[${plan}](${APP_URL}/${fileUrl})<br>`
286237
prodCell += `[${plan}](${PROD_URL}/${fileUrl})<br>`
287238
} else {
288239
// for non-versioned releases (ghec) use full url
289240

290-
reviewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl}${queryParams})<br>`
241+
reviewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl})<br>`
291242
prodCell += `[${plan}](${PROD_URL}/${versions}/${fileUrl})<br>`
292243
}
293244
} else if (versions.length) {
@@ -297,7 +248,7 @@ function makeRow({
297248
prodCell += `${plan}@ `
298249

299250
versions.forEach((version) => {
300-
reviewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}${queryParams}) `
251+
reviewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) `
301252
prodCell += `[${version.split('@')[1]}](${PROD_URL}/${version}/${fileUrl}) `
302253
})
303254
reviewCell += '<br>'

0 commit comments

Comments
 (0)