Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ceb7e61
docs: fix docusaurus icon interpretation IHS-198
a-delannoy Jul 23, 2025
8175d22
docs: Docusaurus sidebar configuration -> new sdk reference section I…
a-delannoy Jul 23, 2025
4a8818e
feat: new invoke command generate-sdk-api-docs IHS-196
a-delannoy Jul 23, 2025
673fd75
chore: add mdxify package IHS-196
a-delannoy Jul 23, 2025
a6d8d05
feat: new ci check to ensure sdk api documentation is up to date IHS-197
a-delannoy Jul 23, 2025
f9d63f2
internal: fixing docstrings & misspelling IHS-196
a-delannoy Jul 23, 2025
a7e5c63
chore: add towncrier changelog fragment for #201
a-delannoy Jul 25, 2025
6983fa5
docs: generation of documentation after legacy work IHS-199
polmichel Feb 10, 2026
93eeff9
feat: Adapted mdxify commit to uv, as poetry was used before IHS-195
polmichel Feb 10, 2026
03fa402
refactor: made the Jinja2Template extends the ATemplate class, allowi…
polmichel Feb 10, 2026
fcb0d5b
refactor: get a ACommand class, allowing next documentation generatio…
polmichel Feb 10, 2026
9ca9490
refactor: extract logic to documentation generation method class hier…
polmichel Feb 10, 2026
09707f5
refactor: it seems that two of the four methods that were used can be…
polmichel Feb 10, 2026
2cb708d
refactor: new objects representing Documentation pages IHS-201
polmichel Feb 10, 2026
bd716a6
refactor: plug the new code into documentation generation commands IH…
polmichel Feb 10, 2026
161f673
refactor: moved the docs_generation folder to docs IHS-201
polmichel Feb 10, 2026
bd17565
feat: enhanced PSDK Configuration Documentation format IHS-200
polmichel Feb 10, 2026
16116f7
feat: InfrahubCtl documentation dynamically rendering all the documen…
polmichel Feb 10, 2026
bdacc7a
chore: adds the dependency to vitest IHS-200
polmichel Feb 10, 2026
768ff9b
feat: PSDK Documentation auto rendering all files in topics, ref & gu…
polmichel Feb 10, 2026
e075ad6
docs: update AGENTS.md documentation with new rules and features IHS-200
polmichel Feb 10, 2026
c5c3a6b
refactor: encapsulate in a folder sidebars management IHS-200
polmichel Feb 10, 2026
f9971a7
feat: enhanced CI docs-validate check IHS-197
polmichel Feb 11, 2026
ec074ac
docs: AGENTS.md documentation updated IHS-197
polmichel Feb 11, 2026
2bb2cbe
docs: PSDK API documentation generation IHS-199
polmichel Feb 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
uses: actions/setup-node@v5
with:
node-version: 20
cache: 'npm'
cache: "npm"
cache-dependency-path: docs/package-lock.json
- name: "Install dependencies"
run: npm install
Expand Down Expand Up @@ -216,7 +216,6 @@ jobs:
run: uv sync --all-groups --all-extras
- name: Validate generated documentation
run: uv run invoke docs-validate

validate-documentation-style:
if: |
always() && !cancelled() &&
Expand All @@ -233,6 +232,7 @@ jobs:

# The official GitHub Action for Vale doesn't work, installing manually instead:
# https://github.com/errata-ai/vale-action/issues/103
# cf -> https://github.com/nf-core/website/pull/3509
- name: Download Vale
run: |
curl -sL "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
- stable
paths:
- 'docs/docs/**'
- 'docs/sidebars-infrahubctl.ts'
- 'docs/sidebars-python-sdk.ts'
- 'docs/sidebars/sidebars-infrahubctl.ts'
- 'docs/sidebars/sidebars-python-sdk.ts'

jobs:
sync:
Expand Down
1 change: 1 addition & 0 deletions changelog/201.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for automatic Python SDK API from docstrings in the code.
18 changes: 14 additions & 4 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ Docusaurus documentation following Diataxis framework.
cd docs && npm install # Install deps
cd docs && npm start # Dev server at localhost:3000
cd docs && npm run build # Build static site
uv run invoke docs # Generate auto-docs
uv run invoke docs-validate # Validate docs are current
cd docs && npm test # Run sidebar utility tests
uv run invoke docs # Build documentation website
uv run invoke docs-generate # Regenerate all docs (infrahubctl CLI + Python SDK)
uv run invoke docs-validate # Check that generated docs match committed files
```

## Structure
Expand All @@ -23,11 +25,19 @@ docs/docs/
└── infrahubctl/ # CLI docs (auto-generated)
```

