Skip to content

Commit

Permalink
Merge branch 'main' into mntlty/merge_queue_action
Browse files Browse the repository at this point in the history
  • Loading branch information
dihydroJenoxide authored Aug 2, 2022
2 parents 2d9ae6a + 11267f2 commit c638500
Show file tree
Hide file tree
Showing 2,833 changed files with 1,194,950 additions and 31,816 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion .github/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/check-all-english-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
run: |
node server.mjs > /tmp/stdout.log 2> /tmp/stderr.log &
node server.js > /tmp/stdout.log 2> /tmp/stderr.log &
sleep 6
curl --retry-connrefused --retry 5 -I http://localhost:4000/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-broken-links-github-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
DISABLE_RENDERING_CACHE: true
run: |
node server.mjs &
node server.js &
sleep 5
curl --retry-connrefused --retry 3 -I http://localhost:4000/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '**.yaml'
- '**.yml'
- '**.scss'
- .eslintrc.js
- .eslintrc.cjs
# In case something like eslint or tsc or prettier upgrades
- 'package-lock.json'
# Ultimately, for debugging this workflow itself
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dry-run-elasticsearch-indexing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
merge_group:
pull_request:
paths:
- script/search/index-elasticsearch.mjs
- script/search/index-elasticsearch.js
- 'package*.json'
- .github/workflows/dry-run-elasticsearch-indexing.yml

Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
env:
ELASTICSEARCH_URL: 'http://localhost:9200'
run: |
./script/search/index-elasticsearch.mjs --verbose \
./script/search/index-elasticsearch.js --verbose \
-l en -l ja \
-V dotcom -V ghes-3.5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/link-check-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
run: |
./script/rendered-content-link-checker.mjs \
./script/rendered-content-link-checker.js \
--language en \
--max 100 \
--check-anchors \
Expand All @@ -66,7 +66,7 @@ jobs:
# Don't care about CDN caching image URLs
DISABLE_REWRITE_ASSET_URLS: true
run: |
./script/rendered-content-link-checker.mjs \
./script/rendered-content-link-checker.js \
--language en \
--exit \
--verbose \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/orphaned-assets-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
set -e
./script/find-orphaned-assets.mjs | xargs git rm
./script/find-orphaned-assets.js | xargs git rm
# If nothing to commit, exit now. It's fine. No orphans.
git status | grep 'nothing to commit' && exit 0
Expand All @@ -58,6 +58,6 @@ jobs:
gh pr create \
--title "Delete orphaned assets ($date)" \
--body "Found with the find-orphaned-assets.mjs script" \
--body "Found with the find-orphaned-assets.js script" \
--repo github/docs-internal \
--label docs-content-fr
4 changes: 2 additions & 2 deletions .github/workflows/site-policy-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
types:
- closed
paths:
- 'content/github/site-policy/**'
- 'content/site-policy/**'
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
git config --local user.name 'site-policy-bot'
git config --local user.email 'site-policy-bot@github.com'
rm -rf Policies
cp -r ../content/github/site-policy Policies
cp -r ../content/site-policy Policies
git status
git checkout -b automated-sync-$GITHUB_RUN_ID
git add .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 60 Days Stale Check
name: Stale

# **What it does**: Pull requests older than 60 days will be flagged as stale.
# **What it does**: Close issues and pull requests after no updates for 365 days.
# **Why we have it**: We want to manage our queue of issues and pull requests.
# **Who does it impact**: Everyone that works on docs or docs-internal.

Expand All @@ -20,12 +20,12 @@ jobs:
- uses: actions/stale@3cc123766321e9f15a6676375c154ccffb12a358
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity.'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity.'
days-before-stale: 60
days-before-close: -1
only-labels: 'engineering,Triaged,Improve existing docs,Core,Ecosystem'
stale-issue-message: 'This issue is stale because there have been no updates in 365 days.'
stale-pr-message: 'This PR is stale because there have been no updates in 365 days.'
days-before-stale: 365
days-before-close: 0
stale-issue-label: 'stale'
stale-pr-label: 'stale'
exempt-pr-labels: 'never-stale,waiting for review'
exempt-issue-labels: 'never-stale,help wanted,waiting for review'
operations-per-run: 1000
119 changes: 119 additions & 0 deletions .github/workflows/sync-search-elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Sync search Elasticsearch

# **What it does**: It scrapes the whole site and dumps the records in a
# temp directory. Then it indexes that into Elasticsearch.
# **Why we have it**: We want our search indexes kept up to date.
# **Who does it impact**: Anyone using search on docs.

on:
workflow_dispatch:
schedule:
- cron: '23 */4 * * *' # Run every 4 hours at 23 minutes past the hour

permissions:
contents: read

env:
FREEZE: ${{ secrets.FREEZE }}
ELASTICSEARCH_URL: ${{ secrets.ELASTICSEARCH_URL }}

