diff --git a/.github/workflows/orphaned-assets-check.yml b/.github/workflows/orphaned-assets-check.yml index 7048faad10..e9419f09a1 100644 --- a/.github/workflows/orphaned-assets-check.yml +++ b/.github/workflows/orphaned-assets-check.yml @@ -11,7 +11,7 @@ permissions: contents: read jobs: - build: + orphaned-assets-check: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/prod-build-deploy-azure.yml b/.github/workflows/prod-build-deploy-azure.yml index e638f8189e..a2f6a92c27 100644 --- a/.github/workflows/prod-build-deploy-azure.yml +++ b/.github/workflows/prod-build-deploy-azure.yml @@ -26,9 +26,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 env: - IMAGE_TAG_BASE: ${{ secrets.PROD_REGISTRY_SERVER }}/${{ github.repository }} + DOCKER_IMAGE: ${{ secrets.PROD_REGISTRY_SERVER }}/${{ github.repository }}:${{ github.sha }} steps: + - name: 'Az CLI login' + uses: azure/login@66d2e78565ab7af265d2b627085bc34c73ce6abb + with: + creds: ${{ secrets.PROD_AZURE_CREDENTIALS }} + - name: 'Docker login' uses: azure/docker-login@81744f9799e7eaa418697cb168452a2882ae844a with: @@ -68,10 +73,65 @@ jobs: context: . push: true target: 'production_early_access' - tags: ${{ env.IMAGE_TAG_BASE }}:${{ github.sha }}, ${{ env.IMAGE_TAG_BASE }}:production + tags: ${{ env.DOCKER_IMAGE }} cache-from: type=gha cache-to: type=gha,mode=max + - name: 'Update docker-compose.prod.yaml template file' + run: | + sed 's|#{IMAGE}#|${{ env.DOCKER_IMAGE }}|g' docker-compose.prod.tmpl.yaml > docker-compose.prod.yaml + + - name: 'Apply updated docker-compose.prod.yaml config to preview slot' + run: | + az webapp config container set --multicontainer-config-type COMPOSE --multicontainer-config-file docker-compose.prod.yaml --slot preview -n ghdocs-prod -g docs-prod + + # Watch preview slot instances to see when all the instances are ready + - name: Check that preview slot is ready + uses: actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d + env: + CHECK_INTERVAL: 10000 + with: + script: | + const { execSync } = require('child_process') + + const getStatesForSlot = (slot) => { + return JSON.parse( + execSync( + `az webapp list-instances --slot ${slot} --query "[].state" -n ghdocs-prod -g docs-prod`, + { encoding: 'utf8' } + ) + ) + } + + let hasStopped = false + const waitDuration = parseInt(process.env.CHECK_INTERVAL, 10) || 10000 + async function doCheck() { + const states = getStatesForSlot('preview') + console.log(`Instance states:`, states) + + // We must wait until at-least 1 instance has STOPPED to know we're looking at the "next" deployment and not the "previous" one + // That way we don't immediately succeed just because all the previous instances were READY + if (!hasStopped) { + hasStopped = states.some((s) => s === 'STOPPED') + } + + const isAllReady = states.every((s) => s === 'READY') + + if (hasStopped && isAllReady) { + process.exit(0) // success + } + + console.log(`checking again in ${waitDuration}ms`) + setTimeout(doCheck, waitDuration) + } + + doCheck() + + # TODO - make a request to verify the preview app version aligns with *this* github action workflow commit sha + - name: 'Swap preview slot to production' + run: | + az webapp deployment slot swap --slot preview --target-slot production -n ghdocs-prod -g docs-prod + # TODO - enable this when we disable the other production deploy # - name: Purge Fastly edge cache # env: diff --git a/assets/images/azure/azure-resources-search.png b/assets/images/azure/azure-resources-search.png new file mode 100644 index 0000000000..093792539a Binary files /dev/null and b/assets/images/azure/azure-resources-search.png differ diff --git a/assets/images/azure/azure-storage-containers.png b/assets/images/azure/azure-storage-containers.png new file mode 100644 index 0000000000..96059de04b Binary files /dev/null and b/assets/images/azure/azure-storage-containers.png differ diff --git a/assets/images/azure/azure-storage-permissions.png b/assets/images/azure/azure-storage-permissions.png new file mode 100644 index 0000000000..040479bdaa Binary files /dev/null and b/assets/images/azure/azure-storage-permissions.png differ diff --git a/assets/images/azure/azure-storage-shared-access-tokens.png b/assets/images/azure/azure-storage-shared-access-tokens.png new file mode 100644 index 0000000000..89a7a206de Binary files /dev/null and b/assets/images/azure/azure-storage-shared-access-tokens.png differ diff --git a/assets/images/enterprise/3.4/actions-access-settings.png b/assets/images/enterprise/3.4/actions-access-settings.png new file mode 100644 index 0000000000..752690015f Binary files /dev/null and b/assets/images/enterprise/3.4/actions-access-settings.png differ diff --git a/assets/images/enterprise/site-admin-settings/site-admin-link.png b/assets/images/enterprise/site-admin-settings/site-admin-link.png new file mode 100644 index 0000000000..f30a8357f7 Binary files /dev/null and b/assets/images/enterprise/site-admin-settings/site-admin-link.png differ diff --git a/assets/images/enterprise/support/support-ticket-add-file.png b/assets/images/enterprise/support/support-ticket-add-file.png deleted file mode 100644 index 7f314e1be7..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-add-file.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-description-field.png b/assets/images/enterprise/support/support-ticket-description-field.png deleted file mode 100644 index 4c83aa6277..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-description-field.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-email-address-field.png b/assets/images/enterprise/support/support-ticket-email-address-field.png deleted file mode 100644 index d02f299679..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-email-address-field.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-ghe-product.png b/assets/images/enterprise/support/support-ticket-ghe-product.png deleted file mode 100644 index 9c490cd03d..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-ghe-product.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-ghes-series.png b/assets/images/enterprise/support/support-ticket-ghes-series.png deleted file mode 100644 index 3208df2e5d..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-ghes-series.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-global-region.png b/assets/images/enterprise/support/support-ticket-global-region.png deleted file mode 100644 index 731f9fefa0..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-global-region.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-priority.png b/assets/images/enterprise/support/support-ticket-priority.png deleted file mode 100644 index 9c8404c184..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-priority.png and /dev/null differ diff --git a/assets/images/enterprise/support/support-ticket-subject-field.png b/assets/images/enterprise/support/support-ticket-subject-field.png deleted file mode 100644 index 91e156a5a9..0000000000 Binary files a/assets/images/enterprise/support/support-ticket-subject-field.png and /dev/null differ diff --git a/assets/images/help/enterprises/audit-stream-add-azureblob.png b/assets/images/help/enterprises/audit-stream-add-azureblob.png new file mode 100644 index 0000000000..21f4bf0cdf Binary files /dev/null and b/assets/images/help/enterprises/audit-stream-add-azureblob.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-azure.png b/assets/images/help/enterprises/audit-stream-choice-azure.png index 1f632f1db2..206d236942 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-azure.png and b/assets/images/help/enterprises/audit-stream-choice-azure.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-azureblob.png b/assets/images/help/enterprises/audit-stream-choice-azureblob.png new file mode 100644 index 0000000000..d7d08c51d4 Binary files /dev/null and b/assets/images/help/enterprises/audit-stream-choice-azureblob.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png b/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png index 5fab644d54..036ebc0383 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png and b/assets/images/help/enterprises/audit-stream-choice-google-cloud-storage.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-s3.png b/assets/images/help/enterprises/audit-stream-choice-s3.png index a77a643924..0b0d6e3107 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-s3.png and b/assets/images/help/enterprises/audit-stream-choice-s3.png differ diff --git a/assets/images/help/enterprises/audit-stream-choice-splunk.png b/assets/images/help/enterprises/audit-stream-choice-splunk.png index 60fdab62a2..69708a399b 100644 Binary files a/assets/images/help/enterprises/audit-stream-choice-splunk.png and b/assets/images/help/enterprises/audit-stream-choice-splunk.png differ diff --git a/assets/images/help/enterprises/emu-login-submit.png b/assets/images/help/enterprises/emu-login-submit.png new file mode 100644 index 0000000000..bbb69545fa Binary files /dev/null and b/assets/images/help/enterprises/emu-login-submit.png differ diff --git a/assets/images/help/enterprises/emu-login-username.png b/assets/images/help/enterprises/emu-login-username.png new file mode 100644 index 0000000000..bbb65cdde7 Binary files /dev/null and b/assets/images/help/enterprises/emu-login-username.png differ diff --git a/assets/images/help/enterprises/idp-groups-team-switcher.png b/assets/images/help/enterprises/idp-groups-team-switcher.png new file mode 100644 index 0000000000..44f0575449 Binary files /dev/null and b/assets/images/help/enterprises/idp-groups-team-switcher.png differ diff --git a/assets/images/help/enterprises/select-idp-group.png b/assets/images/help/enterprises/select-idp-group.png new file mode 100644 index 0000000000..4819532280 Binary files /dev/null and b/assets/images/help/enterprises/select-idp-group.png differ diff --git a/assets/images/help/enterprises/view-suspended-members.png b/assets/images/help/enterprises/view-suspended-members.png new file mode 100644 index 0000000000..4322ff1bb9 Binary files /dev/null and b/assets/images/help/enterprises/view-suspended-members.png differ diff --git a/assets/images/help/organizations/secret-scanning-filter-alerts.png b/assets/images/help/organizations/secret-scanning-filter-alerts.png new file mode 100644 index 0000000000..60685df2e5 Binary files /dev/null and b/assets/images/help/organizations/secret-scanning-filter-alerts.png differ diff --git a/assets/images/help/organizations/view-alert-subset.png b/assets/images/help/organizations/view-alert-subset.png new file mode 100644 index 0000000000..0d6565ed92 Binary files /dev/null and b/assets/images/help/organizations/view-alert-subset.png differ diff --git a/assets/images/help/pull_requests/commit-squashing-diagram.png b/assets/images/help/pull_requests/commit-squashing-diagram.png index 702896664e..e197d830b1 100644 Binary files a/assets/images/help/pull_requests/commit-squashing-diagram.png and b/assets/images/help/pull_requests/commit-squashing-diagram.png differ diff --git a/assets/images/help/pull_requests/standard-merge-commit-diagram.png b/assets/images/help/pull_requests/standard-merge-commit-diagram.png index 8b7c985169..72360c1b7a 100644 Binary files a/assets/images/help/pull_requests/standard-merge-commit-diagram.png and b/assets/images/help/pull_requests/standard-merge-commit-diagram.png differ diff --git a/assets/images/help/repository/actions-general-tab.png b/assets/images/help/repository/actions-general-tab.png new file mode 100644 index 0000000000..52d7c24fd1 Binary files /dev/null and b/assets/images/help/repository/actions-general-tab.png differ diff --git a/assets/images/help/repository/repo-code-scanning-filter-and-search.png b/assets/images/help/repository/repo-code-scanning-filter-and-search.png new file mode 100644 index 0000000000..faa709d1b9 Binary files /dev/null and b/assets/images/help/repository/repo-code-scanning-filter-and-search.png differ diff --git a/assets/images/help/repository/repo-security-side-panel.png b/assets/images/help/repository/repo-security-side-panel.png new file mode 100644 index 0000000000..b3979a861b Binary files /dev/null and b/assets/images/help/repository/repo-security-side-panel.png differ diff --git a/assets/images/help/repository/security-tab.png b/assets/images/help/repository/security-tab.png index f7ce2d480f..678e380f82 100644 Binary files a/assets/images/help/repository/security-tab.png and b/assets/images/help/repository/security-tab.png differ diff --git a/assets/images/help/settings/actions-access-settings.png b/assets/images/help/settings/actions-access-settings.png index 752690015f..e88371dcaa 100644 Binary files a/assets/images/help/settings/actions-access-settings.png and b/assets/images/help/settings/actions-access-settings.png differ diff --git a/assets/images/help/support/add-comment.png b/assets/images/help/support/add-comment.png new file mode 100644 index 0000000000..dc75ab19cd Binary files /dev/null and b/assets/images/help/support/add-comment.png differ diff --git a/assets/images/help/support/close-ticket.png b/assets/images/help/support/close-ticket.png new file mode 100644 index 0000000000..e223ea1d6b Binary files /dev/null and b/assets/images/help/support/close-ticket.png differ diff --git a/assets/images/help/support/installation-field.png b/assets/images/help/support/installation-field.png new file mode 100644 index 0000000000..9190c09941 Binary files /dev/null and b/assets/images/help/support/installation-field.png differ diff --git a/assets/images/help/support/my-tickets-header.png b/assets/images/help/support/my-tickets-header.png new file mode 100644 index 0000000000..cc73c4335e Binary files /dev/null and b/assets/images/help/support/my-tickets-header.png differ diff --git a/assets/images/help/support/my-tickets-list.png b/assets/images/help/support/my-tickets-list.png new file mode 100644 index 0000000000..749331c7df Binary files /dev/null and b/assets/images/help/support/my-tickets-list.png differ diff --git a/assets/images/help/support/new-comment-field.png b/assets/images/help/support/new-comment-field.png new file mode 100644 index 0000000000..2ae833e845 Binary files /dev/null and b/assets/images/help/support/new-comment-field.png differ diff --git a/assets/images/help/support/product-field-ghec.png b/assets/images/help/support/product-field-ghec.png new file mode 100644 index 0000000000..43eba4d21a Binary files /dev/null and b/assets/images/help/support/product-field-ghec.png differ diff --git a/assets/images/help/support/support-recent-response.png b/assets/images/help/support/support-recent-response.png new file mode 100644 index 0000000000..4bf1a7dd73 Binary files /dev/null and b/assets/images/help/support/support-recent-response.png differ diff --git a/assets/images/help/support/ticket-context.png b/assets/images/help/support/ticket-context.png new file mode 100644 index 0000000000..dd589daa8b Binary files /dev/null and b/assets/images/help/support/ticket-context.png differ diff --git a/components/Search.tsx b/components/Search.tsx index 3f6d0adc70..662ff49e76 100644 --- a/components/Search.tsx +++ b/components/Search.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, ReactNode, RefObject } from 'react' import { useRouter } from 'next/router' import useSWR from 'swr' import cx from 'classnames' -import { ActionList, DropdownMenu, Label, Overlay } from '@primer/components' +import { ActionList, DropdownMenu, Flash, Label, Overlay } from '@primer/components' import { ItemInput } from '@primer/components/lib/ActionList/List' import { useTranslation } from 'components/hooks/useTranslation' @@ -176,20 +176,28 @@ export function Search({ 'pt-9 color-bg-default color-shadow-medium position-absolute top-0 right-0', styles.resultsContainer, isHeaderSearch && styles.resultsContainerHeader, - query ? 'd-block' : 'd-none', - query && styles.resultsContainerOpen + query || searchError ? 'd-block' : 'd-none', + (query || searchError) && styles.resultsContainerOpen )} > - + {searchError ? ( + + ) : ( + + )} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
(value: T, delay?: number): [T, (value: T) => void] { return [debouncedValue, setDebouncedValue] } +function ShowSearchError({ + error, + isHeaderSearch, + isMobileSearch, +}: { + error: Error + isHeaderSearch: boolean + isMobileSearch: boolean +}) { + const { t } = useTranslation('search') + return ( + +

{t('search_error')}

+ {process.env.NODE_ENV === 'development' && ( +

+ + {error.toString()} + +

+ )} +
+ ) +} + function ShowSearchResults({ anchorRef, isHeaderSearch, diff --git a/components/guides/LearningTrack.tsx b/components/guides/LearningTrack.tsx index 70bd056e99..1efaf4626f 100644 --- a/components/guides/LearningTrack.tsx +++ b/components/guides/LearningTrack.tsx @@ -2,7 +2,7 @@ import cx from 'classnames' import { useTranslation } from 'components/hooks/useTranslation' import { ArrowRightIcon } from '@primer/octicons-react' import { ActionList } from '@primer/components' -import { useEffect, useRef, useState } from 'react' +import { useState } from 'react' import { FeaturedTrack } from 'components/context/ProductGuidesContext' import { TruncateLines } from 'components/ui/TruncateLines' import slugger from 'github-slugger' @@ -17,15 +17,10 @@ export const LearningTrack = ({ track }: Props) => { const [numVisible, setNumVisible] = useState(DEFAULT_VISIBLE_GUIDES) const { t } = useTranslation('product_guides') const slug = track?.title ? slugger.slug(track?.title) : '' - const listRef = useRef(null) const showAll = () => { setNumVisible(track?.guides?.length || 0) } - useEffect(() => { - if (listRef.current) listRef.current.focus() - }) - return (
@@ -62,7 +57,6 @@ export const LearningTrack = ({ track }: Props) => { return { renderItem: () => ( { const { t } = useTranslation('product_landing') const [numVisible, setNumVisible] = useState(PAGE_SIZE) const [search, setSearch] = useState('') + const [typed, setTyped] = useState('') - const onSearchChange: React.ChangeEventHandler = (e) => { - setSearch(e.target.value) + useEffect(() => { setNumVisible(PAGE_SIZE) // reset the visible count (only matters after searching) - } + }, [search]) const isSearching = !!search let searchResults: typeof productCodeExamples = [] @@ -31,7 +31,13 @@ export const CodeExamples = () => { return (
-
+
{ + event.preventDefault() + setSearch(typed.trim()) + }} + > { type="search" autoComplete="off" aria-label={t('search_code_examples')} - onChange={onSearchChange} + onChange={(event) => setTyped(event.target.value)} + value={typed} /> -
+ + -
+ {isSearching && ( +
+

+ {t('search_results_for')}: {search} +

+

+ {t('matches_displayed')}: {searchResults.length} +

+
+ )} +
    {(isSearching ? searchResults : productCodeExamples.slice(0, numVisible)).map((example) => { return (
  • @@ -61,7 +81,7 @@ export const CodeExamples = () => {
  • ) })} -
+ {numVisible < productCodeExamples.length && !isSearching && (