Skip to content

Commit

Permalink
Merge pull request #34642 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Sep 18, 2024
2 parents 8755622 + e37f937 commit 1ac8308
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/github-apps/lib/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
"2022-11-28"
]
},
"sha": "5a9222e9dba71d8c7d75d8e780cf091f16a9f5a7"
"sha": "dd9a41e53082d946d5732c803cab3f9be31c1332"
}
6 changes: 5 additions & 1 deletion src/pagelist/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ router.get('/v1/:product@:version', (req: ExtendedRequest, res: Response) => {

// we filter the permalinks to get only our target version
const filteredPermalinks = keys.filter((key) => versionMatcher(key, `${product}@${version}`))
const expression = /^\/en/

if (!filteredPermalinks.length) {
res.status(400).type('text').send('Invalid version')
return
}

//right now we only need english permalinks perhaps we can use the language from the request in the future
const englishPermalinks = filteredPermalinks.filter((permalink) => expression.test(permalink))

defaultCacheControl(res)

// new line added at the end so `wc` works as expected with `-l` and `-w`.
res.type('text').send(filteredPermalinks.join('\n').concat('\n'))
res.type('text').send(englishPermalinks.join('\n').concat('\n'))
})

router.get('/:product@:version', (req, res) => {
Expand Down
10 changes: 10 additions & 0 deletions src/pagelist/tests/pagelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ describe.each(allVersionKeys)('pagelist api for %s', async (versionKey) => {
expect(permalink).toMatch(expression)
})
})

test('only returns urls that contain /en', async () => {
const expression = new RegExp(`^/en(/${nonEnterpriseDefaultVersion})?/?.*`)
res.body
.trim()
.split('\n')
.forEach((permalink: string) => {
expect(permalink).toMatch(expression)
})
})
})
10 changes: 9 additions & 1 deletion src/rest/data/fpt-2022-11-28/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -154353,6 +154353,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "enabled",
"secret_scanning_validity_checks": "enabled",
"secret_scanning_non_provider_patterns": "enabled",
"private_vulnerability_reporting": "enabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/17",
Expand All @@ -154377,6 +154378,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "enabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "enabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1326",
Expand Down Expand Up @@ -154808,6 +154810,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -155050,6 +155053,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "enabled",
"secret_scanning_validity_checks": "enabled",
"secret_scanning_non_provider_patterns": "enabled",
"private_vulnerability_reporting": "enabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -155441,6 +155445,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -155864,6 +155869,7 @@
"secret_scanning": "disabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -156314,6 +156320,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -157345,6 +157352,7 @@
"secret_scanning": "enabled",
"secret_scanning_push_protection": "disabled",
"secret_scanning_validity_checks": "disabled",
"secret_scanning_non_provider_patterns": "disabled",
"private_vulnerability_reporting": "disabled",
"enforcement": "enforced",
"url": "https://api.github.com/orgs/octo-org/code-security/configurations/1325",
Expand Down Expand Up @@ -349482,7 +349490,7 @@
}
],
"previews": [],
"descriptionHTML": "<div class=\"ghd-alert ghd-alert-attention\"><p class=\"ghd-alert-title\"><svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon mr-2\" aria-hidden><path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>Warning</p>\n<p>\n<strong>Deprecation notice:</strong> The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use <a href=\"https://docs.github.com/rest/code-security/configurations\">code security configurations</a> instead. For more information, see the <a href=\"https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/\">changelog</a>.</p>\n</div>\n<p>Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"<a href=\"https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization\">Managing security managers in your organization</a>.\"</p>\n<p>The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.</p>\n<p>OAuth app tokens and personal access tokens (classic) need the <code>write:org</code> scope to use this endpoint.</p>",
"descriptionHTML": "<div class=\"ghd-alert ghd-alert-attention\"><p class=\"ghd-alert-title\"><svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon mr-2\" aria-hidden><path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>Warning</p>\n<p>\n<strong>Deprecation notice:</strong> The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use <a href=\"https://docs.github.com/rest/code-security/configurations\">code security configurations</a> instead. For more information, see the <a href=\"https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/\">changelog</a>.</p>\n</div>\n<p>Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see \"<a href=\"https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization\">Managing security managers in your organization</a>.\"</p>\n<p>The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.</p>\n<p>OAuth app tokens and personal access tokens (classic) need the <code>admin:org</code>, <code>write:org</code>, or <code>repo</code> scopes to use this endpoint.</p>",
"statusCodes": [
{
"httpStatusCode": "204",
Expand Down
Loading

0 comments on commit 1ac8308

Please sign in to comment.