Skip to content

Commit 891d09f

Browse files
authored
CLOUDP-317123 change markup for code blocks in Atlas CLI generated docs (#4006)
1 parent d019f94 commit 891d09f

File tree

641 files changed

+1617
-2580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

641 files changed

+1617
-2580
lines changed

.github/workflows/code-health.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,25 @@ jobs:
268268
with:
269269
config: ${{ vars.PERMISSIONS_CONFIG }}
270270
- uses: actions/checkout@v4
271+
- name: Install ShellCheck
272+
run: |
273+
sudo apt-get update
274+
sudo apt-get install -y shellcheck
271275
- name: Run ShellCheck
272-
uses: bewuethr/shellcheck-action@d01912909579c4b1a335828b8fca197fbb8e0aa4
276+
run: |
277+
# Find all shell scripts excluding specific patterns or directories
278+
# Add exclusions by adding more -not -path patterns as needed
279+
find . -name "*.sh" \
280+
-not -path "./.git/*" \
281+
-not -path "./docs/*" \
282+
-print0 | xargs -0 shellcheck --format=gcc
283+
284+
# Also check for shell scripts without .sh extension
285+
find . -type f -exec grep -l '^#!/bin/\(ba\)\?sh' {} \; \
286+
| grep -v '\.sh$' \
287+
| grep -v './.git/' \
288+
| grep -v './docs/' \
289+
| xargs -r shellcheck --format=gcc
273290
tidy:
274291
runs-on: ubuntu-latest
275292
steps:

build/ci/check-licenses.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ find_files() {
2020
find . -not \( \
2121
\( \
2222
-wholename '*mock*' \
23+
-o -wholename '*docs*' \
2324
-o -wholename '*third_party*' \
2425
\) -prune \
2526
\) \

build/ci/copy.bara.sky.template

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ core.workflow(
2323
integrates = [],
2424
),
2525
origin_files = glob(["docs/command/**"], exclude = ["docs/command/atlas-completion**"]),
26-
destination_files = glob(["source/includes/command/**"], exclude=["source/includes/command/atlas-kubernetes**"]),
26+
destination_files = glob(["source/includes/command/**" ,"source/includes/examples/**"], exclude=["source/includes/command/atlas-kubernetes**"]),
2727
authoring = authoring.pass_thru(author),
2828
transformations = [
29+
core.move("docs/command/includes", "source/includes/examples"),
2930
core.move("docs/command", "source/includes/command"),
3031
core.rename(".txt", ".rst", suffix = True)
3132
],
@@ -46,9 +47,10 @@ core.workflow(
4647
integrates = [],
4748
),
4849
origin_files = glob(["docs/command/**"]),
49-
destination_files = glob(["content/atlas-cli/current/source/command/**"], exclude=["content/atlas-cli/current/source/command/atlas-api", "content/atlas-cli/current/source/command/atlas-kubernetes**"]),
50+
destination_files = glob(["content/atlas-cli/current/source/command/**", "content/atlas-cli/current/source/includes/examples/**"], exclude=["content/atlas-cli/current/source/command/atlas-api", "content/atlas-cli/current/source/command/atlas-kubernetes**"]),
5051
authoring = authoring.pass_thru(author),
5152
transformations = [
53+
core.move("docs/command/includes", "content/atlas-cli/current/source/includes/examples"),
5254
core.move("docs/command", "content/atlas-cli/current/source/command"),
5355
],
5456
)

build/ci/evergreen.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,15 @@ functions:
499499
shell: bash
500500
script: |
501501
set -Eeou pipefail
502+
if [[ -z "${triggered_by_git_tag}" ]]; then
503+
REF="${github_commit}"
504+
else
505+
REF="${triggered_by_git_tag}"
506+
fi
502507
cat <<EOF > expansions.yaml
503508
home: $HOME
504509
tag: $(git tag --list 'atlascli/v*' --sort=-taggerdate | head -1)
510+
ref: $REF
505511
version: $(git tag --list 'atlascli/v*' --sort=-taggerdate | head -1 | cut -d 'v' -f 2)
506512
EOF
507513
- command: expansions.update

build/ci/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ functions:
323323
<<: *go_options
324324
env:
325325
<<: *go_env
326-
TAG: ${tag}
326+
TAG: ${ref}
327327
GH_TOKEN: ${gh_token}
328328
WORKFLOW: ${workflow}
329329
EVERGREEN_USER: ${evergreen_user}
@@ -529,7 +529,10 @@ buildvariants:
529529
- name: package_goreleaser
530530
- name: copybara
531531
display_name: "Copybara"
532-
git_tag_only: true
532+
depends_on:
533+
- name: package_goreleaser
534+
variant: release_atlascli_github
535+
patch_optional: true
533536
tags:
534537
- foliage_health
535538
run_on:

build/ci/run-copybara.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,18 @@ docker run \
6565
-v "${PWD}/.gitconfig:/root/.gitconfig" \
6666
-v "${PWD}/.git-credentials:/root/.git-credentials" \
6767
-e "COPYBARA_WORKFLOW=$WORKFLOW" \
68-
-e "COPYBARA_OPTIONS=--github-api-bearer-auth true" \
68+
-e "COPYBARA_OPTIONS=--github-api-bearer-auth true --force" \
6969
google/copybara
7070

7171
PR_URL=$(docker logs copybara-container 2>&1 | grep "/pull/" | sed -E 's/^.*(https\:[^\ ]+).*$/\1/')
7272

7373
rm -rf .git-credentials .gitconfig copy.bara.sky
7474
docker rm -f copybara-container
7575

76+
echo "Created PR: $PR_URL"
77+
7678
TARGET="$DOCS_SLACK_CHANNEL"
7779
MSG="Hey team :wave: ${PR_URL} is ready for review :thankyou:"
78-
echo "{\"target\":\"$TARGET\",\"msg\":\"$MSG\"}"
7980
curl --header "Api-User:${EVERGREEN_USER:?}" \
8081
--header "Api-Key:${EVERGREEN_API_KEY:?}" \
8182
--request POST "https://evergreen.mongodb.com/rest/v2/notifications/slack" \

docs/command/atlas-api-accessTracking-listAccessLogsByClusterName.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,5 @@ Inherited Options
120120
Examples
121121
--------
122122

123-
.. code-block::
124-
125-
atlas api accessTracking listAccessLogsByClusterName --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8
126-
127-
.. Code end marker, please don't delete this comment
128-
123+
.. literalinclude:: /includes/examples/atlas-api-accessTracking-listAccessLogsByClusterName-2023-01-01-default.sh
124+
:language: shell

docs/command/atlas-api-accessTracking-listAccessLogsByHostname.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,5 @@ Inherited Options
120120
Examples
121121
--------
122122

123-
.. code-block::
124-
125-
atlas api accessTracking listAccessLogsByHostname --version 2023-01-01 --groupId 32b6e34b3d91647abb20e7b8 --hostname [hostname]
126-
127-
.. Code end marker, please don't delete this comment
128-
123+
.. literalinclude:: /includes/examples/atlas-api-accessTracking-listAccessLogsByHostname-2023-01-01-default.sh
124+
:language: shell

docs/command/atlas-api-alertConfigurations-deleteAlertConfiguration.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,5 @@ Inherited Options
103103
Examples
104104
--------
105105

106-
.. code-block::
107-
108-
atlas api alertConfigurations deleteAlertConfiguration --version 2023-01-01 --alertConfigId 32b6e34b3d91647abb20e7b8 --groupId 32b6e34b3d91647abb20e7b8
109-
110-
.. Code end marker, please don't delete this comment
111-
106+
.. literalinclude:: /includes/examples/atlas-api-alertConfigurations-deleteAlertConfiguration-2023-01-01-default.sh
107+
:language: shell

docs/command/atlas-api-alertConfigurations-getAlertConfiguration.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,5 @@ Inherited Options
103103
Examples
104104
--------
105105

106-
.. code-block::
107-
108-
atlas api alertConfigurations getAlertConfiguration --version 2023-01-01 --alertConfigId 32b6e34b3d91647abb20e7b8 --groupId 32b6e34b3d91647abb20e7b8
109-
110-
.. Code end marker, please don't delete this comment
111-
106+
.. literalinclude:: /includes/examples/atlas-api-alertConfigurations-getAlertConfiguration-2023-01-01-default.sh
107+
:language: shell

docs/command/atlas-api-alertConfigurations-listAlertConfigurations.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,5 @@ Inherited Options
111111
Examples
112112
--------
113113

114-
.. code-block::
115-
116-
atlas api alertConfigurations listAlertConfigurations --version 2023-01-01 --groupId 32b6e34b3d91647abb20e7b8
117-
118-
.. Code end marker, please don't delete this comment
119-
114+
.. literalinclude:: /includes/examples/atlas-api-alertConfigurations-listAlertConfigurations-2023-01-01-default.sh
115+
:language: shell

docs/command/atlas-api-alertConfigurations-listAlertConfigurationsByAlertId.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,5 @@ Inherited Options
115115
Examples
116116
--------
117117

118-
.. code-block::
119-
120-
atlas api alertConfigurations listAlertConfigurationsByAlertId --version 2023-01-01 --alertId [alertId] --groupId 32b6e34b3d91647abb20e7b8
121-
122-
.. Code end marker, please don't delete this comment
123-
118+
.. literalinclude:: /includes/examples/atlas-api-alertConfigurations-listAlertConfigurationsByAlertId-2023-01-01-default.sh
119+
:language: shell

docs/command/atlas-api-alerts-getAlert.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,5 @@ Inherited Options
103103
Examples
104104
--------
105105

106-
.. code-block::
107-
108-
atlas api alerts getAlert --version 2023-01-01 --alertId [alertId] --groupId 32b6e34b3d91647abb20e7b8
109-
110-
.. Code end marker, please don't delete this comment
111-
106+
.. literalinclude:: /includes/examples/atlas-api-alerts-getAlert-2023-01-01-default.sh
107+
:language: shell

docs/command/atlas-api-alerts-listAlerts.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,5 @@ Inherited Options
115115
Examples
116116
--------
117117

118-
.. code-block::
119-
120-
atlas api alerts listAlerts --version 2023-01-01 --groupId 32b6e34b3d91647abb20e7b8
121-
122-
.. Code end marker, please don't delete this comment
123-
118+
.. literalinclude:: /includes/examples/atlas-api-alerts-listAlerts-2023-01-01-default.sh
119+
:language: shell

docs/command/atlas-api-alerts-listAlertsByAlertConfigurationId.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,5 @@ Inherited Options
115115
Examples
116116
--------
117117

118-
.. code-block::
119-
120-
atlas api alerts listAlertsByAlertConfigurationId --version 2023-01-01 --alertConfigId 32b6e34b3d91647abb20e7b8 --groupId 32b6e34b3d91647abb20e7b8
121-
122-
.. Code end marker, please don't delete this comment
123-
118+
.. literalinclude:: /includes/examples/atlas-api-alerts-listAlertsByAlertConfigurationId-2023-01-01-default.sh
119+
:language: shell

docs/command/atlas-api-atlasSearch-deleteAtlasSearchDeployment.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,5 @@ Inherited Options
106106
Examples
107107
--------
108108

109-
.. code-block::
110-
111-
atlas api atlasSearch deleteAtlasSearchDeployment --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8
112-
113-
.. Code end marker, please don't delete this comment
114-
109+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-deleteAtlasSearchDeployment-2023-01-01-default.sh
110+
:language: shell

docs/command/atlas-api-atlasSearch-deleteAtlasSearchIndex.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@ Inherited Options
104104
Examples
105105
--------
106106

107-
.. code-block::
108-
109-
atlas api atlasSearch deleteAtlasSearchIndex --version 2024-05-30 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8 --indexId [indexId]
110-
111-
.. Code end marker, please don't delete this comment
112-
107+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-deleteAtlasSearchIndex-2024-05-30-default.sh
108+
:language: shell

docs/command/atlas-api-atlasSearch-deleteAtlasSearchIndexByName.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,5 @@ Inherited Options
112112
Examples
113113
--------
114114

115-
.. code-block::
116-
117-
atlas api atlasSearch deleteAtlasSearchIndexByName --version 2024-05-30 --clusterName [clusterName] --collectionName [collectionName] --databaseName [databaseName] --groupId 32b6e34b3d91647abb20e7b8 --indexName [indexName]
118-
119-
.. Code end marker, please don't delete this comment
120-
115+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-deleteAtlasSearchIndexByName-2024-05-30-default.sh
116+
:language: shell

docs/command/atlas-api-atlasSearch-deleteAtlasSearchIndexDeprecated.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@ Inherited Options
104104
Examples
105105
--------
106106

107-
.. code-block::
108-
109-
atlas api atlasSearch deleteAtlasSearchIndexDeprecated --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8 --indexId [indexId]
110-
111-
.. Code end marker, please don't delete this comment
112-
107+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-deleteAtlasSearchIndexDeprecated-2023-01-01-default.sh
108+
:language: shell

docs/command/atlas-api-atlasSearch-getAtlasSearchDeployment.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,5 @@ Inherited Options
9898
Examples
9999
--------
100100

101-
.. code-block::
102-
103-
atlas api atlasSearch getAtlasSearchDeployment --version 2025-03-12 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8
104-
105-
.. Code end marker, please don't delete this comment
106-
101+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-getAtlasSearchDeployment-2025-03-12-default.sh
102+
:language: shell

docs/command/atlas-api-atlasSearch-getAtlasSearchIndex.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@ Inherited Options
104104
Examples
105105
--------
106106

107-
.. code-block::
108-
109-
atlas api atlasSearch getAtlasSearchIndex --version 2024-05-30 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8 --indexId [indexId]
110-
111-
.. Code end marker, please don't delete this comment
112-
107+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-getAtlasSearchIndex-2024-05-30-default.sh
108+
:language: shell

docs/command/atlas-api-atlasSearch-getAtlasSearchIndexByName.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,5 @@ Inherited Options
112112
Examples
113113
--------
114114

115-
.. code-block::
116-
117-
atlas api atlasSearch getAtlasSearchIndexByName --version 2024-05-30 --clusterName [clusterName] --collectionName [collectionName] --databaseName [databaseName] --groupId 32b6e34b3d91647abb20e7b8 --indexName [indexName]
118-
119-
.. Code end marker, please don't delete this comment
120-
115+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-getAtlasSearchIndexByName-2024-05-30-default.sh
116+
:language: shell

docs/command/atlas-api-atlasSearch-getAtlasSearchIndexDeprecated.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@ Inherited Options
104104
Examples
105105
--------
106106

107-
.. code-block::
108-
109-
atlas api atlasSearch getAtlasSearchIndexDeprecated --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8 --indexId [indexId]
110-
111-
.. Code end marker, please don't delete this comment
112-
107+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-getAtlasSearchIndexDeprecated-2023-01-01-default.sh
108+
:language: shell

docs/command/atlas-api-atlasSearch-listAtlasSearchIndexes.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,5 @@ Inherited Options
108108
Examples
109109
--------
110110

111-
.. code-block::
112-
113-
atlas api atlasSearch listAtlasSearchIndexes --version 2024-05-30 --clusterName [clusterName] --collectionName [collectionName] --databaseName [databaseName] --groupId 32b6e34b3d91647abb20e7b8
114-
115-
.. Code end marker, please don't delete this comment
116-
111+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-listAtlasSearchIndexes-2024-05-30-default.sh
112+
:language: shell

docs/command/atlas-api-atlasSearch-listAtlasSearchIndexesCluster.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,5 @@ Inherited Options
100100
Examples
101101
--------
102102

103-
.. code-block::
104-
105-
atlas api atlasSearch listAtlasSearchIndexesCluster --version 2024-05-30 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8
106-
107-
.. Code end marker, please don't delete this comment
108-
103+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-listAtlasSearchIndexesCluster-2024-05-30-default.sh
104+
:language: shell

docs/command/atlas-api-atlasSearch-listAtlasSearchIndexesDeprecated.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,5 @@ Inherited Options
108108
Examples
109109
--------
110110

111-
.. code-block::
112-
113-
atlas api atlasSearch listAtlasSearchIndexesDeprecated --version 2023-01-01 --clusterName [clusterName] --collectionName [collectionName] --databaseName [databaseName] --groupId 32b6e34b3d91647abb20e7b8
114-
115-
.. Code end marker, please don't delete this comment
116-
111+
.. literalinclude:: /includes/examples/atlas-api-atlasSearch-listAtlasSearchIndexesDeprecated-2023-01-01-default.sh
112+
:language: shell

docs/command/atlas-api-auditing-getAuditingConfiguration.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,5 @@ Inherited Options
9696
Examples
9797
--------
9898

99-
.. code-block::
100-
101-
atlas api auditing getAuditingConfiguration --version 2023-01-01 --groupId 32b6e34b3d91647abb20e7b8
102-
103-
.. Code end marker, please don't delete this comment
104-
99+
.. literalinclude:: /includes/examples/atlas-api-auditing-getAuditingConfiguration-2023-01-01-default.sh
100+
:language: shell

docs/command/atlas-api-awsClustersDns-getAwsCustomDns.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,5 @@ Inherited Options
9696
Examples
9797
--------
9898

99-
.. code-block::
100-
101-
atlas api awsClustersDns getAwsCustomDns --version 2023-01-01 --groupId 32b6e34b3d91647abb20e7b8
102-
103-
.. Code end marker, please don't delete this comment
104-
99+
.. literalinclude:: /includes/examples/atlas-api-awsClustersDns-getAwsCustomDns-2023-01-01-default.sh
100+
:language: shell

docs/command/atlas-api-cloudBackups-cancelBackupRestoreJob.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@ Inherited Options
104104
Examples
105105
--------
106106

107-
.. code-block::
108-
109-
atlas api cloudBackups cancelBackupRestoreJob --version 2023-01-01 --clusterName [clusterName] --groupId 32b6e34b3d91647abb20e7b8 --restoreJobId [restoreJobId]
110-
111-
.. Code end marker, please don't delete this comment
112-
107+
.. literalinclude:: /includes/examples/atlas-api-cloudBackups-cancelBackupRestoreJob-2023-01-01-default.sh
108+
:language: shell

0 commit comments

Comments
 (0)