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 #11609

Merged
merged 15 commits into from
Nov 2, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/staging-deploy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,17 @@ jobs:
name: pr_build
path: ${{ runner.temp }}

- name: Extract user-changes to temp directory
# For security reasons, only extract the tar from docs-internal
# This allows us to add search indexes and early access content to the build
- if: ${{ github.repository == 'github/docs-internal' }}
name: Extract user-changes to temp directory
run: |
mkdir $RUNNER_TEMP/app
tar -x --file=$RUNNER_TEMP/app.tar -C "$RUNNER_TEMP/app/"

# Move the LFS content into the temp directory in chunks (destructively)
- name: Move the LFS objects
- if: ${{ github.repository == 'github/docs-internal' }}
name: Move the LFS objects
run: |
git lfs ls-files --name-only | xargs -n 1 -I {} sh -c 'mkdir -p "$RUNNER_TEMP/app/$(dirname {})"; mv {} "$RUNNER_TEMP/app/$(dirname {})/"'

Expand All @@ -341,9 +345,15 @@ jobs:
mv content/early-access "$RUNNER_TEMP/app/content/"
mv data/early-access "$RUNNER_TEMP/app/data/"

- name: Create a gzipped archive
- if: ${{ github.repository == 'github/docs-internal' }}
name: Create a gzipped archive (docs-internal)
run: tar -cz --file app.tar.gz "$RUNNER_TEMP/app/"

# gzip the app.tar from github/docs so we're working with the same format
- if: ${{ github.repository == 'github/docs' }}
name: Create a gzipped archive (docs)
run: gzip -9 < "$RUNNER_TEMP/app.tar" > app.tar.gz

- name: Create a Heroku build source
id: build-source
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/transfer-to-localization-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Copy to REST API issue to docs-content

# **What it does**: Copies an issue in the open source repo to the docs-content repo, comments on and closes the original issue
# **Why we have it**: REST API updates cannot be made in the open source repo. Instead, we copy the issue to an internal issue (we do not transfer so that the issue does not disappear for the contributor) and close the original issue.
# **Who does it impact**: Open source and docs-content maintainers

permissions:
contents: write

on:
issues:
types:
- labeled

jobs:
transfer-issue:
name: Transfer issue
runs-on: ubuntu-latest
if: (github.event.label.name == 'localization ' && github.repository == 'github/docs')
steps:
- name: Check if this run was triggered by a member of the docs team
uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d
id: triggered-by-member
with:
github-token: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
result-encoding: string
script: |
const triggerer_login = context.payload.sender.login
const teamMembers = await github.request(
`/orgs/github/teams/docs/members?per_page=100`
)
const logins = teamMembers.data.map(member => member.login)
if (logins.includes(triggerer_login)) {
console.log(`This workflow was triggered by ${triggerer_login} (on the docs team).`)
return 'true'
}
console.log(`This workflow was triggered by ${triggerer_login} (not on the docs team), so no action will be taken.`)
return 'false'

- name: Exit if not triggered by a docs team member
if: steps.triggered-by-member.outputs.result == 'false'
run: |
echo Aborting. This workflow must be triggered by a member of the docs team.
exit 1

- name: Create an issue in the localization repo
run: |
new_issue_url="$(gh issue create --title "$ISSUE_TITLE" --body "$ISSUE_BODY" --repo github/localization)"
echo 'NEW_ISSUE='$new_issue_url >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}

- name: Comment on the new issue
run: gh issue comment $NEW_ISSUE --body "This issue was originally opened in the open source repo as $OLD_ISSUE"
env:
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
NEW_ISSUE: ${{ env.NEW_ISSUE }}
OLD_ISSUE: ${{ github.event.issue.html_url }}

- name: Comment on the old issue
run: gh issue comment $OLD_ISSUE --body "Thank you for opening this issue! Updates to translated content must be made internally. I have copied your issue to an internal issue, so I will close this issue."
env:
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
OLD_ISSUE: ${{ github.event.issue.html_url }}

- name: Close the old issue
run: gh issue close $OLD_ISSUE
env:
GITHUB_TOKEN: ${{secrets.DOCUBOT_READORG_REPO_WORKFLOW_SCOPES}}
OLD_ISSUE: ${{ github.event.issue.html_url }}
1 change: 1 addition & 0 deletions Dockerfile.openapi_decorator
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ COPY --chown=node:node package-lock.json /openapi-check
ADD --chown=node:node script /openapi-check/script
ADD --chown=node:node lib /openapi-check/lib
ADD --chown=node:node content /openapi-check/content
ADD --chown=node:node data /openapi-check/data

RUN npm ci -D

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.
4 changes: 4 additions & 0 deletions components/page-header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.breadcrumbs {
clip-path: inset(-5px -5px -5px 0px);
}

