Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #21615

Merged
merged 14 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The day after a GHES version's [deprecation date](https://github.com/github/docs

The following large repositories are used throughout this checklist, it may be useful to clone them before you begin:

- `github/help-docs-archived-enterprise-versions`
- `github/github`
- `github/docs-internal`

Expand All @@ -18,46 +17,85 @@ Additionally, you may want to download:

**Note**: This step can be performed independently of all other steps, and can be done several days before or along with the other steps.

- [ ] In the `docs-content` repo, remove the deprecated GHES version number from the "Specific GHES version(s)" section in the following files (in the `.github/ISSUE_TEMPLATE/` directory): [`release-tier-1-or-2-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml) and [`release-tier-3-or-tier-4.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml).
- [ ] In the `docs-content` repo, remove the deprecated GHES version number from the `options` list in the following files (in the `.github/ISSUE_TEMPLATE/` directory): [`release-tier-1-or-2-tracking.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-1-or-2-tracking.yml) and [`release-tier-3-or-tier-4.yml`](https://github.com/github/docs-content/blob/main/.github/ISSUE_TEMPLATE/release-tier-3-or-tier-4.yml).
- [ ] When the PR is approved, merge it in. This can be merged independently from all other steps.

## Step 1: Scrape the docs and archive the files

- [ ] In your checkout of the [repo with archived GHES content](https://github.com/github/help-docs-archived-enterprise-versions), create a new branch: `git checkout -b deprecate-<version>`
- [ ] In your `docs-internal` checkout, download the static files for the oldest supported version into your archival checkout:
The archive script depends on an optional dependency so install optional dependencies first:
```
$ npm i --include-optional
$ npm i --include=optional
```
Ensure your build is up to date:
```
$ npm run build
```
Then run the archive script:
```
$ script/enterprise-server-deprecations/archive-version.js -p <path-to-archive-repo-checkout>
$ script/enterprise-server-deprecations/archive-version.js
```
If your checkouts live in the same directory, this command would be:

This will generate a directory in `github/docs-internal` called `tmpArchivalDir_<VERSION_TO_DEPRECATE>`. For example 'tmpArchivalDir_3.0'. You can also create a specific output directory using the `--output` flag.

**Note:** You can pass the `--dry-run` flag to scrape only the first 10 pages plus their redirects for testing purposes. **If you use the dry run command, be sure to run the full script without `--dry-run` before you commit the changes.**

## Step 3: Manually remove the search input from the archived docs

- [ ] Search for `site-search-input` in the compressed Javascript files (should find the file in the `_next` directory). When you find it, use something like https://beautifier.io/ or VSCode to reformat it to be readable. To reformat using VSCode, use the "Format document" option or <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>F</kbd>. Find `site-search-input` in the file, the result will be enclosed in a function that looks something like... `(0,f.jsx)("input",{"data-testid":"site-search-input",` Delete the entire function. For example, this:
```
$ script/enterprise-server-deprecations/archive-version.js -p ../help-docs-archived-enterprise-versions
(0, f.jsxs)("label", {
className: "text-normal width-full",
children: [(0, f.jsx)("span", {
className: "visually-hidden",
"aria-label": R($ || ($ = (0, k.Z)(["label"]))),
"aria-describedby": R(W || (W = (0, k.Z)(["description"]))),
children: R(U || (U = (0, k.Z)(["placeholder"])))
}), (0, f.jsx)("input", {
"data-testid": "site-search-input",
ref: I,
className: h()(pe().searchInput, 24 === p && pe().searchIconBackground24, 24 === p && "form-control px-6 f4", 16 === p && pe().searchIconBackground16, 16 === p && "form-control px-5 f4", "compact" === i && "py-2", "expanded" === i && "py-3", r && pe().searchInputHeader, !r && "width-full", r && j && pe().searchInputExpanded, r && j && "position-absolute top-0 right-0"),
type: "search",
placeholder: R(G || (G = (0, k.Z)(["placeholder"]))),
autoComplete: _ ? "on" : "off",
autoCorrect: "off",
autoCapitalize: "off",
spellCheck: "false",
maxLength: 512,
onChange: function(e) {
S(e.target.value)
},
value: _,
"aria-label": R(K || (K = (0, k.Z)(["label"]))),
"aria-describedby": R(J || (J = (0, k.Z)(["description"])))
})
```
**Note:** You can pass the `--dry-run` flag to scrape only the first 10 pages plus their redirects for testing purposes. **If you use the dry run command, be sure to run the full script without `--dry-run` before you commit the changes.**

## Step 2: Upload the assets directory to Azure storage
becomes:

```
(0, f.jsxs)('label', {
className: 'text-normal width-full',
children: [
(0, f.jsx)('span', {
className: 'visually-hidden',
'aria-label': y(Q || (Q = (0, k.Z)(['label']))),
'aria-describedby': y(X || (X = (0, k.Z)(['description']))),
children: y(ee || (ee = (0, k.Z)(['placeholder']))),
}),
],
}),
```
- [ ] Save the file. If using beautifier, copy and paste the updated file back into your temp directory with the scraped archive content.

## Step 2: Upload the scraped content directory to Azure storage

- [ ] Log in to the Azure portal from Okta. Navigate to the [githubdocs Azure Storage Blob resource](https://portal.azure.com/#@githubazure.onmicrosoft.com/resource/subscriptions/fa6134a7-f27e-4972-8e9f-0cedffa328f1/resourceGroups/docs-production/providers/Microsoft.Storage/storageAccounts/githubdocs/overview).
- [ ] Click the "Open in Explorer" button to the right of search box. If you haven't already, click the download link to download "Microsoft Azure Storage Explorer." To login to the app, click the plug icon in the left sidebar and click the option to "add an azure account." When you login, you'll need a yubikey to authenticate through Okta.
- [ ] From the Microsoft Azure Storage Explorer app, select the `githubdocs` storage account resource and navigate to the `github-images` blob container.
- [ ] Click "Upload" and select "Upload folder." Click the "Selected folder" input to navigate to the `help-docs-archived-enterprise-versions` repository and select the `assets` directory for the version you just generated. In the "Destination directory" input, add the version number. For example, `/enterprise/2.22/`.
- [ ] From the Microsoft Azure Storage Explorer app, select the `githubdocs` storage account resource and navigate to the `enterprise` blob container.
- [ ] Click "Upload" and select "Upload folder." Click the "Selected folder" input to navigate to the temp directory you just generated. Inside that temp directory, select the `<VERSION_TO_DEPRECATE>` directory (e.g., `3.2`). Leave the destination directory input blank.
- [ ] Check the log to ensure all files were uploaded successfully.
- [ ] Remove the `assets` directory from your `help-docs-archived-enterprise-versions` repository, we don't want to commit that directory in the next step.

## Step 3: Commit and push changes to help-docs-archived-enterprise-versions repo

- [ ] Search for `site-search-input` in the compressed Javascript files (should find the file in the `_next` directory). When you find it, use something like https://beautifier.io/ or VSCode to reformat it to be readable. To reformat using VSCode, use the "Format document" option or <kbd>Shift</kbd>+<kbd>Option</kbd>+<kbd>F</kbd>. Find `site-search-input` in the file, the result will be enclosed in a function that looks something like... `1125: function () { ... },` Delete the innards of this function, but leave the `function() {}` part.
- [ ] Save the file. If using beautifier, copy and paste the updated file back into your local `help-docs-archived-enterprise-versions` repository.
- [ ] In your archival checkout, `git add <version>`, commit, and push.
- [ ] Open a PR and merge it in. Note that the version will _not_ be deprecated on the docs site until you do the next step.
- [ ] Remove the temporarily created directory from your `github/docs-internal` checkout.

## Step 4: Deprecate the version in docs-internal

Expand All @@ -71,22 +109,13 @@ In your `docs-internal` checkout:
You can test that the static pages were generated correctly on localhost and on staging. Verify that the static pages are accessible by running `npm run dev` in your local `docs-internal` checkout and navigate to:
`http://localhost:3000/enterprise/<version>/`.

Note: the GitHub Pages deployment from the previous step will need to have completed successfully in order for you to test this. You may need to wait up to 10 minutes for this to occur.

Poke around several pages, ensure that the stylesheets are working properly, images are rendering properly, and that the search functionality was disabled.

## Step 5: Continue to deprecate the version in docs-internal

- [ ] Open a new PR. Make sure to check the following:
- [ ] Tests are passing (you may need to include the changes in step 6 to get tests to pass).
- [ ] The deprecated version renders in preview as expected. You should be able to navigate to `docs.github.com/enterprise/<DEPRECATED VERSION>` to access the docs. You should also be able to navigate to a page that is available in the deprecated version and change the version in the URL to the deprecated version, to test redirects.
- [ ] The new oldest supported version renders on staging as expected. You should see a banner on the top of every page for the oldest supported version that notes when the version will be deprecated.

## Step 5: Remove static files for the version

- [ ] In your `docs-internal` checkout, create a new branch `remove-<version>-static-files` branch: `git checkout -b remove-<version>-static-files` (you can branch off of `main` or from your `deprecate-<version>` branch, up to you).
- [ ] Run `script/enterprise-server-deprecations/remove-static-files.js` and commit results.
- [ ] Run `script/enterprise-server-deprecations/remove-redirects.js` and commit results.
- [ ] Re-generate the static files by running `script/rest/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.

Expand All @@ -107,3 +136,10 @@ Poke around several pages, ensure that the stylesheets are working properly, ima
- [ ] When the PR is approved, [deploy the `github/github` PR](https://thehub.github.com/epd/engineering/devops/deployment/deploying-dotcom/). If you haven't deployed a `github/github` PR before, work with someone that has -- the process isn't too involved depending on how you deploy, but there are a lot of details that can potentially be confusing as you can see from the documentation.

**Note**: you can do this step independently of the other steps after a GHES version is deprecated since it should no longer get updates in github/github. You should plan to get this PR merged as soon as possible, otherwise if you wait too long our OpenAPI automation may re-add the static files that you removed in step 5.

## Step 5: Continue to deprecate the version in docs-internal

- [ ] Open a new PR. Make sure to check the following:
- [ ] Tests are passing (you may need to include the changes in step 6 to get tests to pass).
- [ ] The deprecated version renders in preview as expected. You should be able to navigate to `docs.github.com/enterprise/<DEPRECATED VERSION>` to access the docs. You should also be able to navigate to a page that is available in the deprecated version and change the version in the URL to the deprecated version, to test redirects.
- [ ] The new oldest supported version renders on staging as expected. You should see a banner on the top of every page for the oldest supported version that notes when the version will be deprecated.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GitHub Docs <!-- omit in toc -->

This repository contains the documentation website code and Markdown source files for [docs.github.com](https://docs.github.com).

GitHub's Docs team works on pre-production content in a private repo that regularly syncs with this public repo.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions components/context/ProductLandingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export type ProductLandingContextT = {
beta_product: boolean
product: Product
introLinks: Record<string, string> | null
product_video?: string
productVideo: string
featuredLinks: Record<string, Array<FeaturedLink>>
productCodeExamples: Array<CodeExample>
productUserExamples: Array<{ username: string; description: string }>
Expand Down Expand Up @@ -93,19 +93,20 @@ export const getFeaturedLinksFromReq = (req: any): Record<string, Array<Featured
)
}

export const getProductLandingContextFromRequest = (req: any): ProductLandingContextT => {
export const getProductLandingContextFromRequest = async (
req: any
): Promise<ProductLandingContextT> => {
const productTree = req.context.currentProductTree
const page = req.context.page
const hasGuidesPage = (page.children || []).includes('/guides')

const productVideo = page.product_video
? await page.renderProp('product_video', req.context, { textOnly: true })
: ''

return {
...pick(page, [
'title',
'shortTitle',
'introPlainText',
'beta_product',
'intro',
'product_video',
]),
...pick(page, ['title', 'shortTitle', 'introPlainText', 'beta_product', 'intro']),
productVideo,
hasGuidesPage,
product: {
href: productTree.href,
Expand Down
8 changes: 4 additions & 4 deletions components/landing/LandingHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useVersion } from 'components/hooks/useVersion'
import { Lead } from 'components/ui/Lead'

export const LandingHero = () => {
const { product_video, shortTitle, title, beta_product, intro, introLinks } =
const { productVideo, shortTitle, title, beta_product, intro, introLinks } =
useProductLandingContext()
const { t } = useTranslation('product_landing')
const [renderIFrame, setRenderIFrame] = useState(false)
Expand All @@ -22,7 +22,7 @@ export const LandingHero = () => {

return (
<header className="d-lg-flex gutter-lg mb-6">
<div className={cx('col-12 mb-3 mb-lg-0', product_video && 'col-lg-6')}>
<div className={cx('col-12 mb-3 mb-lg-0', productVideo && 'col-lg-6')}>
<h1>
{shortTitle || title}{' '}
{beta_product && <span className="Label Label--success v-align-middle">Beta</span>}
Expand Down Expand Up @@ -51,13 +51,13 @@ export const LandingHero = () => {
})}
</div>

{product_video && (
{productVideo && (
<div className="col-12 col-lg-6">
<div className="position-relative" style={{ paddingBottom: '56.25%' }}>
<iframe
title={`${shortTitle} Video`}
className="top-0 left-0 position-absolute color-shadow-large rounded-1 width-full height-full"
src={renderIFrame ? product_video : ''}
src={renderIFrame ? productVideo : ''}
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ For example, to see notifications from the octo-org organization, use `org:octo-

## {% data variables.product.prodname_dependabot %} custom filters

{% ifversion fpt or ghec or ghes > 3.2 %}
{% ifversion fpt or ghec or ghes %}
If you use {% data variables.product.prodname_dependabot %} to keep your dependencies up-to-date, you can use and save these custom filters:
- `is:repository_vulnerability_alert` to show notifications for {% data variables.product.prodname_dependabot_alerts %}.
- `reason:security_alert` to show notifications for {% data variables.product.prodname_dependabot_alerts %} and security update pull requests.
Expand All @@ -170,7 +170,7 @@ If you use {% data variables.product.prodname_dependabot %} to keep your depende
For more information about {% data variables.product.prodname_dependabot %}, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)."
{% endif %}

{% ifversion ghes < 3.3 or ghae %}
{% ifversion ghae %}

If you use {% data variables.product.prodname_dependabot %} to tell you about insecure dependencies, you can use and save these custom filters to show notifications for {% data variables.product.prodname_dependabot_alerts %}:
- `is:repository_vulnerability_alert`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Organizations that use {% data variables.product.prodname_ghe_cloud %} can confi
To confirm your organization's identity and display a "Verified" badge on your organization profile page, you can verify your organization's domains with {% data variables.product.prodname_dotcom %}. For more information, see "[Verifying or approving a domain for your organization](/organizations/managing-organization-settings/verifying-or-approving-a-domain-for-your-organization)."
{% endif %}

{% ifversion fpt or ghes > 3.2 or ghec %}
{% ifversion fpt or ghes or ghec %}
![Sample organization profile page](/assets/images/help/organizations/org_profile_with_overview.png)
{% else %}
![Sample organization profile page](/assets/images/help/profile/org_profile.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ The email address in the `From:` field is the address that was set in the [local

If the email address used for the commit is not connected to your account on {% data variables.location.product_location %}, {% ifversion ghae %}change the email address used to author commits in Git. For more information, see "[Setting your commit email address](/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address#setting-your-commit-email-address-in-git)."{% else %}you must [add the email address](/articles/adding-an-email-address-to-your-github-account) to your account on {% data variables.location.product_location %}. Your contributions graph will be rebuilt automatically when you add the new address.{% endif %}

{% warning %}
{% ifversion fpt or ghec %}
{% note %}

**Warning**: Generic email addresses, such as `jane@computer.local`, cannot be added to {% data variables.product.prodname_dotcom %} accounts. If you use such an email for your commits, the commits will not be linked to your {% data variables.product.prodname_dotcom %} profile and will not show up in your contribution graph.
**Note**: If you use a {% data variables.enterprise.prodname_managed_user %}, you cannot add additional email addresses to the account, even if multiple email addresses are registered with your identity provider (IdP). Therefore, only commits that are authored by the primary email address registered with your IdP can be associated with your {% data variables.enterprise.prodname_managed_user %}.

{% endwarning %}
{% endnote %}
{% endif %}

Generic email addresses, such as `jane@computer.local`, cannot be added to {% data variables.product.prodname_dotcom %} accounts and linked to commits. If you've authored any commits using a generic email address, the commits will not be linked to your {% data variables.product.prodname_dotcom %} profile and will not show up in your contribution graph.

### Commit was not made in the default or `gh-pages` branch

Expand Down
Loading