Skip to content

repo sync #19219

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

Merged
merged 44 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c089e61
support a "hierarchy of fallbacks" for versioned redirects
sarahs Apr 27, 2022
e1f0f80
remove old stuff
sarahs Apr 27, 2022
1c02d01
move the redirect exceptions into test fixtures and tests
sarahs Apr 27, 2022
a21eecd
add comment describing what the permalinks array of objects looks lik…
sarahs Apr 27, 2022
e101c95
run generateRedirectsForPermalinks whether the content file has redir…
sarahs Apr 27, 2022
2636bcc
add redirects to content files that were previously only in redirect …
sarahs Apr 27, 2022
f7270ea
remove some cases where /enterprise/ links redirect to GHES (instead …
sarahs Apr 27, 2022
f62f07e
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Apr 28, 2022
3883fdc
incorporate late changes to lib/redirects/static/redirect-exceptions.txt
sarahs Apr 28, 2022
b2db816
update test
sarahs Apr 28, 2022
c649d15
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs May 3, 2022
a1e04ed
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs May 17, 2022
25522dc
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs May 20, 2022
07178ec
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs May 23, 2022
10b7d41
fix conflicts
sarahs Jun 24, 2022
5647fc3
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jun 24, 2022
202ccd2
we no longer have redirect frontmatter strings but let's enforce that…
sarahs Jun 24, 2022
d77727e
re-add exceptions redirects file and handler... we can continue to us…
sarahs Jun 24, 2022
8421ccf
tweak comments a bit
sarahs Jun 24, 2022
f6f43cd
make the exceptions redirects function accept filename as a param so …
sarahs Jun 24, 2022
bdc0302
move some entries to redirect exceptions file, and fix some others th…
sarahs Jun 24, 2022
52aa72b
add a big mega comment to explain all the things (and re-add external…
sarahs Jun 24, 2022
3b9079e
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jun 24, 2022
16dd3d6
tweak comment
sarahs Jun 24, 2022
73bb619
fix some redirect bugs
sarahs Jun 24, 2022
c12bf06
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jun 24, 2022
aed1f59
remove no longer needed test
sarahs Jun 24, 2022
4cbbf22
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jul 21, 2022
bb6c155
remove the else, that was the problem
sarahs Jul 21, 2022
7ad2669
update some filepaths that have changed
sarahs Jul 21, 2022
1bc55b8
these actually are not needed
sarahs Jul 21, 2022
79a8d03
update test to reflect the latest rewrite-links functionality
sarahs Jul 22, 2022
6199aad
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jul 22, 2022
5e437b5
Merge branch 'main' into versioned-redirects
sarahs Jul 22, 2022
0a13ca7
document all the things
sarahs Jul 22, 2022
fec6e08
Merge branch 'main' into versioned-redirects
sarahs Jul 22, 2022
73cd3db
Update tests/rendering/server.js
sarahs Jul 22, 2022
7dc8d11
reorder imports to be more standard
sarahs Jul 22, 2022
74d8080
Merge branch 'versioned-redirects' of github.com:github/docs-internal…
sarahs Jul 22, 2022
77f34bc
Merge branch 'main' of github.com:github/docs-internal into versioned…
sarahs Jul 22, 2022
441c300
Merge pull request #27307 from github/versioned-redirects
sarahs Jul 22, 2022
87990fe
Action ran graphql script"update-files"
rachmari Jul 22, 2022
f432a77
Merge pull request #29281 from github/graphql-schema-update
docubot Jul 22, 2022
8831aa7
Merge branch 'main' into repo-sync
Octomerger Jul 22, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ topics:
- Enterprise
redirect_from:
- /admin/configuration/initializing-github-ae
- /enterprise-server@latest/admin/configuration/configuring-your-enterprise/initializing-github-ae
---
## About initialization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ redirect_from:
- /admin/policies/enforcing-policies-for-your-enterprise/enforcing-github-actions-policies-for-your-enterprise
- /github/setting-up-and-managing-your-enterprise-account/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise/setting-policies-for-organizations-in-your-enterprise-account/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-enterprise-account
versions:
ghec: '*'
ghes: '*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ children:
- /enforcing-policies-for-advanced-security-in-your-enterprise
shortTitle: Enforce policies
---

2 changes: 0 additions & 2 deletions content/admin/policies/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ intro: 'You can set policies in {% data variables.product.product_name %} to red
redirect_from:
- /enterprise/admin/developer-workflow
- /enterprise/admin/policies
- /github/setting-up-and-managing-your-enterprise/setting-policies-for-organizations-in-your-enterprise-account
versions:
ghec: '*'
ghes: '*'
Expand All @@ -16,4 +15,3 @@ children:
- /enforcing-policy-with-pre-receive-hooks
shortTitle: Set policies
---

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ redirect_from:
- /github/setting-up-and-managing-your-enterprise-account/managing-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise/managing-organizations-in-your-enterprise-account
- /admin/user-management/managing-organizations-in-your-enterprise/managing-unowned-organizations-in-your-enterprise
- /github/setting-up-and-managing-your-enterprise/managing-organizations-in-your-enterprise-account/managing-unowned-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise-account/managing-unowned-organizations-in-your-enterprise-account
- /github/setting-up-and-managing-your-enterprise/managing-unowned-organizations-in-your-enterprise-account
intro: 'Organizations are great for creating distinct groups of users within your company, such as divisions or groups working on similar projects. {% ifversion ghae %}Internal{% else %}Public and internal{% endif %} repositories that belong to an organization are accessible to members of other organizations in the enterprise, while private repositories are inaccessible to anyone but members of the organization that are granted access.'
versions:
ghec: '*'
Expand All @@ -31,4 +34,3 @@ children:
- /continuous-integration-using-jenkins
shortTitle: Manage organizations
---

1 change: 0 additions & 1 deletion content/rest/overview/resources-in-the-rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,3 @@ If no `Time-Zone` header is specified and you make an authenticated call to the
If the steps above don't result in any information, we use UTC as the timezone to create the git commit.

[pagination-guide]: /guides/traversing-with-pagination

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ redirect_from:
- /github/working-with-github-support/github-enterprise-cloud-support
- /articles/business-plan-support
- /articles/github-business-cloud-support
- /admin/enterprise-support/about-support-for-advanced-security
- /enterprise-server/admin/enterprise-support/about-support-for-advanced-security
topics:
- Support
---
Expand Down
31 changes: 21 additions & 10 deletions contributing/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,34 @@ Within docs.github.com, you can redirect from one file to another or from one ve

Sometimes we change the name of an article but want its old URL to redirect to its new URL. For these types of redirects, we use `redirect_from` frontmatter. See [/content#redirect_from](/content#redirect_from) for details.

### Automatic redirects for URLs that do not include a version

If a URL for a docs page is entered without a version segment (e.g., `https://docs.github.com/foo` instead of `https://docs.github.com/<version>/foo`), the site will automatically redirect it to the **first available version** of the page. The order of precedence is specified in `lib/all-versions.js`, where the current order is:

1. Free, Pro, & Team (`fpt`)
1. Enterprise Cloud (`ghec`)
1. Enterprise Server (`ghes`)
1. GitHub AE (`ghae`)

So if a page `foo.md` is only available in Cloud and Server, the link `https://docs.github.com/foo` will automatically redirect to `https://docs.github.com/enterprise-cloud@latest/foo` because Cloud has precedence over Server.

If `foo.md` is available in Free, Pro, & Team, no redirect will occur because `fpt` pages do not have a version segment, so the `fpt` content at `https://docs.github.com/foo` will render.

### Redirects across versions

If you want the URL for one version of an article to redirect to the URL for another version, you must use [/lib/redirects/static/redirect-exceptions.txt](/lib/redirects/static/redirect-exceptions.txt) instead. For example, if you remove the Free, Pro, & Team (`fpt`) version of an article, to prevent 404s, the URL for the `fpt` version should redirect to a version of the article that still exists.
If you want the URL for one version of an article to redirect to a URL for another version, you must use [/lib/redirects/static/redirect-exceptions.txt](/lib/redirects/static/redirect-exceptions.txt) instead. For example, if you remove the Free, Pro, & Team (`fpt`) version of an article, the URL will [automatically redirect](#automatic-redirects-for-urls-that-do-not-include-a-version) to the next available version of the page. If you want it to redirect to a version that is **lower in the order of precedence**, or to a different page entirely, you must specify an exception.

Another example: we removed the `ghes` version of "[Exporting member information for your organization](https://docs.github.com/en/organizations/managing-membership-in-your-organization/exporting-member-information-for-your-organization)," but we don't want URLs that include the `enterprise-server@<release>` version segment to 404. In order to redirect `ghes` URLs to another version (such as `ghec`), we need to add an exception.

Each entry in this file should start with the path you want to redirect _to_, including the version, followed by an unordered list of the paths you want to redirect _from_. For example, if you removed the `fpt` version of "[Cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)", you would redirect folks who attempt to access that path to the `ghec` version with the following entry.
Each entry in [the exceptions file](/lib/redirects/static/redirect-exceptions.txt) should start with the path you want to redirect _to_, including the version, followed by an unordered list of the paths you want to redirect _from_:

```
/enterprise-cloud@latest/repositories/creating-and-managing-repositories/cloning-a-repository
- /articles/cloning-a-repository
- /articles/cloning-a-repository-from-github
- /github/creating-cloning-and-archiving-repositories/cloning-a-repository
- /github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository
- /repositories/creating-and-managing-repositories/cloning-a-repository
/enterprise-cloud@latest/organizations/managing-membership-in-your-organization/exporting-member-information-for-your-organization
- /[email protected]/organizations/managing-membership-in-your-organization/exporting-member-information-for-your-organization
- /[email protected]/organizations/managing-membership-in-your-organization/exporting-member-information-for-your-organization
- /[email protected]/organizations/managing-membership-in-your-organization/exporting-member-information-for-your-organization
```

Note that you must add redirects for both the current `fpt` path and any previous `fpt` paths.

## External redirects

Sometimes the canonical home of some content moves outside the help site. For these types of redirects, we add entries to [/lib/redirects/external-sites.json](/lib/redirects/external-sites.json).
Expand Down
34 changes: 31 additions & 3 deletions data/graphql/ghec/schema.docs.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25330,6 +25330,11 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -25356,7 +25361,8 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down Expand Up @@ -29814,6 +29820,16 @@ type ProjectV2Item implements Node {
"""
databaseId: Int

"""
A specific field value given a field name
"""
fieldValueByName(
"""
The name of the field to return the field value of
"""
name: String!
): ProjectV2ItemFieldValue

"""
List of field values
"""
Expand Down Expand Up @@ -43671,6 +43687,11 @@ interface Sponsorable {
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -43697,7 +43718,8 @@ interface Sponsorable {
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down Expand Up @@ -52049,6 +52071,11 @@ type User implements Actor & Node & PackageOwner & ProfileOwner & ProjectNextOwn
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -52075,7 +52102,8 @@ type User implements Actor & Node & PackageOwner & ProfileOwner & ProjectNextOwn
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down
34 changes: 31 additions & 3 deletions data/graphql/schema.docs.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -25330,6 +25330,11 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -25356,7 +25361,8 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down Expand Up @@ -29814,6 +29820,16 @@ type ProjectV2Item implements Node {
"""
databaseId: Int

"""
A specific field value given a field name
"""
fieldValueByName(
"""
The name of the field to return the field value of
"""
name: String!
): ProjectV2ItemFieldValue

"""
List of field values
"""
Expand Down Expand Up @@ -43671,6 +43687,11 @@ interface Sponsorable {
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -43697,7 +43718,8 @@ interface Sponsorable {
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down Expand Up @@ -52049,6 +52071,11 @@ type User implements Actor & Node & PackageOwner & ProfileOwner & ProjectNextOwn
Events involving this sponsorable, such as new sponsorships.
"""
sponsorsActivities(
"""
Filter activities to only the specified actions.
"""
actions: [SponsorsActivityAction!] = []

"""
Returns the elements in the list that come after the specified cursor.
"""
Expand All @@ -52075,7 +52102,8 @@ type User implements Actor & Node & PackageOwner & ProfileOwner & ProjectNextOwn
orderBy: SponsorsActivityOrder = {field: TIMESTAMP, direction: DESC}

"""
Filter activities returned to only those that occurred in a given time range.
Filter activities returned to only those that occurred in the most recent
specified time period. Set to ALL to avoid filtering by when the activity occurred.
"""
period: SponsorsActivityPeriod = MONTH
): SponsorsActivityConnection!
Expand Down
7 changes: 7 additions & 0 deletions lib/all-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import enterpriseServerReleases from './enterprise-server-releases.js'
const versionDelimiter = '@'
const latestNonNumberedRelease = 'latest'

// !Explanation of versionless redirect fallbacks!
// This array is **in order** of the versions the site should try to fall back to if
// no version is provided in a URL. For example, if /foo refers to a page that is available
// in all versions, we should not redirect it (because /foo is the correct FPT versioned URL).
// But if /foo refers to a page that is only available in GHEC and GHES, we should redirect it
// to /enterprise-cloud@latest/foo (since GHEC comes first in the hierarchy of version fallbacks).
// The implementation lives in lib/redirects/permalinks.js.
const plans = [
{
// free-pro-team is **not** a user-facing version and is stripped from URLs.
Expand Down
2 changes: 1 addition & 1 deletion lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const schema = {
message: 'must be the filename of an existing layout file, or `false` for no layout',
},
redirect_from: {
type: ['array', 'string'],
type: 'array',
},
allowTitleToDifferFromFilename: {
type: 'boolean',
Expand Down
16 changes: 16 additions & 0 deletions lib/graphql/static/changelog.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
[
{
"schemaChanges": [
{
"title": "The GraphQL schema includes these changes:",
"changes": [
"Argument 'actions: [SponsorsActivityAction!]` added to field `Organization.sponsorsActivities'",
"Field `fieldValueByName` was added to object type 'ProjectV2Item'",
"Argument 'actions: [SponsorsActivityAction!]` added to field `Sponsorable.sponsorsActivities'",
"Argument 'actions: [SponsorsActivityAction!]` added to field `User.sponsorsActivities'"
]
}
],
"previewChanges": [],
"upcomingChanges": [],
"date": "2022-07-22"
},
{
"schemaChanges": [
{
Expand Down
4 changes: 2 additions & 2 deletions lib/graphql/static/prerendered-objects.json

Large diffs are not rendered by default.

Loading