Skip to content

Commit 77a4e30

Browse files
authored
Merge branch 'master' into tc-eula
2 parents ffd9e62 + a32b566 commit 77a4e30

File tree

11 files changed

+931
-166
lines changed

11 files changed

+931
-166
lines changed
Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
---
2+
name: influxdb3-test-setup
3+
description: Set up InfluxDB 3 Core and Enterprise instances for running documentation code block tests. Handles service initialization, worktree-specific databases, and test environment configuration.
4+
author: InfluxData
5+
version: "1.0"
6+
---
7+
8+
# InfluxDB 3 Test Setup Skill
9+
10+
## Purpose
11+
12+
This skill guides agents through setting up InfluxDB 3 Core and Enterprise instances for testing documentation code blocks. It covers service initialization, creating worktree-specific databases for test isolation, and configuring the test environment.
13+
14+
## Architecture Overview
15+
16+
```
17+
~/influxdata-docs/.influxdb3/ # Shared across all worktrees
18+
├── enterprise/
19+
│ ├── .env # License email (INFLUXDB3_ENTERPRISE_LICENSE_EMAIL)
20+
│ └── data/ # Enterprise data (persists license)
21+
└── plugins/ # Shared plugins
22+
23+
<worktree>/test/.influxdb3/ # Per-worktree (gitignored)
24+
├── core/
25+
│ ├── .token # Core auth token
26+
│ ├── data/ # Core data
27+
│ └── plugins/ # Custom plugins
28+
└── .env.test # Test credentials
29+
```
30+
31+
**Key Design Decisions:**
32+
33+
- **Core**: Per-worktree instance (port 8282) - data isolated to worktree
34+
- **Enterprise**: Shared instance (port 8181) - license persists across worktrees
35+
- **Databases**: Create worktree-named databases for test isolation on shared Enterprise
36+
37+
## Quick Reference
38+
39+
| Task | Command |
40+
| ----------------------- | ---------------------------------------------------------------------- |
41+
| Initialize Core | `./test/scripts/init-influxdb3.sh core` |
42+
| Initialize Enterprise | `./test/scripts/init-influxdb3.sh enterprise` |
43+
| Initialize both | `./test/scripts/init-influxdb3.sh all` |
44+
| Check Core status | `curl -i http://localhost:8282/ping` |
45+
| Check Enterprise status | `curl -i http://localhost:8181/ping -H "Authorization: Bearer $TOKEN"` |
46+
| Run code block tests | `yarn test:codeblocks:v2` |
47+
48+
## Setup Workflows
49+
50+
### Workflow 1: Core Only (Per-Worktree)
51+
52+
Use when testing Core-specific documentation or when you need complete isolation.
53+
54+
```bash
55+
# 1. Initialize Core
56+
./test/scripts/init-influxdb3.sh core
57+
58+
# 2. Verify it's running
59+
curl -i http://localhost:8282/ping
60+
61+
# 3. Get your token (JSON format)
62+
jq -r .token test/.influxdb3/core/.token
63+
64+
# 4. Create a database for testing
65+
curl -X POST "http://localhost:8282/api/v3/configure/database" \
66+
-H "Authorization: Bearer $(jq -r .token test/.influxdb3/core/.token)" \
67+
-H "Content-Type: application/json" \
68+
-d '{"db": "test_db"}'
69+
```
70+
71+
### Workflow 2: Enterprise (Shared Instance)
72+
73+
Use when testing Enterprise-specific documentation. Creates worktree-named database for isolation.
74+
75+
```bash
76+
# 1. First-time only: Create .env file with license email
77+
mkdir -p ~/influxdata-docs/.influxdb3/enterprise
78+
79+
~/influxdata-docs/.influxdb3/enterprise/.env
80+
81+
# 2. Initialize Enterprise (generates admin token and starts service)
82+
./test/scripts/init-influxdb3.sh enterprise
83+
84+
# 3. Get admin token from the generated file
85+
ADMIN_TOKEN=$(jq -r .token ~/influxdata-docs/.influxdb3/enterprise/admin-token.json)
86+
87+
# 4. Verify it's running
88+
curl -i http://localhost:8181/ping \
89+
-H "Authorization: Bearer $ADMIN_TOKEN"
90+
91+
# 5. Create worktree-named database for test isolation
92+
WORKTREE_NAME=$(basename "$(pwd)" | tr '-' '_')
93+
curl -X POST "http://localhost:8181/api/v3/configure/database" \
94+
-H "Authorization: Bearer $ADMIN_TOKEN" \
95+
-H "Content-Type: application/json" \
96+
-d "{\"db\": \"${WORKTREE_NAME}_db\"}"
97+
```
98+
99+
### Workflow 3: Both Services
100+
101+
Use when testing documentation that covers both Core and Enterprise.
102+
103+
```bash
104+
# Initialize both
105+
./test/scripts/init-influxdb3.sh all
106+
107+
# Verify both are running
108+
curl -i http://localhost:8282/ping # Core (no auth by default)
109+
curl -i http://localhost:8181/ping -H "Authorization: Bearer $TOKEN" # Enterprise
110+
```
111+
112+
## Creating Worktree-Specific Databases
113+
114+
When using the shared Enterprise instance, create databases named after the worktree to isolate test data:
115+
116+
```bash
117+
# Get worktree name (converts hyphens to underscores for valid DB names)
118+
WORKTREE_NAME=$(basename "$(pwd)" | tr '-' '_')
119+
echo "Database name: ${WORKTREE_NAME}_db"
120+
121+
# Create database
122+
curl -X POST "http://localhost:8181/api/v3/configure/database" \
123+
-H "Authorization: Bearer $ADMIN_TOKEN" \
124+
-H "Content-Type: application/json" \
125+
-d "{\"db\": \"${WORKTREE_NAME}_db\"}"
126+
127+
# List databases to verify
128+
curl "http://localhost:8181/api/v3/configure/database" \
129+
-H "Authorization: Bearer $ADMIN_TOKEN"
130+
```
131+
132+
**Naming Convention:**
133+
134+
- Worktree: `docs-v2-influxdb3-version-detection-headers`
135+
- Database: `docs_v2_influxdb3_version_detection_headers_db`
136+
137+
## Test Environment Configuration
138+
139+
### Configure .env.test for Code Block Tests
140+
141+
Create `content/<product>/.env.test` with test credentials:
142+
143+
```bash
144+
# For Enterprise testing
145+
ADMIN_TOKEN=$(jq -r .token ~/influxdata-docs/.influxdb3/enterprise/admin-token.json)
146+
cat > content/influxdb3/enterprise/.env.test << EOF
147+
INFLUX_HOST=http://localhost:8181
148+
INFLUX_TOKEN=$ADMIN_TOKEN
149+
INFLUX_DATABASE=YOUR_WORKTREE_DB
150+
EOF
151+
152+
# For Core testing
153+
cat > content/influxdb3/core/.env.test << EOF
154+
INFLUX_HOST=http://localhost:8282
155+
INFLUX_TOKEN=$(jq -r .token test/.influxdb3/core/.token)
156+
INFLUX_DATABASE=test_db
157+
EOF
158+
```
159+
160+
### Run Code Block Tests
161+
162+
```bash
163+
# Test specific product
164+
yarn test:codeblocks:v2
165+
166+
# Or run pytest directly
167+
docker compose run --rm v2-pytest
168+
```
169+
170+
## Troubleshooting
171+
172+
### Enterprise Won't Start
173+
174+
**Symptom:** Container exits immediately
175+
176+
**Check:**
177+
178+
```bash
179+
# View container logs
180+
docker logs influxdb3-enterprise
181+
182+
# Common issues:
183+
# 1. Missing .env file
184+
ls -la ~/influxdata-docs/.influxdb3/enterprise/.env
185+
186+
# 2. Wrong env var name (must be INFLUXDB3_ENTERPRISE_LICENSE_EMAIL)
187+
cat ~/influxdata-docs/.influxdb3/enterprise/.env
188+
189+
# 3. Missing admin-token.json (run init script to generate)
190+
ls -la ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
191+
```
192+
193+
### Core Token Not Working
194+
195+
**Symptom:** 401 Unauthorized
196+
197+
**Check:**
198+
199+
```bash
200+
# Verify token file exists and is valid JSON
201+
cat test/.influxdb3/core/.token
202+
jq . test/.influxdb3/core/.token # Should parse without errors
203+
204+
# Verify token is accessible in container (as secret)
205+
docker exec influxdb3-core cat /run/secrets/influxdb3-core-token
206+
```
207+
208+
### Port Already in Use
209+
210+
**Symptom:** "port is already allocated"
211+
212+
**Fix:**
213+
214+
```bash
215+
# Find what's using the port
216+
lsof -i :8181 # Enterprise
217+
lsof -i :8282 # Core
218+
219+
# Stop existing containers
220+
docker compose down influxdb3-enterprise influxdb3-core
221+
```
222+
223+
### Getting the Admin Token
224+
225+
The init script generates and saves admin tokens to JSON files for both Core and Enterprise:
226+
227+
```bash
228+
# Core token
229+
cat test/.influxdb3/core/.token
230+
jq -r .token test/.influxdb3/core/.token
231+
232+
# Enterprise token
233+
cat ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
234+
jq -r .token ~/influxdata-docs/.influxdb3/enterprise/admin-token.json
235+
236+
# Export for use in commands
237+
export INFLUXDB3_CORE_TOKEN=$(jq -r .token test/.influxdb3/core/.token)
238+
export INFLUXDB3_ENTERPRISE_TOKEN=$(jq -r .token ~/influxdata-docs/.influxdb3/enterprise/admin-token.json)
239+
240+
# Use in API calls
241+
curl -i http://localhost:8282/ping -H "Authorization: Bearer $INFLUXDB3_CORE_TOKEN"
242+
curl -i http://localhost:8181/ping -H "Authorization: Bearer $INFLUXDB3_ENTERPRISE_TOKEN"
243+
```
244+
245+
**Token File Format** (both Core and Enterprise):
246+
```json
247+
{
248+
"token": "64-character-hexadecimal-token",
249+
"description": "Admin token for InfluxDB 3 Core/Enterprise"
250+
}
251+
```
252+
253+
## Service Comparison
254+
255+
| Aspect | Core | Enterprise |
256+
| ------------- | ---------------- | -------------------------------- |
257+
| Port | 8282 | 8181 |
258+
| Data location | Per-worktree | Shared |
259+
| Auth default | Optional | Required |
260+
| License | None | Trial/Paid |
261+
| Use case | Isolated testing | Shared testing with worktree DBs |
262+
263+
## Related Files
264+
265+
- **Init script**: `test/scripts/init-influxdb3.sh`
266+
- **Docker Compose**: `compose.yaml` (services: influxdb3-core, influxdb3-enterprise)
267+
- **Test config**: `content/<product>/.env.test`
268+
269+
## Related Skills
270+
271+
- **cypress-e2e-testing** - For running E2E tests on documentation UI
272+
- **docs-cli-workflow** - For creating/editing documentation content

