Skip to content

Commit 7d67507

Browse files
authored
Merge branch 'master' into clarify-IdP-support
2 parents 8253ddf + 63bc870 commit 7d67507

File tree

211 files changed

+13291
-12255
lines changed

Some content is hidden

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

211 files changed

+13291
-12255
lines changed

.ci/remark-lint/yarn.lock

Lines changed: 333 additions & 365 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extends: substitution
2+
message: Did you mean '%s' instead of '%s'
3+
level: warning
4+
ignorecase: false
5+
# swap maps tokens in form of bad: good
6+
# NOTE: The left-hand (bad) side can match the right-hand (good) side;
7+
# Vale ignores alerts that match the intended form.
8+
swap:
9+
'cloud-serverless|cloud-dedicated|clustered': core
10+
'Cloud Serverless|Cloud Dedicated|Clustered': Core
11+
'API token': database token
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: substitution
2+
message: Did you mean '%s' instead of '%s'
3+
level: warning
4+
ignorecase: false
5+
# swap maps tokens in form of bad: good
6+
# NOTE: The left-hand (bad) side can match the right-hand (good) side;
7+
# Vale ignores alerts that match the intended form.
8+
swap:
9+
'(?i)bucket': database
10+
'(?i)measurement': table

.frontmatter-schema.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"title": {
6+
"type": "string",
7+
"description": "Title of the page"
8+
},
9+
"description": {
10+
"type": "string",
11+
"description": "Page description that supports multi-line text"
12+
},
13+
"menu": {
14+
"type": "object",
15+
"properties": {
16+
"influxdb3_core": {
17+
"type": "object",
18+
"properties": {
19+
"name": {
20+
"type": "string",
21+
"description": "Menu item name"
22+
}
23+
},
24+
"required": ["name"]
25+
}
26+
}
27+
},
28+
"weight": {
29+
"type": "integer",
30+
"description": "Order weight for menu items",
31+
"minimum": 0
32+
},
33+
"source": {
34+
"type": "string",
35+
"description": "Path to source content file",
36+
"pattern": "^/shared/.+\\.md$"
37+
}
38+
},
39+
"required": ["title", "description", "menu", "weight"]
40+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ node_modules
88
*.log
99
/resources
1010
.hugo_build.lock
11-
/content/influxdb/*/api/**/*.html
11+
/content/influxdb*/**/api/**/*.html
1212
/api-docs/redoc-static.html*
1313
.vscode/*
1414
.idea

.vscode/settings.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
{
2-
"vale.valeCLI.config": " \"${workspaceFolder}/.vale.ini\"",
2+
"commentAnchors.tags.anchors":
3+
{ "SOURCE": {
4+
"scope": "file",
5+
"behavior": "link",
6+
"iconColor": "#FF0000",
7+
"highlightColor": "#FF0000",
8+
"style": "bold"
9+
}},
10+
"commentAnchors.workspace.matchFiles": "**/*.{md,ini,json,yaml,yml}",
11+
"commentAnchors.workspace.enabled": true,
12+
"yaml.schemas": {
13+
"./.frontmatter-schema.json": "${workspaceFolder}/content/**/*.md"
14+
},
15+
"vale.valeCLI.config": "${workspaceFolder}/.vale.ini",
316
"vale.valeCLI.minAlertLevel": "warning",
417
}

CONTRIBUTING.md

Lines changed: 70 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,22 @@ To install dependencies listed in package.json:
4545
3. Run `yarn` to install dependencies (including Hugo).
4646
4. Install the Yarn package manager and run `yarn` to install project dependencies.
4747

48-
`package.json` contains dependencies for linting and running Git hooks.
48+
`package.json` contains dependencies used in `/assets/js` JavaScript code and
49+
dev dependencies used in pre-commit hooks for linting, syntax-checking, and testing.
4950