jobs:
updateElasticsearchIndexes:
name: Update indexes
if: ${{ github.repository == 'github/docs-internal' }}
runs-on: ubuntu-20.04-xl
strategy:
fail-fast: false
matrix:
# This needs to match the languages we support
language: [en, ja, es, pt, cn]
steps:
- if: ${{ env.FREEZE == 'true' }}
run: |
echo 'The repo is currently frozen! Exiting this workflow.'
exit 1 # prevents further steps from running
- name: Check out repo
uses: actions/checkout@dcd71f646680f2efd8db4afa5ad64fdcba30e748

# TEMPORARY UNTIL WE HAVE A PRODUCTION ELASTICSEARCH
- uses: getong/elasticsearch-action@95b501ab0c83dee0aac7c39b7cea3723bef14954
with:
elasticsearch version: '7.17.5'
host port: 9200
container port: 9200
host node port: 9300
node port: 9300
discovery type: 'single-node'
# END TEMPORARY

- name: Setup Node
uses: actions/setup-node@17f8bd926464a1afa4c6a11669539e9c1ba77048
with:
node-version: '16.15.0'
cache: npm

- name: Install dependencies
run: npm ci

- name: Cache nextjs build
uses: actions/cache@48af2dc4a9e8278b89d7fa154b955c30c6aaab09
with:
path: .next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('package*.json') }}

- name: Run build scripts
run: npm run build

- name: Start the server in the background
env:
ENABLE_DEV_LOGGING: false
run: |
npm run sync-search-server > /tmp/stdout.log 2> /tmp/stderr.log &
# first sleep to give it a chance to start
sleep 6
curl --retry-connrefused --retry 4 -I http://localhost:4002/
- if: ${{ failure() }}
name: Debug server outputs on errors
run: |
echo "____STDOUT____"
cat /tmp/stdout.log
echo "____STDERR____"
cat /tmp/stderr.log
- name: Scrape records into a temp directory
env:
# If a reusable, or anything in the `data/*` directory is deleted
# you might get a
#
# RenderError: Can't find the key 'site.data.reusables...' in the scope
#
# But that'll get fixed in the next translation pipeline. For now,
# let's just accept an empty string instead.
THROW_ON_EMPTY: false

run: |
mkdir /tmp/records
npm run sync-search-indices -- \
-l ${{ matrix.language }} \
-o /tmp/records \
--no-compression --no-lunr-index
ls -lh /tmp/records
- name: Check that Elasticsearch is accessible
run: |
curl --fail --retry-connrefused --retry 5 -I ${{ env.ELASTICSEARCH_URL }}
- name: Index into Elasticsearch
run: |
./script/search/index-elasticsearch.js \
--language ${{ matrix.language }} \
--source-directory /tmp/records
- name: Check created indexes and aliases
run: |
curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v
curl --fail --retry-connrefused --retry 5 ${{ env.ELASTICSEARCH_URL }}/_cat/indices?v
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ENV NODE_ENV production
# Whether to hide iframes, add warnings to external links
ENV AIRGAP false

# Preferred port for server.mjs
# Preferred port for server.js
ENV PORT 4000

ENV ENABLED_LANGUAGES "en"
Expand All @@ -94,12 +94,12 @@ COPY --chown=node:node middleware ./middleware
COPY --chown=node:node feature-flags.json ./
COPY --chown=node:node data ./data
COPY --chown=node:node next.config.js ./
COPY --chown=node:node server.mjs ./server.mjs
COPY --chown=node:node start-server.mjs ./start-server.mjs
COPY --chown=node:node server.js ./server.js
COPY --chown=node:node start-server.js ./start-server.js

EXPOSE $PORT

CMD ["node", "server.mjs"]
CMD ["node", "server.js"]

# --------------------------------------------------------------------------------
# PRODUCTION IMAGE - includes all translations
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how t

