diff --git a/.github/workflows/sync-audit-logs.yml b/.github/workflows/sync-audit-logs.yml index 180a0183a0..d2e938bd45 100644 --- a/.github/workflows/sync-audit-logs.yml +++ b/.github/workflows/sync-audit-logs.yml @@ -33,7 +33,7 @@ jobs: # need to use a token from a user with access to github/audit-log-allowlists for this step GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }} run: | - src/audit-logs/scripts/sync.js + npm run audit-log-sync - name: Get the audit-log-allowlists SHA being synced id: audit-log-allowlists diff --git a/assets/images/help/codespaces/jetbrains-gateway-connect.png b/assets/images/help/codespaces/jetbrains-gateway-connect.png index c832b32143..3526deb29b 100644 Binary files a/assets/images/help/codespaces/jetbrains-gateway-connect.png and b/assets/images/help/codespaces/jetbrains-gateway-connect.png differ diff --git a/assets/images/help/codespaces/jetbrains-gateway-initial-view.png b/assets/images/help/codespaces/jetbrains-gateway-initial-view.png index f7597b9eef..8705295ebb 100644 Binary files a/assets/images/help/codespaces/jetbrains-gateway-initial-view.png and b/assets/images/help/codespaces/jetbrains-gateway-initial-view.png differ diff --git a/content/codespaces/developing-in-a-codespace/using-github-codespaces-in-your-jetbrains-ide.md b/content/codespaces/developing-in-a-codespace/using-github-codespaces-in-your-jetbrains-ide.md index 84015edfb6..8e5f9bd549 100644 --- a/content/codespaces/developing-in-a-codespace/using-github-codespaces-in-your-jetbrains-ide.md +++ b/content/codespaces/developing-in-a-codespace/using-github-codespaces-in-your-jetbrains-ide.md @@ -44,10 +44,9 @@ The basic process behind using a codespace in your JetBrains IDE is as follows. To work in a codespace in a JetBrains IDE you need: -- A valid JetBrains license -- The JetBrains Gateway application -- {% data variables.product.prodname_cli %} version 2.18.0 or later -- An existing codespace that's running an SSH server. The codespace must have at least 4 cores. +- A valid JetBrains license. +- The JetBrains Gateway application, versions 2023.3.\* or 2024.1.\*. +- An existing codespace running on a virtual machine that has at least 4 cores. The codespace must also be running an SSH server. For more information, see "[Codespace running an SSH server](#codespace-running-an-ssh-server)." ### JetBrains license @@ -59,21 +58,12 @@ You can install and update the JetBrains Gateway from the JetBrains Toolbox appl 1. Download and install the [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app). 1. Open the JetBrains Toolbox. -1. Find **Gateway** in the list of available tools and click **Install**. +1. Find **Gateway** in the list of available tools. ![Screenshot of the JetBrains Toolbox with "Gateway" at the bottom of the list of applications. Each application has an "Install" button next to it.](/assets/images/help/codespaces/jetbrains-toolbox.png) -### {% data variables.product.prodname_cli %} - -The {% data variables.product.prodname_github_codespaces %} plugin for the JetBrains Gateway requires that you have installed and configured {% data variables.product.prodname_cli %} version 2.18.0 or later before opening a codespace from the JetBrains Gateway. - -Use this command to check your version of {% data variables.product.prodname_cli %}: - -```shell copy -gh --version -``` - -For more information, see "[AUTOTITLE](/github-cli/github-cli/about-github-cli)." +1. To the right of **Gateway**, click the ellipsis (**...**), then click **Available versions**. +1. In the list of versions, beside a supported version (see "[Prerequisites](#prerequisites)"), click **Install**. ### Codespace running an SSH server @@ -93,7 +83,8 @@ For more information about the `devcontainer.json` file and the default containe The first time you use JetBrains Gateway for {% data variables.product.prodname_github_codespaces %}, you must install the {% data variables.product.prodname_codespaces %} plugin. You must also allow the JetBrains Gateway to access {% data variables.product.prodname_dotcom_the_website %} using your {% data variables.product.prodname_dotcom %} account. -1. Open the JetBrains Gateway application. +1. Open the JetBrains Toolbox application. +1. In the list of installed tools, click **Gateway**. 1. Under **Install More Providers** click the **Install** link for {% data variables.product.prodname_github_codespaces %}. ![Screenshot of the "Welcome to JetBrains Gateway" page, with "{% data variables.product.prodname_github_codespaces %}" listed under "Install More Providers."](/assets/images/help/codespaces/jetbrains-gateway-initial-view.png) @@ -102,6 +93,10 @@ The first time you use JetBrains Gateway for {% data variables.product.prodname_ ![Screenshot of the Gateway with the "Connect to {% data variables.product.prodname_codespaces %}" button.](/assets/images/help/codespaces/jetbrains-gateway-connect.png) +1. The first time you connect, you're prompted to choose whether you want to allow {% data variables.product.prodname_dotcom %} to collect anonymized usage data, to improve functionality and user experience. Click **Allow** or **Deny**. + + You can change your choice later, if required, in the settings for the {% data variables.product.prodname_github_codespaces %} plugin, which you can access within the JetBrains Gateway settings. + 1. In the "Welcome to JetBrains Gateway" dialog, click **Sign In with {% data variables.product.prodname_dotcom %}**. 1. Click the icon beside the one-time code to copy it. diff --git a/data/reusables/codespaces/codespaces-jetbrains-beta-note.md b/data/reusables/codespaces/codespaces-jetbrains-beta-note.md index b7a5af3add..5ead464e00 100644 --- a/data/reusables/codespaces/codespaces-jetbrains-beta-note.md +++ b/data/reusables/codespaces/codespaces-jetbrains-beta-note.md @@ -1,5 +1,8 @@ {% note %} -**Note**: Using {% data variables.product.prodname_github_codespaces %} with JetBrains IDEs is currently in public beta and is subject to change. +**Notes:** + +- Using {% data variables.product.prodname_github_codespaces %} with JetBrains IDEs is currently in public beta and is subject to change. +- To work on a codespace in a JetBrains IDE you must use release 2023.3.\* or 2024.1.\* of the JetBrains Gateway. {% endnote %} diff --git a/data/reusables/codespaces/opening-codespace-in-jetbrains.md b/data/reusables/codespaces/opening-codespace-in-jetbrains.md index ff0396b633..e4c34693db 100644 --- a/data/reusables/codespaces/opening-codespace-in-jetbrains.md +++ b/data/reusables/codespaces/opening-codespace-in-jetbrains.md @@ -9,10 +9,6 @@ Alternatively, you can also open the JetBrains Gateway and select an existing co ![Screenshot of the JetBrains Gateway home page, showing the "Connect to Codespaces" button.](/assets/images/help/codespaces/jetbrains-gateway-connect.png) -1. The first time you connect, you're prompted to choose whether you want to allow {% data variables.product.prodname_dotcom %} to collect anonymized usage data, to improve functionality and user experience. Click **Allow** or **Deny**. - - You can change your choice later, if required, in the settings for the {% data variables.product.prodname_github_codespaces %} plugin, which you can access within the JetBrains Gateway settings. - 1. In the "Your Codespaces" list, click the codespace you want to work in. ![Screenshot of the "Your Codespaces" list in the JetBrains Gateway.](/assets/images/help/codespaces/jetbrains-gateway-codespaces.png) diff --git a/package.json b/package.json index a0ebcb6fb5..778b3ee3f6 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "scripts": { "analyze-text": "node src/search/scripts/analyze-text.js", "archive-version": "node --max-old-space-size=8192 src/ghes-releases/scripts/archive-version.js", + "audit-log-sync": "tsx src/audit-logs/scripts/sync.ts", "build": "next build", "check-content-type": "node src/workflows/check-content-type.js", "check-github-github-links": "node src/links/scripts/check-github-github-links.js", diff --git a/src/audit-logs/README.md b/src/audit-logs/README.md index 4b110706b1..7fbe98ee96 100644 --- a/src/audit-logs/README.md +++ b/src/audit-logs/README.md @@ -34,13 +34,13 @@ A [workflow](.github/workflows/sync-audit-logs.yml) is used to trigger the autom The workflow creates a pull request with audit log event updates and the label `audit-log-pipeline`. If there is no updated audit log data, a pull request is not created. -The workflow runs the `src/audit-logs/scripts/sync.js` script. +The workflow runs the `src/audit-logs/scripts/sync.ts` script. ## Local development To run the audit log events pipeline locally: -1. Run `src/audit-logs/scripts/sync.js` +1. Run `npm run audit-log-sync` ## About this directory @@ -48,7 +48,7 @@ To run the audit log events pipeline locally: - `src/audit-logs/lib` - The source code used in production to display the audit log event docs and configuration files edited by content and engineering team members. - `src/audit-logs/lib/config.json` - A configuration file used to specify metadata about the audit logs pipeline. - `src/audit-logs/scripts` - The scripts and source code used run the audit logs pipeline, which updates the `src/audit-logs/data` directory. - - `src/audit-logs/scripts/sync.js` - The script that runs the audit-logs pipeline. + - `src/audit-logs/scripts/sync.ts` - The script that runs the audit-logs pipeline. - `src/audit-logs/tests` - The tests used to verify the audit logs pipeline. ## Content team diff --git a/src/audit-logs/scripts/sync.js b/src/audit-logs/scripts/sync.ts similarity index 92% rename from src/audit-logs/scripts/sync.js rename to src/audit-logs/scripts/sync.ts index 6f682de255..cad51b556c 100755 --- a/src/audit-logs/scripts/sync.js +++ b/src/audit-logs/scripts/sync.ts @@ -15,12 +15,12 @@ import { mkdirp } from 'mkdirp' import path from 'path' import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index.js' -import { getContents, getCommitSha } from '#src/workflows/git-utils.js' +import { getContents, getCommitSha } from '@/workflows/git-utils.js' import { latest, latestStable, releaseCandidate, -} from '#src/versions/lib/enterprise-server-releases.js' +} from '@/versions/lib/enterprise-server-releases.js' if (!process.env.GITHUB_TOKEN) { throw new Error('GITHUB_TOKEN environment variable must be set to run this script') @@ -34,6 +34,13 @@ const AUDIT_LOG_PAGES = { ENTERPRISE: 'enterprise', } +type AuditLogEventT = { + action: string + description: string +} + +type AuditLogdata = Record> + async function main() { // get latest audit log data // @@ -75,14 +82,19 @@ async function main() { // data for every supported GHES version including RC releases. Just to be // extra careful, we also fallback to the latest stable GHES version if // there's an RC release in the docs site but no audit log data for that version. - const auditLogData = {} + const auditLogData: Record = {} + // Wrapper around filterByAllowlistValues() because we always need all the // schema events and pipeline config data. - const filter = (allowListValues, currentEvents = []) => + const filter = (allowListValues: string | string[], currentEvents: AuditLogEventT[] = []) => filterByAllowlistValues(schemaEvents, allowListValues, currentEvents, pipelineConfig) // Wrapper around filterGhesByAllowlistValues() because we always need all the // schema events and pipeline config data. - const filterAndUpdateGhes = (allowListValues, auditLogPage, currentEvents) => + const filterAndUpdateGhes = ( + allowListValues: string | string[], + auditLogPage: string, + currentEvents: AuditLogdata, + ) => filterAndUpdateGhesDataByAllowlistValues( schemaEvents, allowListValues,