1
0
mirror of synced 2026-01-06 06:02:35 -05:00
Co-authored-by: Peter Bengtsson <peterbe@github.com>
Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
Co-authored-by: Chad Fawcett <me@chadf.ca>
This commit is contained in:
docs-bot
2024-06-18 10:47:03 -07:00
committed by GitHub
parent 7e62f2a18c
commit 6d3b76a726
9 changed files with 47 additions and 42 deletions

View File

@@ -41,23 +41,13 @@ tools](https://developer.apple.com/downloads/index.action) and [Rosetta 2](https
{% endnote %}
### 1. Download the {% data variables.product.prodname_codeql_cli %} zip package
### 1. Download the {% data variables.product.prodname_codeql_cli %} tar archive
{% data reusables.codeql-cli.download-codeql-cli-zip %}
{% data reusables.codeql-cli.download-codeql-cli %}
You should always use the {% data variables.product.prodname_codeql %} bundle as this ensures compatibility and also gives much better performance than a separate download of the {% data variables.product.prodname_codeql_cli %} and checkout of the {% data variables.product.prodname_codeql %} queries. If you will only be running the CLI on one specific platform, download the appropriate `codeql-bundle-PLATFORM.tar.gz` file. Alternatively, you can download `codeql-bundle.tar.gz`, which contains the CLI for all supported platforms.
### 2. Extract the {% data variables.product.prodname_codeql_cli %} tar archive
#### Download information for macOS "Catalina" (or newer) users
{% data reusables.codeql-cli.download-info-macos-catalina-or-newer %}
### 2. Extract the zip archive
For Linux, Windows, and macOS users (version 10.14 "Mojave", and earlier) simply extract the zip archive.
#### Extraction information for macOS "Catalina" (or newer) users
{% data reusables.codeql-cli.extraction-info-macos-catalina-or-newer %}
Extract the {% data variables.product.prodname_codeql_cli %} tar archive to a directory of your choosing.
### 3. Launch `codeql`

View File

@@ -26,13 +26,9 @@ For information on the most simple setup of the {% data variables.product.prodna
Some users prefer working with {% data variables.product.prodname_codeql %} query sources directly in order to work on or contribute to the Open Source shared queries. In order to do this, the following steps are recommended.
### 1. Download the {% data variables.product.prodname_codeql_cli %} zip
### 1. Download the {% data variables.product.prodname_codeql_cli %} tar archive
{% data reusables.codeql-cli.download-codeql-cli-zip %}
#### Download information for macOS "Catalina" (or newer) users
{% data reusables.codeql-cli.download-info-macos-catalina-or-newer %}
{% data reusables.codeql-cli.download-codeql-cli %}
### 2. Create a new {% data variables.product.prodname_codeql %} directory
@@ -73,17 +69,13 @@ see "[AUTOTITLE](/code-security/codeql-cli/using-the-advanced-functionality-of-t
{% endnote %}
### 4. Extract the zip archive
### 4. Extract the {% data variables.product.prodname_codeql_cli %} tar archive
For Linux, Windows, and macOS users (version 10.14 "Mojave", and earlier) simply extract the zip archive into the directory you created in step 2.
Extract the tar archive into the directory you created in step 2.
For example, if the path to your copy of the {% data variables.product.prodname_codeql %} repository is `$HOME/codeql-home/codeql-repo`, then extract the CLI into
`$HOME/codeql-home/`.
#### Extraction information for macOS "Catalina" (or newer) users
{% data reusables.codeql-cli.extraction-info-macos-catalina-or-newer %}
### 5. Launch `codeql`
{% data reusables.codeql-cli.launch-codeql %}

View File

@@ -1,4 +1,4 @@
The {% data variables.product.prodname_codeql_cli %} download package is a zip archive containing tools, scripts, and
The {% data variables.product.prodname_codeql_cli %} download package is a tar archive containing tools, scripts, and
various {% data variables.product.prodname_codeql %}-specific files. If you dont have a {% data variables.product.prodname_enterprise %} license then, by
downloading this archive, you are agreeing to the [{% data variables.product.prodname_dotcom %} {% data variables.product.prodname_codeql %} Terms and
Conditions](https://securitylab.github.com/tools/codeql/license).
@@ -16,3 +16,5 @@ For {% data variables.product.product_name %}{% ifversion ghes %} {{ allVersions
{% endnote %}
{% endif %}
You should always use the {% data variables.product.prodname_codeql %} bundle as this ensures compatibility and also gives much better performance than a separate download of the {% data variables.product.prodname_codeql_cli %} and checkout of the {% data variables.product.prodname_codeql %} queries. If you will only be running the CLI on one specific platform, download the appropriate `codeql-bundle-PLATFORM.tar.gz` file. Alternatively, you can download `codeql-bundle.tar.gz`, which contains the CLI for all supported platforms.

View File

@@ -224,6 +224,11 @@
"description": "The slug for the enterprise URL was renamed.",
"docs_reference_links": "N/A"
},
{
"action": "business.revoke_sso_session",
"description": "The SAML single sign-on session for a member in an enterprise was revoked.",
"docs_reference_links": "N/A"
},
{
"action": "business_secret_scanning_automatic_validity_checks.disabled",
"description": "Automatic partner validation checks have been disabled at the business level",

View File

@@ -3,5 +3,5 @@
"apiOnlyEvents": "This event is not available in the web interface, only via the REST API, audit log streaming, or JSON/CSV exports.",
"apiRequestEvent": "This event is only available via audit log streaming."
},
"sha": "85a279c15cbe907d055830214c1ee9320fbfd9ea"
"sha": "476743b7f0d4adcd4b825fb00ce54b76b2d623b5"
}

View File

@@ -1,11 +1,17 @@
import { getDataByLanguage } from '#src/data-directory/lib/get-data.js'
import { liquid } from '#src/content-render/index.js'
import { executeWithFallback } from '#src/languages/lib/render-with-fallback.js'
import { correctTranslatedContentStrings } from '#src/languages/lib/correct-translation-content.js'
import type { Response, NextFunction } from 'express'
export default async function glossaries(req, res, next) {
import type { Context, ExtendedRequest, Glossary } from '@/types'
import { getDataByLanguage } from '@/data-directory/lib/get-data.js'
import { liquid } from '@/content-render/index.js'
import { executeWithFallback } from '@/languages/lib/render-with-fallback.js'
import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js'
export default async function glossaries(req: ExtendedRequest, res: Response, next: NextFunction) {
if (!req.pagePath) throw new Error('request is not contextualized')
if (!req.pagePath.endsWith('/get-started/learning-about-github/github-glossary')) return next()
if (!req.context) throw new Error('request is not contextualized')
// If the current version (which is found as part of the URL), does not
// correspond to a supported version, the Liquid rendering will fail
// (if there's uses of `ifversion` in any the Liquid).
@@ -19,7 +25,8 @@ export default async function glossaries(req, res, next) {
const enGlossaryMap = new Map()
// But we don't need to bother if the current language is English.
if (req.context.currentLanguage !== 'en') {
const enGlossariesRaw = getDataByLanguage('glossaries.external', 'en')
const enGlossariesRaw: Glossary[] = getDataByLanguage('glossaries.external', 'en')
enGlossariesRaw.forEach(({ term, description }) => {
enGlossaryMap.set(term, description)
})
@@ -30,12 +37,15 @@ export default async function glossaries(req, res, next) {
// The github-glossary.md file uses Liquid to generate the Markdown.
// It uses Liquid to say `{{ glossary.description }}` but once that's
// injected there it needs to have its own possible Liquid rendered out.
const glossariesRaw = getDataByLanguage('glossaries.external', req.context.currentLanguage)
const glossariesRaw: Glossary[] = getDataByLanguage(
'glossaries.external',
req.context.currentLanguage,
)
const glossaries = (
await Promise.all(
glossariesRaw.map(async (glossary) => {
let { description } = glossary
if (req.context.currentLanguage !== 'en') {
if (req.context!.currentLanguage !== 'en') {
description = correctTranslatedContentStrings(
description,
// The function needs the English equivalent of the translated
@@ -46,13 +56,13 @@ export default async function glossaries(req, res, next) {
// in this mapping we often don't have an English equivalent.
// So that's why we fall back on the empty string.
enGlossaryMap.get(glossary.term) || '',
{ code: req.context.currentLanguage },
{ code: req.context!.currentLanguage },
)
}
description = await executeWithFallback(
req.context,
() => liquid.parseAndRender(description, req.context),
(enContext) => {
(enContext: Context) => {
const { term } = glossary
// It *could* be that the translation is referring to a term
// that no longer exists in the English glossary. In that case,
@@ -71,7 +81,7 @@ export default async function glossaries(req, res, next) {
).filter(Boolean)
req.context.glossaries = glossaries.sort((a, b) =>
a.term.localeCompare(b.term, req.context.currentLanguage),
a.term.localeCompare(b.term, req.context!.currentLanguage),
)
return next()

View File

@@ -43,7 +43,7 @@ import layout from './context/layout'
import currentProductTree from './context/current-product-tree'
import genericToc from './context/generic-toc'
import breadcrumbs from './context/breadcrumbs'
import glossaries from './context/glossaries.js'
import glossaries from './context/glossaries'
import renderProductName from './context/render-product-name.js'
import features from '@/versions/middleware/features.js'
import productExamples from './context/product-examples.js'

View File

@@ -1,7 +1,7 @@
import { describe, expect, test } from 'vitest'
import { languageKeys } from '#src/languages/lib/languages.js'
import { getDOM } from '#src/tests/helpers/e2etest.js'
import { languageKeys } from '@/languages/lib/languages.js'
import { getDOM } from '@/tests/helpers/e2etest.js'
const langs = languageKeys.filter((lang) => lang !== 'en')

View File

@@ -91,6 +91,12 @@ export type Context = {
genericTocFlat?: ToC[]
genericTocNested?: ToC[]
breadcrumbs?: Breadcrumb[]
glossaries?: Glossary[]
}
export type Glossary = {
term: string
description: string
}
type Breadcrumb = {