.github/CODEOWNERS

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# CODEOWNERS file for InfluxData Documentation
2+
#
3+
# This file defines code ownership for the docs-v2 repository.
4+
# Code owners are automatically requested for review when someone opens a pull request
5+
# that modifies code that they own.
6+
#
7+
# Order matters - the last matching pattern takes precedence.
8+
# More specific patterns should appear later in this file.
9+
#
10+
# Three-tier review approach for product documentation:
11+
# 1. Engineering teams (technical accuracy and implementation details)
12+
# 2. Product managers (product strategy and feature alignment)
13+
# 3. Documentation team (content quality, style, and user experience)
14+
#
15+
# Syntax: path/to/code @owner1 @owner2
16+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
17+
18+
# Default owner for everything in the repo
19+
# Docs team handles all documentation changes
20+
* @influxdata/docs-team
21+
22+
# Product-specific ownership
23+
# Each product area includes engineering team, specific product managers, and docs team
24+
# API docs subdirectories are grouped with their respective content directories
25+
26+
# Platform (legacy)
27+
# Docs: Documentation team
28+
/content/platform/ @influxdata/docs-team
29+
30+
# InfluxDB Cloud (TSM)
31+
# PMs: Scott (Cloud 1 primary), Daniel (Cloud 2 primary), Jason (secondary), Docs: Documentation team
32+
/content/influxdb/cloud/ @sanderson @mavarius @jstirnaman @influxdata/docs-team
33+
/api-docs/influxdb/cloud/ @sanderson @mavarius @jstirnaman @influxdata/docs-team
34+
35+
# InfluxDB v2
36+
# Engineering: Edge team, PMs: Scott (primary), Jason (secondary), Docs: Documentation team
37+
/content/influxdb/v2/ @influxdata/edge @sanderson @jstirnaman @influxdata/docs-team
38+
/api-docs/influxdb/v2/ @influxdata/edge @sanderson @jstirnaman @influxdata/docs-team
39+
40+
# InfluxDB v1
41+
# Engineering: Edge team, PMs: Scott (primary), Jason (secondary), Docs: Documentation team
42+
/content/influxdb/v1/ @influxdata/edge @sanderson @jstirnaman @influxdata/docs-team
43+
44+
# InfluxDB 3 Core
45+
# Engineering: Monolith team, PMs: Pete (primary), Gary (secondary), Docs: Documentation team
46+
/content/influxdb3/core/ @influxdata/monolith-team @peterbarnett03 @garylfowler @influxdata/docs-team
47+
/api-docs/influxdb3/core/ @influxdata/monolith-team @peterbarnett03 @garylfowler @influxdata/docs-team
48+
49+
# InfluxDB 3 Enterprise
50+
# Engineering: Monolith team, PMs: Pete (primary), Gary (secondary), Docs: Documentation team
51+
/content/influxdb3/enterprise/ @influxdata/monolith-team @peterbarnett03 @garylfowler @influxdata/docs-team
52+
/api-docs/influxdb3/enterprise/ @influxdata/monolith-team @peterbarnett03 @garylfowler @influxdata/docs-team
53+
54+
# InfluxDB 3 Clustered
55+
# Engineering: Platform team, PMs: Ritwika (primary), Scott (secondary), Docs: Documentation team
56+
/content/influxdb3/clustered/ @influxdata/platform-team @ritwika314 @sanderson @influxdata/docs-team
57+
/api-docs/influxdb3/clustered/ @influxdata/platform-team @ritwika314 @sanderson @influxdata/docs-team
58+
59+
# InfluxDB 3 Cloud Dedicated
60+
# Engineering: Cloud single-tenant, PMs: Ritwika (primary), Scott (secondary), Docs: Documentation team
61+
/content/influxdb3/cloud-dedicated/ @influxdata/cloud-single-tenant @ritwika314 @sanderson @influxdata/docs-team
62+
/api-docs/influxdb3/cloud-dedicated/ @influxdata/cloud-single-tenant @ritwika314 @sanderson @influxdata/docs-team
63+
64+
# InfluxDB 3 Cloud Serverless
65+
# PMs: Daniel (primary), Gary (secondary), Docs: Documentation team
66+
/content/influxdb3/cloud-serverless/ @mavarius @garylfowler @influxdata/docs-team
67+
/api-docs/influxdb3/cloud-serverless/ @mavarius @garylfowler @influxdata/docs-team
68+
69+
# InfluxDB 3 Explorer
70+
# PMs: Daniel (primary), Pete (secondary), Docs: Documentation team
71+
/content/influxdb3/explorer/ @mavarius @peterbarnett03 @influxdata/docs-team
72+
73+
# InfluxDB Enterprise (v1)
74+
# Engineering: Edge team, PMs: Scott (primary), Jason (secondary), Docs: Documentation team
75+
/content/enterprise_influxdb/ @influxdata/edge @sanderson @jstirnaman @influxdata/docs-team
76+
77+
# Telegraf
78+
# Engineering: Telegraf team, PMs: Scott (primary), Ryan (secondary), Docs: Documentation team
79+
/content/telegraf/ @influxdata/telegraf-team @sanderson @caterryan @influxdata/docs-team
80+
81+
# Kapacitor
82+
# Engineering: Bonitoo team, PMs: Scott (primary), Jason (secondary), Docs: Documentation team
83+
/content/kapacitor/ @influxdata/bonitoo @sanderson @jstirnaman @influxdata/docs-team
84+
85+
# Chronograf
86+
# Engineering: Bonitoo team, PMs: Daniel (primary), Ryan (secondary), Docs: Documentation team
87+
/content/chronograf/ @influxdata/bonitoo @mavarius @caterryan @influxdata/docs-team
88+
89+
# Flux
90+
# PMs: Scott (primary), Jason (secondary), Docs: Documentation team
91+
/content/flux/ @sanderson @jstirnaman @influxdata/docs-team
92+
93+
# Shared content (used by multiple products)
94+
/content/shared/ @influxdata/docs-team @influxdata/product-managers
95+
# API documentation (general/shared)
96+
# Docs team for shared API tooling and configuration
97+
98+
# Infrastructure and tooling
99+
/.circleci/ @influxdata/docs-team
100+
/layouts/ @influxdata/docs-team
101+
/assets/ @influxdata/docs-team
102+
/scripts/ @influxdata/docs-team
103+
/cypress/ @influxdata/docs-team
104+
/test/ @influxdata/docs-team
105+
/.ci/ @influxdata/docs-team
106+
/deploy/ @influxdata/docs-team
107+
108+
# Build and dependency configuration
109+
/package.json @influxdata/docs-team
110+
/yarn.lock @influxdata/docs-team
111+
/tsconfig.json @influxdata/docs-team
112+
/compose.yaml @influxdata/docs-team
113+
/Dockerfile* @influxdata/docs-team
114+
/.vale.ini @influxdata/docs-team
115+
/.vale-instructions.ini @influxdata/docs-team
116+
117+
# Agent-modified files - require human review
118+
# These files guide AI assistants and require careful oversight
119+
AGENTS.md @influxdata/docs-team
120+
CLAUDE.md @influxdata/docs-team
121+
/.github/copilot-instructions.md @influxdata/docs-team
122+
/.github/agents/ @influxdata/docs-team
123+
/.github/instructions/ @influxdata/docs-team
124+
/.claude/ @influxdata/docs-team

0 commit comments

Comments
 (0)