Rename preview to review where applicable (#54510)
Co-authored-by: Evan Bonsignori <ebonsignori@github.com>
This commit is contained in:
@@ -6,6 +6,6 @@ contributing/
|
|||||||
docs/
|
docs/
|
||||||
node_modules/
|
node_modules/
|
||||||
tests/
|
tests/
|
||||||
# Folder is cloned during the preview + prod workflows, the assets are merged into other locations for use before the build
|
# Folder is cloned during the Dockerfile build
|
||||||
docs-early-access/
|
docs-early-access/
|
||||||
README.md
|
README.md
|
||||||
|
|||||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -13,10 +13,10 @@ If there's _not_ an existing issue, please open one first to make it more likely
|
|||||||
### What's being changed (if available, include any code snippets, screenshots, or gifs):
|
### What's being changed (if available, include any code snippets, screenshots, or gifs):
|
||||||
|
|
||||||
<!-- Let us know what you are changing. Share anything that could provide the most context.
|
<!-- Let us know what you are changing. Share anything that could provide the most context.
|
||||||
If you made changes to the `content` directory, a table will populate in a comment below with links to the preview and current production articles. -->
|
If you made changes to the `content` directory, a table will populate in a comment below with links to the review and current production articles. -->
|
||||||
|
|
||||||
### Check off the following:
|
### Check off the following:
|
||||||
|
|
||||||
- [ ] A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
|
- [ ] A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
|
||||||
- [ ] The changes in this PR meet [the docs fundamentals that are required for all content](http://docs.github.com/en/contributing/writing-for-github-docs/about-githubs-documentation-fundamentals).
|
- [ ] The changes in this PR meet [the docs fundamentals that are required for all content](http://docs.github.com/en/contributing/writing-for-github-docs/about-githubs-documentation-fundamentals).
|
||||||
- [ ] All CI checks are passing and the changes look good in the preview environment.
|
- [ ] All CI checks are passing and the changes look good in the review environment.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ npm ci
|
|||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
You should now have a running server. To access your local preview environment, visit [localhost:4000](http://localhost:4000) in your browser.
|
You should now have a running server. To access your local environment, visit [localhost:4000](http://localhost:4000) in your browser.
|
||||||
|
|
||||||
When you're ready to stop your local server, type <kbd>Ctrl</kbd>+<kbd>C</kbd> in your terminal window.
|
When you're ready to stop your local server, type <kbd>Ctrl</kbd>+<kbd>C</kbd> in your terminal window.
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Power users may want to read more about [debugging the docs application](./debug
|
|||||||
|
|
||||||
As an alternative, you can simply use [GitHub Codespaces](https://docs.github.com/en/codespaces/overview). For more information about using a codespace for working on GitHub documentation, see [Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md).
|
As an alternative, you can simply use [GitHub Codespaces](https://docs.github.com/en/codespaces/overview). For more information about using a codespace for working on GitHub documentation, see [Working in a codespace](https://github.com/github/docs/blob/main/contributing/codespace.md).
|
||||||
|
|
||||||
In a matter of minutes, you will be ready to edit, preview and test your changes directly from the comfort of your browser.
|
In a matter of minutes, you will be ready to edit, review and test your changes directly from the comfort of your browser.
|
||||||
|
|
||||||
### Using browser shortcuts
|
### Using browser shortcuts
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | todocs-placeholder | Catch occurrences of TODOCS placeholder. | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | todocs-placeholder | Catch occurrences of TODOCS placeholder. | error | |
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | docs-domain | Catch occurrences of docs.github.com domain. | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | docs-domain | Catch occurrences of docs.github.com domain. | error | |
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | help-domain | Catch occurrences of help.github.com domain. | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | help-domain | Catch occurrences of help.github.com domain. | error | |
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | preview-domain | Catch occurrences of preview.ghdocs.com domain. | error | |
|
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | developer-domain | Catch occurrences of developer.github.com domain. | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | developer-domain | Catch occurrences of developer.github.com domain. | error | |
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: site.data | Catch occurrences of deprecated liquid data syntax. | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: site.data | Catch occurrences of deprecated liquid data syntax. | error | |
|
||||||
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: octicon-<icon-name> | The octicon liquid syntax used is deprecated. Use this format instead `octicon "<octicon-name>" aria-label="<Octicon aria label>"` | error | |
|
| [search-replace](https://github.com/OnkarRuikar/markdownlint-rule-search-replace) | deprecated liquid syntax: octicon-<icon-name> | The octicon liquid syntax used is deprecated. Use this format instead `octicon "<octicon-name>" aria-label="<Octicon aria label>"` | error | |
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export default async function dynamicAssets(
|
|||||||
// likely never be enjoyed by network or human eyes.
|
// likely never be enjoyed by network or human eyes.
|
||||||
effort = 1
|
effort = 1
|
||||||
} else if (process.env.NODE_ENV === 'development') {
|
} else if (process.env.NODE_ENV === 'development') {
|
||||||
// If you're doing local development (or preview!), the
|
// If you're doing local development (or review), the
|
||||||
// network is not precious (localhost:4000) and you have no
|
// network is not precious (localhost:4000) and you have no
|
||||||
// CDN to cache it for you. Make it low but not too unrealistically
|
// CDN to cache it for you. Make it low but not too unrealistically
|
||||||
// low.
|
// low.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
//
|
//
|
||||||
// Generally writers don't check in bogus/corrupt images but mistakes
|
// Generally writers don't check in bogus/corrupt images but mistakes
|
||||||
// can happen and it's ideally spotted in other processes such as
|
// can happen and it's ideally spotted in other processes such as
|
||||||
// reviewing PR preview environment.
|
// reviewing PR review environment.
|
||||||
// This script also makes sure that all images really are what they're
|
// This script also makes sure that all images really are what they're
|
||||||
// called. For example, an image might be named `screenshot.png` but
|
// called. For example, an image might be named `screenshot.png` but
|
||||||
// it might actually be something mischievous.
|
// it might actually be something mischievous.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Bookmarklets
|
# Bookmarklets
|
||||||
|
|
||||||
The [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet) in this directory are browser shortcuts that may help with reviewing GitHub documentation. We may eventually build the functionality they provide into Docs preview environments, but these are handy hacks for now.
|
The [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet) in this directory are browser shortcuts that may help with reviewing GitHub documentation. We may eventually build the functionality they provide into Docs review environments, but these are handy hacks for now.
|
||||||
|
|
||||||
## Installing bookmarklets
|
## Installing bookmarklets
|
||||||
|
|
||||||
@@ -17,19 +17,19 @@ Clicking the bookmark will then execute the JavaScript.
|
|||||||
|
|
||||||
[`src/bookmarklets/view-in-development.js`](./view-in-development.js)
|
[`src/bookmarklets/view-in-development.js`](./view-in-development.js)
|
||||||
|
|
||||||
When you're looking at a page on docs.github.com or a preview server at preview.ghdocs.com, clicking this bookmarklet will load the same path you're viewing but on your local server running at localhost:4000.
|
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.
|
||||||
|
|
||||||
## "View in production" toggle
|
## "View in production" toggle
|
||||||
|
|
||||||
[`src/bookmarklets/view-in-production.js`](./view-in-production.js)
|
[`src/bookmarklets/view-in-production.js`](./view-in-production.js)
|
||||||
|
|
||||||
When you're looking at a page on a preview server at preview.ghdocs.com 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.
|
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.
|
||||||
|
|
||||||
## Open a docs article in VS Code
|
## Open a docs article in VS Code
|
||||||
|
|
||||||
[`src/bookmarklets/open-in-vscode.js`](./open-in-vscode.js)
|
[`src/bookmarklets/open-in-vscode.js`](./open-in-vscode.js)
|
||||||
|
|
||||||
When you're looking at a page on either docs.github.com, preview.ghdocs.com, or localhost:4000, clicking this bookmarklet will open the source Markdown file from your local checkout in VS Code.
|
When you're looking at a page on either docs.github.com, review, or localhost:4000, clicking this bookmarklet will open the source Markdown file from your local checkout in VS Code.
|
||||||
|
|
||||||
The installation requires a few steps:
|
The installation requires a few steps:
|
||||||
|
|
||||||
|
|||||||
@@ -266,15 +266,6 @@ export const searchReplaceConfig = {
|
|||||||
'partial-markdown-files': true,
|
'partial-markdown-files': true,
|
||||||
'yml-files': true,
|
'yml-files': true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'preview-domain',
|
|
||||||
message: 'Catch occurrences of preview.ghdocs.com domain.',
|
|
||||||
search: 'preview.ghdocs.com',
|
|
||||||
searchScope: 'all',
|
|
||||||
severity: 'error',
|
|
||||||
'partial-markdown-files': true,
|
|
||||||
'yml-files': true,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'developer-domain',
|
name: 'developer-domain',
|
||||||
message: 'Catch occurrences of developer.github.com domain.',
|
message: 'Catch occurrences of developer.github.com domain.',
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ describe(searchReplace.names.join(' - '), () => {
|
|||||||
'docs.github.com',
|
'docs.github.com',
|
||||||
'- help.github.com',
|
'- help.github.com',
|
||||||
'[help.github.com](//developer.github.com)',
|
'[help.github.com](//developer.github.com)',
|
||||||
'',
|
|
||||||
' docs.github.com',
|
' docs.github.com',
|
||||||
'developer.github.com/enterprise',
|
'developer.github.com/enterprise',
|
||||||
'developer.github.com/enterprise/',
|
'developer.github.com/enterprise/',
|
||||||
@@ -44,7 +43,7 @@ describe(searchReplace.names.join(' - '), () => {
|
|||||||
ruleConfig: searchReplaceConfig['search-replace'],
|
ruleConfig: searchReplaceConfig['search-replace'],
|
||||||
})
|
})
|
||||||
const errors = result.markdown
|
const errors = result.markdown
|
||||||
expect(errors.length).toBe(10)
|
expect(errors.length).toBe(8)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Deprecated Liquid syntax causes error', async () => {
|
test('Deprecated Liquid syntax causes error', async () => {
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export default function rewriteLocalLinks(context) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (!isProd) {
|
if (!isProd) {
|
||||||
// This runs when doing local preview, link checker tests, or
|
// This runs when doing local review, link checker tests, or
|
||||||
// running a script like `update-internal-links.js`.
|
// running a script like `update-internal-links.js`.
|
||||||
visit(tree, matcherAnchorLinks, (node) => {
|
visit(tree, matcherAnchorLinks, (node) => {
|
||||||
for (const child of node.children || []) {
|
for (const child of node.children || []) {
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> For internal documentation, please see the `Moda` directory in the internal Docs Engineering repo.
|
> For internal documentation, please see the `Moda` directory in the internal Docs Engineering repo.
|
||||||
|
|
||||||
When you make a code change and want to preview 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.
|
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.
|
||||||
|
|
||||||
To preview code changes on a staging server:
|
To review code changes on a staging server:
|
||||||
|
|
||||||
1. If your changes aren't already in remote, push your branch to `docs-internal` .
|
1. If your changes aren't already in remote, push your branch to `docs-internal` .
|
||||||
2. Open a draft PR with your changes.
|
2. Open a draft PR with your changes.
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ export function initializeExperiments(
|
|||||||
experiment.percentOfUsersToGetExperiment,
|
experiment.percentOfUsersToGetExperiment,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Even in preview & prod it is useful to see if a given experiment is "on" or "off"
|
// In any environment, it is useful to see if a given experiment is "on" or "off"
|
||||||
console.log(
|
console.log(
|
||||||
`Experiment ${experiment.key} is in the "${controlGroup === TREATMENT_VARIATION ? TREATMENT_VARIATION : CONTROL_VARIATION}" group for this browser.\nCall function window.overrideControlGroup('${experiment.key}', 'treatment' | 'control') to change your group for this session.`,
|
`Experiment ${experiment.key} is in the "${controlGroup === TREATMENT_VARIATION ? TREATMENT_VARIATION : CONTROL_VARIATION}" group for this browser.\nCall function window.overrideControlGroup('${experiment.key}', 'treatment' | 'control') to change your group for this session.`,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Deeper than the product level, the names and directories can be whatever
|
|||||||
you want it to be.
|
you want it to be.
|
||||||
|
|
||||||
Once you've found a place to put some fixture content, before writing
|
Once you've found a place to put some fixture content, before writing
|
||||||
a `vitest` test, you can preview your changes using:
|
a `vitest` test, you can review your changes using:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
npm run fixture-dev
|
npm run fixture-dev
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default async function createTree(originalPath, rootPath, previousTree) {
|
|||||||
filepath = `${originalPath}/index.md`
|
filepath = `${originalPath}/index.md`
|
||||||
// Note, if this throws, that's quite fine. It usually means that
|
// Note, if this throws, that's quite fine. It usually means that
|
||||||
// there's a `index.md` whose `children:` entry lists something that
|
// there's a `index.md` whose `children:` entry lists something that
|
||||||
// doesn't exist on disk. So the writer who tries to preview the
|
// doesn't exist on disk. So the writer who tries to review the
|
||||||
// page will see the error and it's hopefully clear what's actually
|
// page will see the error and it's hopefully clear what's actually
|
||||||
// wrong.
|
// wrong.
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default async function getRemoteJSON(url, config) {
|
|||||||
}
|
}
|
||||||
cache.set(cacheKey, JSON.parse(res.body))
|
cache.set(cacheKey, JSON.parse(res.body))
|
||||||
|
|
||||||
// Only write to disk for testing and local preview.
|
// Only write to disk for testing and local review.
|
||||||
// In production, we never write to disk. Only in-memory.
|
// In production, we never write to disk. Only in-memory.
|
||||||
if (!inProd) {
|
if (!inProd) {
|
||||||
fs.mkdirSync(path.dirname(onDisk), { recursive: true })
|
fs.mkdirSync(path.dirname(onDisk), { recursive: true })
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* This exists for local previewing. Only.
|
* This exists for local reviewing. Only.
|
||||||
* We load in the entire tree on startup, then that's used for things like
|
* We load in the entire tree on startup, then that's used for things like
|
||||||
* sidebars and breadcrumbs and landing pages and ToC pages (and possibly
|
* sidebars and breadcrumbs and landing pages and ToC pages (and possibly
|
||||||
* more).
|
* more).
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ async function getPageInfoFromCache(page: Page, pathname: string) {
|
|||||||
// a HTTP GET request will only happen once per deployment. That's
|
// a HTTP GET request will only happen once per deployment. That's
|
||||||
// because the CDN will cache it until the next deployment (which is
|
// because the CDN will cache it until the next deployment (which is
|
||||||
// followed by a CDN purge).
|
// followed by a CDN purge).
|
||||||
// In development (local preview), the performance doesn't really matter.
|
// In development (local review), the performance doesn't really matter.
|
||||||
// In CI, we use the caching because the CI runs
|
// In CI, we use the caching because the CI runs
|
||||||
// `npm run precompute-pageinfo` right before it runs vitest tests.
|
// `npm run precompute-pageinfo` right before it runs vitest tests.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Our REST pipeline creates autogenerated REST API documentation for docs.github.com/rest from the OpenAPI stored in the open-source repository [`github/rest-api-description`](https://github.com/github/rest-api-description).
|
Our REST pipeline creates autogenerated REST API documentation for docs.github.com/rest from the OpenAPI stored in the open-source repository [`github/rest-api-description`](https://github.com/github/rest-api-description).
|
||||||
|
|
||||||
The pipeline is used to generate data that is used by the docs.github.com site when deployed locally, in preview environments, or in production.
|
The pipeline is used to generate data that is used by the docs.github.com site when deployed locally, in review environments, or in production.
|
||||||
|
|
||||||
## How does it work
|
## How does it work
|
||||||
|
|
||||||
@@ -77,4 +77,4 @@ Writers can also add an introduction paragraph _above_ the following Markdown co
|
|||||||
Slack: `#docs-engineering`
|
Slack: `#docs-engineering`
|
||||||
Repo: `github/docs-engineering`
|
Repo: `github/docs-engineering`
|
||||||
|
|
||||||
If you have a question about the REST pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the REST pipeline, you can open an issue in the `github/docs-engineering` repository.
|
If you have a question about the REST pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the REST pipeline, you can open an issue in the `github/docs-engineering` repository.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const log = console.log
|
|||||||
|
|
||||||
log(
|
log(
|
||||||
chalk.green.bold(
|
chalk.green.bold(
|
||||||
'\nUse this script to build a local docs preview. You can build specific versions of the REST and Webhook docs.\n',
|
'\nUse this script to build a local docs review. You can build specific versions of the REST and Webhook docs.\n',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
log(chalk.white.bold(' Versions that can be built: ', openApiVersions, '\n'))
|
log(chalk.white.bold(' Versions that can be built: ', openApiVersions, '\n'))
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ router.get(
|
|||||||
searchCacheControl(res)
|
searchCacheControl(res)
|
||||||
// We can cache this without purging it after every deploy
|
// We can cache this without purging it after every deploy
|
||||||
// because the API search is only used as a proxy for local
|
// because the API search is only used as a proxy for local
|
||||||
// and preview environments.
|
// and review environments.
|
||||||
setFastlySurrogateKey(res, SURROGATE_ENUMS.MANUAL)
|
setFastlySurrogateKey(res, SURROGATE_ENUMS.MANUAL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function createRateLimiter(max = MAX) {
|
|||||||
|
|
||||||
keyGenerator: (req) => {
|
keyGenerator: (req) => {
|
||||||
let { ip } = req
|
let { ip } = req
|
||||||
// In our preview environments, with the way the proxying works,
|
// In our review environments, with the way the proxying works,
|
||||||
// the `x-forwarded-for` is always the origin IP with a port number
|
// the `x-forwarded-for` is always the origin IP with a port number
|
||||||
// attached. E.g. `75.40.90.27:56675, 169.254.129.1`
|
// attached. E.g. `75.40.90.27:56675, 169.254.129.1`
|
||||||
// This port number portion changes with every request, so we strip it.
|
// This port number portion changes with every request, so we strip it.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Our webhooks pipeline creates autogenerated webhooks documentation for docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads from the OpenAPI stored in the open-source repository [`github/rest-api-description`](https://github.com/github/rest-api-description).
|
Our webhooks pipeline creates autogenerated webhooks documentation for docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads from the OpenAPI stored in the open-source repository [`github/rest-api-description`](https://github.com/github/rest-api-description).
|
||||||
|
|
||||||
The pipeline is used to generate data that is used by the docs.github.com site when deployed locally, in preview environments, or in production.
|
The pipeline is used to generate data that is used by the docs.github.com site when deployed locally, in review environments, or in production.
|
||||||
|
|
||||||
## How does it work
|
## How does it work
|
||||||
|
|
||||||
@@ -56,4 +56,4 @@ The content writers can manually update frontmatter and introductory content in
|
|||||||
Slack: `#docs-engineering`
|
Slack: `#docs-engineering`
|
||||||
Repo: `github/docs-engineering`
|
Repo: `github/docs-engineering`
|
||||||
|
|
||||||
If you have a question about the webhooks pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the webhooks pipeline, you can open an issue in the `github/docs-engineering` repository.
|
If you have a question about the webhooks pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the webhooks pipeline, you can open an issue in the `github/docs-engineering` repository.
|
||||||
|
|||||||
Reference in New Issue
Block a user