Skip to content

Commit

Permalink
Merge branch 'main' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyaparimi authored May 12, 2022
2 parents 9674474 + 14d2191 commit 7b16228
Show file tree
Hide file tree
Showing 2,063 changed files with 1,116,658 additions and 6,910 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
babelOptions: { configFile: './.babelrc' },
sourceType: 'module',
},
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*'],
ignorePatterns: ['tmp/*', '!/.*', '/.next/', 'script/bookmarklets/*', 'lib/sigsci.js'],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
},
Expand Down
74 changes: 47 additions & 27 deletions .github/actions-scripts/content-changes-table-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { getContents } from '../../script/helpers/git-utils.js'
import parse from '../../lib/read-frontmatter.js'
import getApplicableVersions from '../../lib/get-applicable-versions.js'
import nonEnterpriseDefaultVersion from '../../lib/non-enterprise-default-version.js'
import { allVersionShortnames } from '../../lib/all-versions.js'

const { GITHUB_TOKEN, APP_URL } = process.env
const context = github.context
Expand All @@ -22,6 +23,7 @@ if (!APP_URL) {
const PROD_URL = 'https://docs.github.com'
const octokit = github.getOctokit(GITHUB_TOKEN)

// get the list of file changes from the PR
const response = await octokit.rest.repos.compareCommitsWithBasehead({
owner: context.repo.owner,
repo: context.payload.repository.name,
Expand Down Expand Up @@ -61,36 +63,54 @@ for (const file of articleFiles) {
if (file.status === 'added') contentCell = `New file: `
contentCell += `[\`${fileName}\`](${sourceUrl})`

for (const version in data.versions) {
const currentApplicableVersions = getApplicableVersions({
[version]: data.versions[version],
})

if (currentApplicableVersions.length === 1) {
// for fpt, ghec, and ghae
if (currentApplicableVersions.toString() === nonEnterpriseDefaultVersion) {
// omit version from fpt url
previewCell += `[${version}](${APP_URL}/${fileUrl})<br>`
prodCell += `[${version}](${PROD_URL}/${fileUrl})<br>`
} else {
// for non-versioned releases (ghae, ghec) use full url
previewCell += `[${version}](${APP_URL}/${currentApplicableVersions}/${fileUrl})<br>`
prodCell += `[${version}](${PROD_URL}/${currentApplicableVersions}/${fileUrl})<br>`
try {
// the try/catch is needed because getApplicableVersions() returns either [] or throws an error when it can't parse the versions frontmatter
// try/catch can be removed if docs-engineering#1821 is resolved
// i.e. for feature based versioning, like ghae: 'issue-6337'
const fileVersions = getApplicableVersions(data.versions)

for (const plan in allVersionShortnames) {
// plan is the shortName (i.e., fpt)
// allVersionShortNames[plan] is the planName (i.e., free-pro-team)

// walk by the plan names since we generate links differently for most plans
const versions = fileVersions.filter((fileVersion) =>
fileVersion.includes(allVersionShortnames[plan])
)

if (versions.length === 1) {
// for fpt, ghec, and ghae

if (versions.toString() === nonEnterpriseDefaultVersion) {
// omit version from fpt url

previewCell += `[${plan}](${APP_URL}/${fileUrl})<br>`
prodCell += `[${plan}](${PROD_URL}/${fileUrl})<br>`
} else {
// for non-versioned releases (ghae, ghec) use full url

previewCell += `[${plan}](${APP_URL}/${versions}/${fileUrl})<br>`
prodCell += `[${plan}](${PROD_URL}/${versions}/${fileUrl})<br>`
}
} else if (versions.length) {
// for ghes releases, link each version

previewCell += `${plan}@ `
prodCell += `${plan}@ `

versions.forEach((version) => {
previewCell += `[${version.split('@')[1]}](${APP_URL}/${version}/${fileUrl}) `
prodCell += `[${version.split('@')[1]}](${PROD_URL}/${version}/${fileUrl}) `
})
previewCell += '<br>'
prodCell += '<br>'
}
} else {
// for ghes releases, link each version
previewCell += `${version}@ `
prodCell += `${version}@ `

currentApplicableVersions.forEach((ghesVersion) => {
previewCell += `[${ghesVersion.split('@')[1]}](${APP_URL}/${ghesVersion}/${fileUrl}) `
prodCell += `[${ghesVersion.split('@')[1]}](${PROD_URL}/${ghesVersion}/${fileUrl}) `
})
previewCell += '<br>'
prodCell += '<br>'
}
} catch (e) {
console.error(
`Version information for ${file.filename} couldn't be determined from its frontmatter.`
)
}
markdownTable += `| ${contentCell} | ${previewCell} | ${prodCell} | |\n`
}

setOutput('changesTable', markdownTable)
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ This file should be automatically updated, but you can also run `script/update-e
### 🚢 🛳️ 🚢 Shipping the release branch
- [ ] Remove `[DO NOT MERGE]` and other meta information from the PR title 😜.
- [ ] The `github/docs-internal` repo is frozen, and the `Repo Freeze Check / Prevent merging during deployment freezes (pull_request_target)` test is expected to fail.
Use admin permissions to ship the release branch with this failure. Make sure that the merge's commit title does not include anything like `[DO NOT MERGE]`, and remove all the branch's commit details from the merge's commit message except for the co-author list.
- [ ] Do any required smoke tests listed in the opening post in the megabranch PR. You can monitor and check when the production deploy completed by viewing the [`docs-internal` deployments page](https://github.com/github/docs-internal/deployments).
- [ ] Once smoke tests have passed, you can [unfreeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) and post an announcement in Slack.
- [ ] After unfreezing, the megabranch creator should push the search index LFS objects for the public `github/docs` repo. The LFS objects were already pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects to the public repo:
- [ ] The megabranch creator should push the search index LFS objects for the public `github/docs` repo. The LFS objects were already pushed for the internal repo after the `sync-english-index-for-<PLAN@RELEASE>` was added to the megabranch. To push the LFS objects to the public repo:
1. First navigate to the [sync search indices workflow](https://github.com/github/docs-internal/actions/workflows/sync-search-indices.yml).
2. Then, to run the workflow with parameters, click on `Run workflow` button.
3. A modal will pop up where you will set the following inputs:
- Branch: The new version megabranch you're working on
- Branch: The new `ghes-<RELEASE>-megabranch` version megabranch you're working on
- Version: `enterprise-server@<RELEASE>`
- Language: `en`
4. Run the job. The workflow job may fail on the first run—so retry the failed job if needed.
- [ ] Remove `[DO NOT MERGE]` and other meta information from the PR title 😜.
- [ ] The `github/docs-internal` repo is frozen, and the `Repo Freeze Check / Prevent merging during deployment freezes (pull_request_target)` test is expected to fail.
Use admin permissions to ship the release branch with this failure. Make sure that the merge's commit title does not include anything like `[DO NOT MERGE]`, and remove all the branch's commit details from the merge's commit message except for the co-author list.
- [ ] Do any required smoke tests listed in the opening post in the megabranch PR. You can monitor and check when the production deploy completed by viewing the [`docs-internal` deployments page](https://github.com/github/docs-internal/deployments).
- [ ] Once smoke tests have passed, you can [unfreeze the repos](https://github.com/github/docs-content/blob/main/docs-content-docs/docs-content-workflows/freezing.md) and post an announcement in Slack.
- [ ] After unfreezing, alert the Ecosystem-API team in #ecosystem-api the docs freeze is finished/thawed and the release has shipped.
- [ ] You (or they) can now remove your blocking review on the auto-generated "Update OpenAPI Descriptions" PR in public REST API description (the `rest-api-descriptions` repo). (although it's likely newer PRs have been created since yours with the blocking review, in which case the Ecosystem-API team will close your PR and perform the next step on the most recent PR).
- [ ] The Ecosystem-API team will merge the latest auto-generated "Update OpenAPI Descriptions" PR (which will contain the OpenAPI schema config that changed `published` to `true` for the release).
Expand Down
2 changes: 1 addition & 1 deletion .github/review-template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Author self-review

- [ ] The changes in this PR meet the user experience and goals outlined in the content design plan.
- [ ] I've compared my PR's source changes to staging and reviewed for versioning issues, redirects, the [style guide](https://github.com/github/docs/blob/main/contributing/content-style-guide.md), [content model](https://github.com/github/docs-content-strategy/blob/main/content-design/models.md), or [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md) rendering problems, typos, and wonky screenshots.
- [ ] I've compared my PR's source changes to staging and reviewed for versioning issues, redirects, the [style guide](https://github.com/github/docs/blob/main/contributing/content-style-guide.md), [content model](https://github.com/github/docs/blob/main/contributing/content-model.md), or [localization checklist](https://github.com/github/docs/blob/main/contributing/localization-checklist.md) rendering problems, typos, and wonky screenshots.
- [ ] I've worked through build failures and tests are passing.
- [ ] For REST API content, I've verified that endpoints, parameters, and responses are correct and work as expected and provided curl samples below.

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/azure-preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ jobs:
cache-from: type=registry,ref=${{ secrets.NONPROD_REGISTRY_SERVER }}/${{ github.repository }}:main-preview
# `main-docker-cache.yml` handles updating the remote cache so we don't pollute it with PR specific code
cache-to: ''
build-args: |
BUILD_SHA=${{ github.sha }}
# Succeed despite any non-zero exit code (e.g. if there is no deployment to cancel)
- name: 'Cancel any existing deployments for this PR'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/azure-prod-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
tags: ${{ env.DOCKER_IMAGE }}, ${{ env.DOCKER_IMAGE_CACHE_REF }}
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_CACHE_REF }}
cache-to: type=registry,mode=max,ref=${{ env.DOCKER_IMAGE_CACHE_REF }}
build-args: |
BUILD_SHA=${{ github.sha }}
- name: 'Update docker-compose.prod.yaml template file'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/needs-sme-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
add-issue-comment:
if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'issues' || github.event_name == 'pull_request_target') }}
if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'issues') }}
runs-on: ubuntu-latest
steps:
- uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
Expand All @@ -26,7 +26,7 @@ jobs:
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:
add-pr-comment:
if: ${{ github.repository == 'github/docs' && github.event.label.name == 'needs SME' }}
if: ${{ github.repository == 'github/docs' && (github.event.label.name == 'needs SME' && github.event_name == 'pull_request_target') }}
runs-on: ubuntu-latest
steps:
- uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ ENV PORT 4000

ENV ENABLED_LANGUAGES "en"

# This makes it possible to set `--build-arg BUILD_SHA=abc123`
# and it then becomes available as an environment variable in the docker run.
ARG BUILD_SHA
ENV BUILD_SHA=$BUILD_SHA

# Copy only what's needed to run the server
COPY --chown=node:node package.json ./
COPY --chown=node:node assets ./assets
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.
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.
Binary file modified assets/images/help/codespaces/prebuilds-delete.png
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.
Binary file modified assets/images/help/codespaces/prebuilds-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/codespaces/prebuilds-manually-trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/codespaces/prebuilds-view-runs.png
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.
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.
Binary file modified assets/images/help/repository/pr-merge-squash.png
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.
Binary file modified assets/images/help/repository/restrict-branch-search.png
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.
Diff not rendered.
Binary file modified assets/images/help/sponsors/tax-form-link.png
2 changes: 1 addition & 1 deletion components/rest/RestCodeSamples.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
padding: 8px 8px 16px;
white-space: pre;
@include breakpoint(lg) {
max-width: 30vw;
max-width: 40vw;
}
}
}
Expand Down
16 changes: 12 additions & 4 deletions components/rest/RestCodeSamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const responseSelectOptions = [
{ key: 'schema', text: 'Response schema' },
]

function getLanguageHighlight(selectedLanguage: string) {
return selectedLanguage === JSKEY ? 'javascript' : 'curl'
}

export function RestCodeSamples({ operation, slug }: Props) {
const { t } = useTranslation('products')

Expand Down Expand Up @@ -144,7 +148,7 @@ export function RestCodeSamples({ operation, slug }: Props) {
const reqElem = responseCodeExample.current
const scrollElem = scrollRef.current

// Reset scroll position to the top when switching bteween example response and
// Reset scroll position to the top when switching between example response and
// response schema
if (scrollElem) {
scrollElem.scrollTop = 0
Expand Down Expand Up @@ -255,8 +259,12 @@ export function RestCodeSamples({ operation, slug }: Props) {

{/* Example requests */}
<div
className={cx(styles.codeBlock, styles.requestCodeBlock, 'border-top rounded-0 my-0')}
data-highlight={selectedLanguage === JSKEY ? 'javascript' : 'curl'}
className={cx(
styles.codeBlock,
styles.requestCodeBlock,
`border-top rounded-1 my-0 ${getLanguageHighlight(selectedLanguage)}`
)}
data-highlight={getLanguageHighlight(selectedLanguage)}
>
<code ref={requestCodeExample}>{displayedExample[selectedLanguage]}</code>
</div>
Expand Down Expand Up @@ -306,7 +314,7 @@ export function RestCodeSamples({ operation, slug }: Props) {
className={cx(
styles.codeBlock,
styles.responseCodeBlock,
'border-top rounded-0 my-0'
'border-top rounded-1 my-0'
)}
data-highlight={'json'}
style={{ maxHeight: responseMaxHeight }}
Expand Down
16 changes: 7 additions & 9 deletions components/sidebar/RestCollapsibleSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export const RestCollapsibleSection = (props: SectionProps) => {
)}
>
<div className="d-flex flex-justify-between">
<div className="pl-4 pr-1 py-2 f5 d-block flex-auto mr-3 color-fg-default no-underline text-bold">
<div
data-testid="rest-category"
className="pl-4 pr-1 py-2 f5 d-block flex-auto mr-3 color-fg-default no-underline text-bold"
>
{title}
</div>
<span style={{ marginTop: 7 }} className="flex-shrink-0 pr-3">
Expand All @@ -164,7 +167,7 @@ export const RestCollapsibleSection = (props: SectionProps) => {
{/* <!-- Render the maptopic level subcategory operation links e.g. --> */}
<ul className="list-style-none position-relative">
{page.childPages.length <= 0 ? (
<div data-testid="sidebar-article-group" className="pb-0">
<div className="pb-0">
{miniTocItems.length > 0 && (
<ActionList
{...{ as: 'ul' }}
Expand All @@ -191,12 +194,7 @@ export const RestCollapsibleSection = (props: SectionProps) => {
className="details-reset"
>
<summary>
<div
data-testid="sidebar-rest-subcategory"
className={cx('pl-4 pr-5 py-2 no-underline')}
>
{childTitle}
</div>
<div className={cx('pl-4 pr-5 py-2 no-underline')}>{childTitle}</div>
</summary>
<div className="pb-0">
{miniTocItems.length > 0 && (
Expand All @@ -215,7 +213,7 @@ export const RestCollapsibleSection = (props: SectionProps) => {
// We're not on the current page so don't have any minitoc
// data so just render a link to the category page.
return (
<li key={childTitle} data-testid="sidebar-article-group" className="pb-0">
<li data-testid="rest-subcategory" key={childTitle} className="pb-0">
<Link
href={childPage.href}
className={cx(
Expand Down
3 changes: 1 addition & 2 deletions components/sidebar/SidebarProduct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const SidebarProduct = () => {
)
return (
<>
<li className="my-3" data-testid="rest-sidebar-items">
<li className="my-3">
<ul className="list-style-none">
{conceptualPages.map((childPage, i) => {
const isStandaloneCategory = childPage.page.documentType === 'article'
Expand Down Expand Up @@ -135,7 +135,6 @@ export const SidebarProduct = () => {
const defaultOpen = hasExactCategory ? isActive : false
return (
<li
data-testid="rest-sidebar-items"
key={childPage.href + i}
data-is-active-category={isActive}
data-is-current-page={isActive && isStandaloneCategory}
Expand Down
1 change: 1 addition & 0 deletions components/ui/MarkdownContent/stylesheets/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[class~="highlight"] pre,
pre {
margin-top: 0.5rem;
border: 1px var(--color-border-default) solid;
}

[class~="height-constrained-code-block"] pre {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ You can also view whether an enterprise owner has a specific role in the organiz
| Enterprise owner | Organization owner | Able to configure organization settings and manage access to the organization's resources through teams, etc. |
| Enterprise owner | Organization member | Able to access organization resources and content, such as repositories, without access to the organization's settings. |

To review all roles in an organization, see "[Roles in an organization](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization)." {% ifversion ghec %} An organization member can also have a custom role for a specific repository. For more information, see "[Managing custom repository roles for an organization](/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization)."{% endif %}
To review all roles in an organization, see "[Roles in an organization](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization)." {% if custom-repository-roles %} An organization member can also have a custom role for a specific repository. For more information, see "[Managing custom repository roles for an organization](/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization)."{% endif %}

For more information about the enterprise owner role, see "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owner)."

Expand Down
Loading

0 comments on commit 7b16228

Please sign in to comment.