## Sidebars

Sidebar navigation is dynamic: `sidebars-*.ts` files read the filesystem at build time via utility functions in `sidebar-utils.ts`.

- **infrahubctl**: all `.mdx` files are discovered automatically and sorted alphabetically.
- **python-sdk**: guides, topics, and reference sections preserve a defined display order; new files are appended alphabetically at the end.

No manual sidebar update is needed when adding a new `.mdx` file. However, to control the display order of a new page, add its doc ID to the ordered list in the corresponding `sidebars-*.ts` file.

## Adding Documentation

1. Create MDX file in appropriate directory
2. Add frontmatter with `title`
3. Update `sidebars-*.ts` for navigation

## MDX Pattern

Expand All @@ -52,7 +62,7 @@ Use callouts for important notes.
✅ **Always**

- Include both async/sync examples using Tabs
- Run `uv run invoke docs-validate` after code changes
- Run `uv run invoke docs-validate` after code changes to verify generated docs are up to date

🚫 **Never**

Expand Down
Empty file added docs/__init__.py
Empty file.
2 changes: 0 additions & 2 deletions docs/_templates/sdk_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ The following settings can be defined in the `Config` class
{% for property in properties %}
<!-- vale off -->
## {{ property.name }}

**Property**: {{ property.name }}<br />
<!-- vale on -->
**Description**: {% if '\n' in property.description %} {% endif %}{{ property.description }}<br />
**Type**: `{{ property.type }}`<br />
Expand Down
46 changes: 0 additions & 46 deletions docs/docs/python-sdk/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,189 +30,145 @@ The Python SDK (Async or Sync) client can be configured using an instance of the
The following settings can be defined in the `Config` class
<!-- vale off -->
## address

**Property**: address<br />
<!-- vale on -->
**Description**: The URL to use when connecting to Infrahub.<br />
**Type**: `string`<br />
**Default value**: http://localhost:8000<br />
**Environment variable**: `INFRAHUB_ADDRESS`<br />
<!-- vale off -->
## api_token

**Property**: api_token<br />
<!-- vale on -->
**Description**: API token for authentication against Infrahub.<br />
**Type**: `string`<br />
**Environment variable**: `INFRAHUB_API_TOKEN`<br />
<!-- vale off -->
## echo_graphql_queries

**Property**: echo_graphql_queries<br />
<!-- vale on -->
**Description**: If set the GraphQL query and variables will be echoed to the screen<br />
**Type**: `boolean`<br />
**Default value**: False<br />
**Environment variable**: `INFRAHUB_ECHO_GRAPHQL_QUERIES`<br />
<!-- vale off -->
## username

**Property**: username<br />
<!-- vale on -->
**Description**: Username for accessing Infrahub<br />
**Type**: `string`<br />
**Environment variable**: `INFRAHUB_USERNAME`<br />
<!-- vale off -->
## password

**Property**: password<br />
<!-- vale on -->
**Description**: Password for accessing Infrahub<br />
**Type**: `string`<br />
**Environment variable**: `INFRAHUB_PASSWORD`<br />
<!-- vale off -->
## default_branch

**Property**: default_branch<br />
<!-- vale on -->
**Description**: Default branch to target if not specified for each request.<br />
**Type**: `string`<br />
**Default value**: main<br />
**Environment variable**: `INFRAHUB_DEFAULT_BRANCH`<br />
<!-- vale off -->
## default_branch_from_git

**Property**: default_branch_from_git<br />
<!-- vale on -->
**Description**: Indicates if the default Infrahub branch to target should come from the active branch in the local Git repository.<br />
**Type**: `boolean`<br />
**Default value**: False<br />
**Environment variable**: `INFRAHUB_DEFAULT_BRANCH_FROM_GIT`<br />
<!-- vale off -->
## identifier

**Property**: identifier<br />
<!-- vale on -->
**Description**: Tracker identifier<br />
**Type**: `string`<br />
**Environment variable**: `INFRAHUB_IDENTIFIER`<br />
<!-- vale off -->
## insert_tracker