We accept different [types of contributions](https://github.com/github/docs/blob/main/contributing/types-of-contributions.md), including some that don't require you to write a single line of code.

On the GitHub Docs site, you can click the make a contribution button to open a pull request for quick fixes like typos, updates, or link fixes.
On the GitHub Docs site, you can click the make a contribution button at the bottom of the page to open a pull request for quick fixes like typos, updates, or link fixes.

<img src="./assets/images/contribution_cta.png" width="400">

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/codespaces/prebuilds-choose-branch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/codespaces/prebuilds-see-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/codespaces/prebuilds-set-up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/discussions/edit-category-details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/help/issues/migrate-menu-item.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/help/issues/migrate-option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/help/issues/migrate-to-beta.png
Diff not rendered.
Binary file removed assets/images/help/issues/project_side_bar.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file modified assets/images/help/issues/projects-classic-org.png
Binary file modified assets/images/help/issues/projects-classic-user.png
Diff not rendered.
Binary file modified assets/images/help/organizations/pinned_repo_dialog.png
Binary file added assets/images/help/pages/unpublish-site.png
Binary file added assets/images/help/projects-v2/access-invite.png
Binary file added assets/images/help/projects-v2/access-role.png
Binary file added assets/images/help/projects-v2/access-search.png
Binary file added assets/images/help/projects-v2/add-bulk-save.png
Binary file added assets/images/help/projects-v2/add-item.png
Binary file added assets/images/help/projects-v2/add-iteration.png
Binary file added assets/images/help/projects-v2/add-to-repo.png
Binary file added assets/images/help/projects-v2/base-role.png
Binary file added assets/images/help/projects-v2/delete-field.png
Binary file added assets/images/help/projects-v2/delete-view.png
Binary file added assets/images/help/projects-v2/duplicate-view.png
Binary file added assets/images/help/projects-v2/edit-readme.png
Binary file added assets/images/help/projects-v2/field-options.png
Binary file added assets/images/help/projects-v2/field-rename.png
Binary file added assets/images/help/projects-v2/group-menu.png
Binary file added assets/images/help/projects-v2/insights-group.png
Binary file added assets/images/help/projects-v2/insights-save.png
Binary file added assets/images/help/projects-v2/iteration-date.png
Binary file added assets/images/help/projects-v2/iteration-save.png
Binary file added assets/images/help/projects-v2/manage-access.png
Binary file added assets/images/help/projects-v2/new-field-date.png
Binary file added assets/images/help/projects-v2/new-field-save.png
Binary file added assets/images/help/projects-v2/new-field-text.png
Binary file added assets/images/help/projects-v2/new-view.png
Binary file added assets/images/help/projects-v2/no-grouping.png
Binary file added assets/images/help/projects-v2/no-sorting.png
Binary file added assets/images/help/projects-v2/omnibar-add.png
Binary file added assets/images/help/projects-v2/open-menu.png
Binary file added assets/images/help/projects-v2/rename-view.png
Binary file added assets/images/help/projects-v2/repo-tab.png
Binary file added assets/images/help/projects-v2/save-options.png
Binary file added assets/images/help/projects-v2/save-view.png
Binary file added assets/images/help/projects-v2/sort-menu-item.png
Binary file added assets/images/help/projects-v2/sort-menu.png
Binary file added assets/images/help/projects-v2/sort-order.png
Binary file added assets/images/help/projects-v2/tab-projects.png
Binary file added assets/images/help/projects-v2/table-or-board.png
Binary file added assets/images/help/projects-v2/view-menu-icon.png
Binary file added assets/images/help/projects-v2/visibility.png
Binary file added assets/images/help/projects-v2/workflow-set.png
Binary file added assets/images/help/projects-v2/workflow-when.png
Binary file modified assets/images/help/repository/repo-actions-settings.png
9 changes: 6 additions & 3 deletions components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useMainContext } from './context/MainContext'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { useQuery } from 'components/hooks/useQuery'
import { Link } from 'components/Link'
import { useLanguages } from './context/LanguagesContext'
import { useSession } from 'components/lib/get-session'

import styles from './Search.module.scss'

Expand Down Expand Up @@ -46,13 +46,16 @@ export function Search({
const inputRef = useRef<HTMLInputElement>(null)
const { t } = useTranslation('search')
const { currentVersion } = useVersion()
const { languages } = useLanguages()
const session = useSession()
const languages = session?.languages

// Figure out language and version for index
const { searchVersions, nonEnterpriseDefaultVersion } = useMainContext()
// fall back to the non-enterprise default version (FPT currently) on the homepage, 404 page, etc.
const version = searchVersions[currentVersion] || searchVersions[nonEnterpriseDefaultVersion]
const language = (Object.keys(languages).includes(router.locale || '') && router.locale) || 'en'
const language = languages
? (Object.keys(languages).includes(router.locale || '') && router.locale) || 'en'
: 'en'

const fetchURL = query
? `/search?${new URLSearchParams({
Expand Down
7 changes: 2 additions & 5 deletions components/article/ArticlePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ const interactiveAlternatives: Record<string, { href: string }> = {
href: '/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces?langId=py',
},
}
type Props = {
children?: React.ReactNode
}

export const ArticlePage = ({ children }: Props) => {
export const ArticlePage = () => {
const { asPath } = useRouter()
const {
title,
Expand Down Expand Up @@ -145,7 +142,7 @@ export const ArticlePage = ({ children }: Props) => {
}
>
<div id="article-contents">
<MarkdownContent>{children || renderedPage}</MarkdownContent>
<MarkdownContent>{renderedPage}</MarkdownContent>
{effectiveDate && (
<div className="mt-4" id="effectiveDate">
Effective as of:{' '}
Expand Down
Loading

0 comments on commit c638500

Please sign in to comment.