.header {
display: unset;
}
15 changes: 10 additions & 5 deletions components/page-header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ export const Header = () => {

return (
<div
className={`border-bottom color-border-muted no-print position-sticky top-0 z-3 ${
scroll ? 'color-shadow-medium' : 'color-shadow-small'
} color-bg-default`}
className={cx(
'border-bottom d-unset color-border-muted no-print z-3 color-bg-default',
styles.header
)}
>
{error !== '404' && <HeaderNotifications />}

<header className={cx('container-xl px-3 px-md-6 pt-3 pb-3 z-3')}>
<header
className={cx(
'color-bg-default px-3 px-md-6 pt-3 pb-3 position-sticky top-0 z-3',
scroll ? 'color-shadow-medium' : 'color-shadow-small'
)}
>
{/* desktop header */}
<div
className="d-none d-lg-flex flex-justify-end flex-items-center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,15 @@ on:

{% data reusables.webhooks.workflow_run_desc %}

{% data reusables.github-actions.branch-requirement %}
{% note %}

**Notes:**

* This event will only trigger a workflow run if the workflow file is on the default branch.

* You can't use `workflow_run` to chain together more than three levels of workflows. For example, if you attempt to trigger five workflows (named `B` to `F`) to run sequentially after an initial workflow `A` has run (that is: `A` → `B` → `C` → `D` → `E` → `F`), workflows `E` and `F` will not be run.

{% endnote %}

| Webhook event payload | Activity types | `GITHUB_SHA` | `GITHUB_REF` |
| --------------------- | -------------- | ------------ | -------------|
Expand Down
2 changes: 2 additions & 0 deletions content/admin/packages/enabling-github-packages-with-minio.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ shortTitle: Enable Packages with MinIO
- Make sure to configure the bucket you'll want to use in the future. We do not recommend changing your storage after you start using {% data variables.product.prodname_registry %}.

{% endwarning %}

## Prerequisites

Before you can enable and configure {% data variables.product.prodname_registry %} on {% data variables.product.product_location_enterprise %}, you need to prepare your MinIO storage bucket. To help you quickly set up a MinIO bucket and navigate MinIO's customization options, see the "[Quickstart for configuring your MinIO storage bucket for {% data variables.product.prodname_registry %}](/admin/packages/quickstart-for-configuring-your-minio-storage-bucket-for-github-packages)."

Ensure your MinIO external storage access key ID and secret have these permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ redirect_from:
- /enterprise/admin/articles/determining-whether-a-user-account-is-dormant/
- /enterprise/admin/user-management/managing-dormant-users
- /admin/user-management/managing-dormant-users
intro: 'A user account is considered to be dormant if it has not been active for at least a month.{% ifversion ghes %} You may choose to suspend dormant users to free up user licenses.{% endif %}'
intro: '{% data reusables.enterprise-accounts.dormant-user-activity-threshold %}'
versions:
ghec: '*'
ghes: '*'
ghae: '*'
type: how_to
Expand All @@ -16,16 +17,12 @@ topics:
- Enterprise
- Licensing
---
"Activity" includes, but is not limited to:
- Signing in to {% data variables.product.product_name %}.
- Commenting on issues and pull requests.
- Creating, deleting, watching, and starring repositories.
- Pushing commits.{% ifversion ghes or ghae %}
- Accessing resources by using a personal access token or SSH key.{% endif %}
{% data reusables.enterprise-accounts.dormant-user-activity %}

{% ifversion ghes or ghae%}
## Viewing dormant users

You can view a list of all dormant users who have not been suspended and who are not site administrators.
{% data reusables.enterprise-accounts.viewing-dormant-users %}

{% data reusables.enterprise_site_admin_settings.access-settings %}
3. In the left sidebar, click **Dormant users**.
Expand All @@ -47,11 +44,29 @@ You can view a list of all dormant users who have not been suspended and who are
{% data reusables.enterprise_site_admin_settings.dormancy-threshold %}

{% data reusables.enterprise-accounts.access-enterprise %}
{% ifversion ghes or ghae %}
{% data reusables.enterprise-accounts.policies-tab %}
{% else %}
{% data reusables.enterprise-accounts.settings-tab %}
{% endif %}
{% data reusables.enterprise-accounts.options-tab %}
4. Under "Dormancy threshold", use the drop-down menu, and click the desired dormancy threshold.
![The Dormancy threshold drop-down menu](/assets/images/enterprise/site-admin-settings/dormancy-threshold-menu.png)

{% endif %}

{% ifversion ghec %}

{% data reusables.enterprise-accounts.dormant-user-release-phase %}

{% warning %}

**Note:** During the private beta, ongoing improvements to the report download feature may limit its availability.

{% endwarning %}

## Downloading the dormant users report from your enterprise account

{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.enterprise-accounts-compliance-tab %}
1. To download your Dormant Users (beta) report as a CSV file, under "Other", click {% octicon "download" aria-label="The Download icon" %} **Download**.
![Download button under "Other" on the Compliance page](/assets/images/help/business-accounts/dormant-users-download-button.png)

{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ You can view {% ifversion ghec %}all the {% data variables.product.prodname_ghe_
{% ifversion ghec %}1. Optionally, to view a list of pending invitations, click **_NUMBER_ pending**.
!["NUMBER pending" button to the right of search and filter options](/assets/images/help/enterprises/members-pending.png){% endif %}

## Viewing dormant users

You can view a list of all dormant users {% ifversion ghes or ghae %} who have not been suspended and {% endif %}who are not site administrators. {% data reusables.enterprise-accounts.dormant-user-activity-threshold %} For more information, see "[Managing dormant users](/admin/user-management/managing-users-in-your-enterprise/managing-dormant-users)."

## Further reading

- "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise)"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A user account is considered to be dormant if it has not been active for {% ifversion ghec %}90 days{% else %}at least a month{% endif %}.{% ifversion ghes %} You may choose to suspend dormant users to release user licenses.{% endif %}
6 changes: 6 additions & 0 deletions data/reusables/enterprise-accounts/dormant-user-activity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"Activity" includes, but is not limited to:
- Signing in to {% data variables.product.product_name %}.
- Commenting on issues and pull requests.
- Creating, deleting, watching, and starring repositories.
- Pushing commits.
- Accessing resources by using a personal access token or SSH key.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% note %}

**Note:** The Dormant Users report is currently in private beta so admins only have access to this feature with a special invite. To join the private beta, receive support, or address your questions, contact the {% data variables.product.company_short %} representative who helps manage your account.

{% endnote %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1. In the enterprise account sidebar, click {% octicon "checklist" aria-label="The Compliance icon" %} **Compliance**.
![Compliance tab in the enterprise account sidebar](/assets/images/help/business-accounts/enterprise-accounts-compliance-tab.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can view a list of all dormant users who have not been suspended and who are not site administrators.
49 changes: 14 additions & 35 deletions lib/hydro.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,10 @@ import fetch from 'node-fetch'
import statsd from '../lib/statsd.js'
import FailBot from '../lib/failbot.js'

const SCHEMAS = {
page: 'docs.v0.PageEvent',
exit: 'docs.v0.ExitEvent',
link: 'docs.v0.LinkEvent',
search: 'docs.v0.SearchEvent',
searchResult: 'docs.v0.SearchResultEvent',
navigate: 'docs.v0.NavigateEvent',
survey: 'docs.v0.SurveyEvent',
experiment: 'docs.v0.ExperimentEvent',
redirect: 'docs.v0.RedirectEvent',
clipboard: 'docs.v0.ClipboardEvent',
print: 'docs.v0.PrintEvent',
preference: 'docs.v0.PreferenceEvent',
}

export default class Hydro {
constructor({ secret, endpoint } = {}) {
this.secret = secret || process.env.HYDRO_SECRET
this.endpoint = endpoint || process.env.HYDRO_ENDPOINT
this.schemas = SCHEMAS
}

/**
Expand All @@ -47,20 +31,14 @@ export default class Hydro {
* @param {any} value
*/
async publish(schema, value) {
return this.publishMany([{ schema, value }])
}

/**
* Publish multiple events to Hydro
* @param {[{ schema: string, value: any }]} events
*/
async publishMany(events) {
const body = JSON.stringify({
events: events.map(({ schema, value }) => ({
schema,
value: JSON.stringify(value), // We must double-encode the value property
cluster: 'potomac', // We only have ability to publish externally to potomac cluster
})),
events: [
{
schema,
value: JSON.stringify(value), // We must double-encode the value property
cluster: 'potomac', // We only have ability to publish externally to potomac cluster
},
],
})
const token = this.generatePayloadHmac(body)

Expand All @@ -81,23 +59,24 @@ export default class Hydro {
statsd.increment(`hydro.response_code.${res.status}`, 1, statTags)
statsd.increment('hydro.response_code.all', 1, statTags)

// Track hydro exceptions in Sentry, but don't track 503s because we can't do anything about service availability
if (!res.ok && res.status !== 503) {
// Track hydro exceptions in Sentry,
// but don't track 5xx because we can't do anything about service availability
if (!res.ok && res.status < 500) {
const err = new Error(`Hydro request failed: ${res.statusText}`)
err.status = res.status

const failures = await res.text()

FailBot.report(err, {
hydroStatus: res.status,
hydroText: res.statusText,
hydroFailures: failures,
})

// If the Hydro request failed as an "Unprocessable Entity", log it for diagnostics
if (res.status === 422) {
const failures = await res.json()
console.error(
`Hydro schema validation failed:\n - Request: ${body}\n - Failures: ${JSON.stringify(
failures
)}`
`Hydro schema validation failed:\n - Request: ${body}\n - Failures: ${failures}`
)
}

Expand Down
13 changes: 12 additions & 1 deletion lib/redirects/static/redirect-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,15 @@
- /billing/managing-billing-for-your-github-account/managing-invoices-for-your-enterprise

/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization
- /organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization
- /organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization

# The initializing-github-ae.md article is referenced in these code files:
# - lib/github/private_instance_bootstrapper/internal_support_contact.rb
# - lib/github/private_instance_bootstrapper/saml_idp_configuration.rb
# - lib/github/private_instance_bootstrapper/policies_configuration.rb
# This redirect ensures that the links don't resolve to the non-GHAE version
# of the docs as this article only exists in the GHAE docs.

/github-ae@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae
- /admin/configuration/configuring-your-enterprise/initializing-github-ae
- /enterprise-server@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae
Loading