**Property**: insert_tracker<br />
<!-- vale on -->
**Description**: Insert a tracker on queries to the server<br />
**Type**: `boolean`<br />
**Default value**: False<br />
**Environment variable**: `INFRAHUB_INSERT_TRACKER`<br />
<!-- vale off -->
## max_concurrent_execution

**Property**: max_concurrent_execution<br />
<!-- vale on -->
**Description**: Max concurrent execution in batch mode<br />
**Type**: `integer`<br />
**Default value**: 5<br />
**Environment variable**: `INFRAHUB_MAX_CONCURRENT_EXECUTION`<br />
<!-- vale off -->
## mode

**Property**: mode<br />
<!-- vale on -->
**Description**: Default mode for the client<br />
**Type**: `object`<br />
**Environment variable**: `INFRAHUB_MODE`<br />
<!-- vale off -->
## pagination_size

**Property**: pagination_size<br />
<!-- vale on -->
**Description**: Page size for queries to the server<br />
**Type**: `integer`<br />
**Default value**: 50<br />
**Environment variable**: `INFRAHUB_PAGINATION_SIZE`<br />
<!-- vale off -->
## retry_delay

**Property**: retry_delay<br />
<!-- vale on -->
**Description**: Number of seconds to wait until attempting a retry.<br />
**Type**: `integer`<br />
**Default value**: 5<br />
**Environment variable**: `INFRAHUB_RETRY_DELAY`<br />
<!-- vale off -->
## retry_on_failure

**Property**: retry_on_failure<br />
<!-- vale on -->
**Description**: Retry operation in case of failure<br />
**Type**: `boolean`<br />
**Default value**: False<br />
**Environment variable**: `INFRAHUB_RETRY_ON_FAILURE`<br />
<!-- vale off -->
## max_retry_duration

**Property**: max_retry_duration<br />
<!-- vale on -->
**Description**: Maximum duration until we stop attempting to retry if enabled.<br />
**Type**: `integer`<br />
**Default value**: 300<br />
**Environment variable**: `INFRAHUB_MAX_RETRY_DURATION`<br />
<!-- vale off -->
## schema_converge_timeout

**Property**: schema_converge_timeout<br />
<!-- vale on -->
**Description**: Number of seconds to wait for schema to have converged<br />
**Type**: `integer`<br />
**Default value**: 60<br />
**Environment variable**: `INFRAHUB_SCHEMA_CONVERGE_TIMEOUT`<br />
<!-- vale off -->
## timeout

**Property**: timeout<br />
<!-- vale on -->
**Description**: Default connection timeout in seconds<br />
**Type**: `integer`<br />
**Default value**: 60<br />
**Environment variable**: `INFRAHUB_TIMEOUT`<br />
<!-- vale off -->
## transport

**Property**: transport<br />
<!-- vale on -->
**Description**: Set an alternate transport using a predefined option<br />
**Type**: `object`<br />
**Environment variable**: `INFRAHUB_TRANSPORT`<br />
<!-- vale off -->
## proxy

**Property**: proxy<br />
<!-- vale on -->
**Description**: Proxy address<br />
**Type**: `string`<br />
**Environment variable**: `INFRAHUB_PROXY`<br />
<!-- vale off -->
## proxy_mounts

**Property**: proxy_mounts<br />
<!-- vale on -->
**Description**: Proxy mounts configuration<br />
**Type**: `object`<br />
**Environment variable**: `INFRAHUB_PROXY_MOUNTS`<br />
<!-- vale off -->
## update_group_context

**Property**: update_group_context<br />
<!-- vale on -->
**Description**: Update GraphQL query groups<br />
**Type**: `boolean`<br />
**Default value**: False<br />
**Environment variable**: `INFRAHUB_UPDATE_GROUP_CONTEXT`<br />
<!-- vale off -->
## tls_insecure

**Property**: tls_insecure<br />
<!-- vale on -->
**Description**:
Indicates if TLS certificates are verified.
Expand All @@ -223,8 +179,6 @@ The following settings can be defined in the `Config` class
**Environment variable**: `INFRAHUB_TLS_INSECURE`<br />
<!-- vale off -->
## tls_ca_file

**Property**: tls_ca_file<br />
<!-- vale on -->
**Description**: File path to CA cert or bundle in PEM format<br />
**Type**: `string`<br />
Expand Down
Loading
Loading