50-
- **[husky](https://github.com/typicode/husky)**: manages Git hooks, including the pre-commit hook for linting and testing
51-
- **[lint-staged](https://github.com/lint-staged/lint-staged)**: passes staged files to commands
52-
- **[prettier](https://prettier.io/docs/en/)**: formats code, including Markdown, according to style rules for consistency
51+
Dev dependencies include:
5352

54-
### Install Docker
53+
- [Lefthook](https://github.com/evilmartians/lefthook): configures and
54+
manages pre-commit hooks for linting and testing Markdown content.
55+
- [prettier](https://prettier.io/docs/en/): formats code, including Markdown, according to style rules for consistency
56+
- [Cypress]: e2e testing for UI elements and URLs in content
5557

56-
Install [Docker](https://docs.docker.com/get-docker/) for your system.
58+
### Install Docker
5759

5860
docs-v2 includes Docker configurations (`compose.yaml` and Dockerfiles) for running the Vale style linter and tests for code blocks (Shell, Bash, and Python) in Markdown files.
5961

62+
Install [Docker](https://docs.docker.com/get-docker/) for your system.
63+
6064
#### Build the test dependency image
6165

6266
After you have installed Docker, run the following command to build the test
@@ -65,13 +69,24 @@ The tests defined in `compose.yaml` use the dependencies and execution
6569
environment from this image.
6670

6771
```bash
68-
docker build -t influxdata:docs-pytest -f Dockerfile.pytest .
72+
docker build -t influxdata/docs-pytest:latest -f Dockerfile.pytest .
6973
```
7074

7175
### Run the documentation locally (optional)
7276

7377
To run the documentation locally, follow the instructions provided in the README.
7478

79+
### Install Visual Studio Code extensions
80+
81+
If you use Microsoft Visual Studio (VS) Code, you can install extensions
82+
to help you navigate, check, and edit files.
83+
84+
docs-v2 contains a `./.vscode/settings.json` that configures the following extensions:
85+
86+
- Comment Anchors: recognizes tags (for example, `//SOURCE`) and makes links and filepaths clickable in comments.
87+
- Vale: shows linter errors and suggestions in the editor.
88+
- YAML Schemas: validates frontmatter attributes.
89+
7590
### Make your changes
7691

7792
Make your suggested changes being sure to follow the [style and formatting guidelines](#style--formatting) outline below.
@@ -80,29 +95,31 @@ Make your suggested changes being sure to follow the [style and formatting guide
8095

8196
### Automatic pre-commit checks
8297

83-
docs-v2 uses Husky to manage Git hook scripts.
84-
When you try to commit your changes (for example, `git commit`), Git runs
85-
scripts configured in `.husky/pre-commit`, including linting and tests for your **staged** files.
98+
docs-v2 uses Lefthook to manage Git hooks, such as pre-commit hooks that lint Markdown and test code blocks.
99+
When you try to commit changes (`git commit`), Git runs
100+
the commands configured in `lefthook.yml` which pass your **staged** files to Vale,
101+
Prettier, Cypress (for UI tests and link-checking), and Pytest (for testing Python and shell code in code blocks).
86102

87103
### Skip pre-commit hooks
88104

89105
**We strongly recommend running linting and tests**, but you can skip them
90106
(and avoid installing dependencies)
91-
by including the `HUSKY=0` environment variable or the `--no-verify` flag with
107+
by including the `LEFTHOOK=0` environment variable or the `--no-verify` flag with
92108
your commit--for example:
93109

94110
```sh
95111
git commit -m "<COMMIT_MESSAGE>" --no-verify
96112
```
97113

98114
```sh
99-
HUSKY=0 git commit
115+
LEFTHOOK=0 git commit
100116
```
101117

102-
For more options, see the [Husky documentation](https://typicode.github.io/husky/how-to.html#skipping-git-hooks).
103-
104118
### Set up test scripts and credentials
105119

120+
Tests for code blocks require your InfluxDB credentials and other typical
121+
InfluxDB configuration.
122+
106123
To set up your docs-v2 instance to run tests locally, do the following:
107124

108125
1. **Set executable permissions on test scripts** in `./test/src`:
@@ -118,91 +135,38 @@ To set up your docs-v2 instance to run tests locally, do the following:
118135
Cloud Dedicated instance for testing in most cases. To avoid conflicts when
119136
running tests, create separate Cloud Dedicated and Clustered databases.
120137

121-
3. **Create .env.test**: Copy the `./test/env.test.example` file into each
138+
1. **Create .env.test**: Copy the `./test/env.test.example` file into each
122139
product directory to test and rename the file as `.env.test`--for example:
123140

124141
```sh
125142
./content/influxdb/cloud-dedicated/.env.test
126143
```
127144

128-
4. Inside each product's `.env.test` file, assign your InfluxDB credentials to
129-
environment variables.
145+
2. Inside each product's `.env.test` file, assign your InfluxDB credentials to
146+
environment variables:
130147

131-
In addition to the usual `INFLUX_` environment variables, in your
132-
`cloud-dedicated/.env.test` and `clustered/.env.test` files define the
148+
- Include the usual `INFLUX_` environment variables
149+
- In
150+
`cloud-dedicated/.env.test` and `clustered/.env.test` files, also define the
133151
following variables:
134152

135-
- `ACCOUNT_ID`, `CLUSTER_ID`: You can find these values in your `influxctl`
136-
`config.toml` configuration file.
137-
- `MANAGEMENT_TOKEN`: Use the `influxctl management create` command to generate
138-
a long-lived management token to authenticate Management API requests
139-
140-
For the full list of variables you'll need to include, see the substitution
141-
patterns in `./test/src/prepare-content.sh`.
153+
- `ACCOUNT_ID`, `CLUSTER_ID`: You can find these values in your `influxctl`
154+
`config.toml` configuration file.
155+
- `MANAGEMENT_TOKEN`: Use the `influxctl management create` command to generate
156+
a long-lived management token to authenticate Management API requests
142157

143-
**Warning**: The database you configure in `.env.test` and any written data may
144-
be deleted during test runs.
145-
146-
**Warning**: To prevent accidentally adding credentials to the docs-v2 repo,
147-
Git is configured to ignore `.env*` files. Don't add your `.env.test` files to Git.
148-
Consider backing them up on your local machine in case of accidental deletion.
158+
See the substitution
159+
patterns in `./test/src/prepare-content.sh` for the full list of variables you may need to define in your `.env.test` files.
149160

150-
5. For influxctl commands to run in tests, move or copy your `config.toml` file
161+
3. For influxctl commands to run in tests, move or copy your `config.toml` file
151162
to the `./test` directory.
152163

153-
### Pre-commit linting and testing
154-
155-
When you try to commit your changes using `git commit` or your editor,
156-
the project automatically runs pre-commit checks for spelling, punctuation,
157-
and style on your staged files.
158-
159-
`.husky/pre-commit` script runs Git pre-commit hook commands, including
160-
[`lint-staged`](https://github.com/lint-staged/lint-staged).
161-
162-
The `.lintstagedrc.mjs` lint-staged configuration maps product-specific glob
163-
patterns to lint and test commands and passes a product-specific
164-
`.env.test` file to a test runner Docker container.
165-
The container then loads the `.env` file into the container's environment variables.
166-
167-
To test or troubleshoot testing and linting scripts and configurations before
168-
committing, choose from the following:
169-
170-
- To run pre-commit scripts without actually committing, append `exit 1` to the
171-
`.husky/pre-commit` script--for example:
172-
173-
```sh
174-
./test/src/monitor-tests.sh start
175-
npx lint-staged --relative
176-
./test/src/monitor-tests.sh kill
177-
exit 1
178-
```
179-
180-
And then run `git commit`.
181-
182-
The `exit 1` status fails the commit, even if all the tasks succeed.
183-
184-
- Use `yarn` to run one of the lint or test scripts configured in
185-
`package.json`--for example:
186-
187-
```sh
188-
yarn run test
189-
```
190-
191-
- Run `lint-staged` directly and specify options:
192-
193-
```sh
194-
npx lint-staged --relative --verbose
195-
```
196-
197-
The pre-commit linting configuration checks for _error-level_ problems.
198-
An error-level rule violation fails the commit and you must do one of the following before you can commit your changes:
199-
200-
- fix the reported problem in the content
201-
202-
- edit the linter rules to permanently allow the content.
203-
See **Configure style rules**.
204-
205-
- temporarily override the hook (using `git commit --no-verify`)
164+
> [!Warning]
165+
>
166+
> - The database you configure in `.env.test` and any written data may
167+
be deleted during test runs.
168+
> - Don't add your `.env.test` files to Git. To prevent accidentally adding credentials to the docs-v2 repo,
169+
Git is configured to ignore `.env*` files. Consider backing them up on your local machine in case of accidental deletion.
206170

207171
#### Test shell and python code blocks
208172

@@ -249,7 +213,7 @@ You probably don't want to display this syntax in the docs, which unfortunately
249213
means you'd need to include the test block separately from the displayed code
250214
block.
251215
To hide it from users, wrap the code block inside an HTML comment.
252-
Pytest-codeblocks will still collect and run the code block.
216+
pytest-codeblocks will still collect and run the code block.
253217

254218
##### Mark tests to skip
255219

@@ -546,6 +510,25 @@ Insert warning markdown content here.
546510
{{% /warn %}}
547511
```
548512

513+
### Product data
514+
515+
Display the full product name and version name for the current page--for example:
516+
517+
- InfluxDB 3 Core
518+
- InfluxDB 3 Cloud Dedicated
519+
520+
```md
521+
{{% product-name %}}
522+
```
523+
524+
Display the short version name (part of the key used in `products.yml`) from the current page URL--for example:
525+
526+
- `/influxdb3/core` returns `core`
527+
528+
```md
529+
{{% product-key %}}
530+
```
531+
549532
### Enterprise Content
550533

551534
For sections content that relate specifically to InfluxDB Enterprise, use the `{{% enterprise %}}` shortcode.

Dockerfile.pytest

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
3232
python3-venv \
3333
rsync \
3434
telegraf \
35-
wget
35+
wget \
36+
yq
37+
38+
# Install InfluxDB 3 Core
39+
RUN curl -O https://www.influxdata.com/d/install_influxdb3.sh \
40+
&& chmod +x install_influxdb3.sh \
41+
&& bash -c yes | ./install_influxdb3.sh
3642

3743
RUN ln -s /usr/bin/python3 /usr/bin/python
3844

api-docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ InfluxDB Cloud releases are frequent and not versioned, so the Cloud API spec is
237237
We regenerate API reference docs from `influxdata/openapi`
238238
**master** branch as features are released.
239239
240-
### InfluxDB OSS version
240+
### InfluxDB OSS v2 version
241241
242242
Given that
243243
`influxdata/openapi` **master** may contain OSS spec changes not implemented

0 commit comments

Comments
 (0)