Skip to content

Commit

Permalink
Merge branch 'master' into logan/16.4.11-bump-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
logand22 authored Dec 30, 2024
2 parents d8cee84 + 8ae5de8 commit 7f1f913
Show file tree
Hide file tree
Showing 756 changed files with 26,806 additions and 11,643 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/doc-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'gravitational/docs'
repository: 'gravitational/docs-website'
path: 'docs'

# Cache node_modules. Unlike the example in the actions/cache repo, this
Expand Down Expand Up @@ -80,30 +80,35 @@ jobs:
# use for the live docs site in that we only test a single version of
# the content.
#
# To do this, we replace the three submodules we use for building the
# live docs site with a single submodule, pointing to the
# gravitational/teleport branch we are linting.
#
# To do this, we delete the three submodules we use for building the
# live docs site and copy a gravitational/teleport clone into the
# content directory.
#
# The docs engine expects a config.json file at the root of the
# gravitational/docs clone that associates directories with git
# submodules. By default, these directories represent versioned branches
# of gravitational/teleport. We override this in order to build only a
# single version of the docs.
#
# We also replace data fetched from Sanity CMS with hardcoded JSON
# objects to remove the need to authenticate with Sanity. Each includes
# the minimal set of data required for docs builds to succeed.
run: |
echo "" > .gitmodules
rm -rf content/*
cd content
# Rather than using a submodule, copy the teleport source into the
# content directory.
cp -r $GITHUB_WORKSPACE/teleport $GITHUB_WORKSPACE/docs/content
cd $GITHUB_WORKSPACE/docs
echo "{\"versions\": [{\"name\": \"teleport\", \"branch\": \"teleport\", \"deprecated\": false}]}" > $GITHUB_WORKSPACE/docs/config.json
cat <<< "$(jq '.scripts."git-update" = "echo Skipping submodule update"' package.json)" > package.json
yarn build-node
cp -r "$GITHUB_WORKSPACE/teleport" "$GITHUB_WORKSPACE/docs/content/current"
jq -nr --arg version "current" '{"versions": [{"name": $version,"branch": $version,"deprecated": false,"isDefault": true}]}' > config.json
NEW_PACKAGE_JSON=$(jq '.scripts."git-update" = "echo Skipping submodule update"' package.json);
NEW_PACKAGE_JSON=$(jq '.scripts."prepare-sanity-data" = "echo Using pre-populated Sanity data"' <<< "$NEW_PACKAGE_JSON");
echo "$NEW_PACKAGE_JSON" > package.json;
echo "{}" > data/events.json
echo '{"bannerButtons":{"second":{"title":"LOG IN","url":"https://teleport.sh"},"first":{"title":"Support","url":"https://goteleport.com/support/"}},"navbarData":{"rightSide":{},"logo":"/favicon.svg","menu":[]}}' > data/navbar.json
- name: Check spelling
working-directory: 'docs'
run: yarn spellcheck content/teleport
run: yarn spellcheck content/current

- name: Lint docs formatting
working-directory: 'docs'
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/docs-amplify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docs Preview
on:
pull_request:
paths:
- 'docs/**'
- .github/workflows/docs-amplify.yaml
workflow_dispatch:

permissions:
pull-requests: write
id-token: write

jobs:
amplify-preview:
name: Prepare Amplify preview URL
runs-on: ubuntu-22.04-2core-arm64
environment: docs-amplify
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.IAM_ROLE }}

- name: Create Amplify preview environment
uses: gravitational/shared-workflows/tools/amplify-preview@tools/amplify-preview/v0.0.1
continue-on-error: true
with:
app_ids: ${{ vars.AMPLIFY_APP_IDS }}
create_branches: "true"
github_token: ${{ secrets.GITHUB_TOKEN }}
wait: "true"

- name: Print failure message
if: failure()
env:
ERR_TITLE: Teleport Docs preview build failed
ERR_MESSAGE: >-
Please refer to the following documentation for help: https://www.notion.so/goteleport/How-to-Amplify-deployments-162fdd3830be8096ba72efa1a49ee7bc?pvs=4
run: |
echo ::error title=$ERR_TITLE::$ERR_MESSAGE
exit 1
11 changes: 2 additions & 9 deletions .github/workflows/update-docs-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
environment: update-docs
strategy:
fail-fast: false
matrix:
webhooks:
- url_secret_name: DOCS_DEPLOY_HOOK
http_method: GET
- url_secret_name: AMPLIFY_DOCS_DEPLOY_HOOK
http_method: POST
steps:
- name: Call deployment webhook
env:
WEBHOOK_URL: ${{ secrets[matrix.webhooks.url_secret_name] }}
HTTP_METHOD: ${{ matrix.webhooks.http_method }}
WEBHOOK_URL: ${{ secrets[AMPLIFY_DOCS_DEPLOY_HOOK] }}
run: |
if curl -X "$HTTP_METHOD" --silent --fail --show-error "$WEBHOOK_URL" > /dev/null; then
if curl -X POST --silent --fail --show-error "$WEBHOOK_URL" > /dev/null; then
echo "Triggered successfully"
fi
65 changes: 0 additions & 65 deletions .github/workflows/vercel-preview.yaml

This file was deleted.

44 changes: 23 additions & 21 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,55 @@ issues:
exclude-dirs-use-default: false
exclude-rules:
- linters:
- gosimple
text: "S1002: should omit comparison to bool constant"
- gosimple
text: 'S1002: should omit comparison to bool constant'
- linters:
- revive
text: "exported: exported const"
- revive
text: 'exported: exported const'
# TODO(hugoShaka): Remove once https://github.com/dominikh/go-tools/issues/1294 is fixed
- linters:
- unused
- unused
path: 'integrations/operator/controllers/resources/(.+)_controller_test\.go'
# TODO(codingllama): Remove once we move to grpc.NewClient.
- linters: [staticcheck]
text: "grpc.Dial is deprecated"
text: 'grpc.Dial is deprecated'
- linters: [staticcheck]
text: "grpc.DialContext is deprecated"
text: 'grpc.DialContext is deprecated'
# Deprecated gRPC dial options. Related to grpc.NewClient.
- path: (client/client.go|client/proxy/client_test.go) # api/
linters: [staticcheck]
# grpc.FailOnNonTempDialError
# grpc.WithReturnConnectionError
text: "this DialOption is not supported by NewClient"
text: 'this DialOption is not supported by NewClient'
- path: lib/kube/grpc/grpc_test.go
linters: [staticcheck]
text: "grpc.WithBlock is deprecated"
text: 'grpc.WithBlock is deprecated'
- path: lib/observability/tracing/client.go
linters: [staticcheck]
text: "grpc.WithBlock is deprecated"
text: 'grpc.WithBlock is deprecated'
- path: integrations/lib/config.go
linters: [staticcheck]
text: "grpc.WithReturnConnectionError is deprecated"
text: 'grpc.WithReturnConnectionError is deprecated'
- path: lib/service/service_test.go
linters: [staticcheck]
# grpc.WithReturnConnectionError
# grpc.FailOnNonTempDialError
text: "this DialOption is not supported by NewClient"
text: 'this DialOption is not supported by NewClient'
- path: integration/client_test.go
linters: [staticcheck]
text: "grpc.WithReturnConnectionError is deprecated"
text: 'grpc.WithReturnConnectionError is deprecated'
- path: integration/integration_test.go
linters: [staticcheck]
text: "grpc.WithBlock is deprecated"
text: 'grpc.WithBlock is deprecated'
- path: lib/multiplexer/multiplexer_test.go
linters: [staticcheck]
text: "grpc.WithBlock is deprecated"
text: 'grpc.WithBlock is deprecated'
- path: provider/provider.go # integrations/terraform
linters: [staticcheck]
text: "grpc.WithReturnConnectionError is deprecated"
text: 'grpc.WithReturnConnectionError is deprecated'
- linters: [govet]
text: "non-constant format string in call to github.com/gravitational/trace."
path-except: ^e/
text: 'non-constant format string in call to github.com/gravitational/trace.'
exclude-use-default: true
max-same-issues: 0
max-issues-per-linter: 0
Expand Down Expand Up @@ -121,6 +122,7 @@ linters-settings:
files:
- '**/api/**'
- '**/e/**'
- '**/lib/srv/**'
deny:
- pkg: github.com/sirupsen/logrus
desc: 'use "log/slog" instead'
Expand All @@ -130,7 +132,7 @@ linters-settings:
client-tools:
files:
# Tests can do anything
- "!$test"
- '!$test'
- '**/tool/tbot/**'
- '**/lib/tbot/**'
- '**/tool/tctl/**'
Expand Down Expand Up @@ -158,7 +160,7 @@ linters-settings:
cgo:
files:
# Tests can do anything
- "!$test"
- '!$test'
- '**/tool/tbot/**'
- '**/lib/client/**'
- '!**/lib/integrations/**'
Expand Down Expand Up @@ -240,8 +242,8 @@ linters-settings:
require-specific: true
revive:
rules:
- name: unused-parameter
disabled: true
- name: unused-parameter
disabled: true
sloglint:
context: all
key-naming-case: snake
Expand Down
Loading

0 comments on commit 7f1f913

Please sign in to comment.