Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 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
37db419
chore: adds the dependency to vitest & markdownlint-cli2 IHS-200
polmichel Feb 10, 2026
f3ec276
feat: PSDK Documentation auto rendering all files in topics, ref & gu…
polmichel Feb 10, 2026
23af927
docs: update AGENTS.md documentation with new rules and features IHS-200
polmichel Feb 10, 2026
0ead93b
refactor: encapsulate in a folder sidebars management IHS-200
polmichel Feb 10, 2026
d239d46
feat: enhanced CI docs-validate check: robustify and refactor package…
polmichel Feb 11, 2026
d64dde3
docs: AGENTS.md documentation updated IHS-197
polmichel Feb 11, 2026
de50398
docs: PSDK API documentation generation IHS-199
polmichel Feb 11, 2026
e5ecfd0
upgrade Docusaurus to the same version that infrahub-docs version (3.…
polmichel Feb 12, 2026
900096c
feat: mdxify does not correctly handle code examples in docstring IHS…
polmichel Feb 12, 2026
6c5a6ad
Revert "refactor: made the Jinja2Template extends the ATemplate class…
polmichel Feb 13, 2026
6d9e056
test: Adapt internal tests due to refactoring revert of ATemplate cla…
polmichel Feb 13, 2026
7c8ce06
fix: correct path fixed about sidebars folder which will be copied to…
polmichel Feb 16, 2026
7ce5078
fix: fixing wrong path stored in the MdxFile class depending on tmp f…
polmichel Feb 16, 2026
9464c05
docs: fixing misspelled term in documentation IHS-199
polmichel Feb 16, 2026
636de56
fix: avoiding unlink method to be skipped if an exception occur durin…
polmichel Feb 16, 2026
294d265
docs: unable python references on general documentation / enable the …
polmichel Feb 16, 2026
c486893
docs: fix comments on Icon management IHS-198
polmichel Feb 16, 2026
19a6622
chore: fixed towncrier changelog fragment for #201
polmichel Feb 17, 2026
6f07577
feat: add MdxSection reordering if priority has been given on certain…
polmichel Feb 16, 2026
471d3c0
feat: class methods can be prioritized over others in the API Documen…
polmichel Feb 16, 2026
40f559e
refactor: encapsulate re-ordering complexity into a composition class…
polmichel Feb 16, 2026
6d1d14a
feat: error management related to item proritization in doc_generatio…
polmichel Feb 16, 2026
7b83953
docs: generating SDK API Documentation once first items prioritized I…
polmichel Feb 16, 2026
805b7e3
docs: Class should be put before functions into SDK API documentation…
polmichel Feb 16, 2026
a694e59
docs: generating SDK API Documentation after Class versus Functions r…
polmichel Feb 16, 2026
8c8c758
refactor: cleaned static methods and misplaced logic IHS-205
polmichel Feb 17, 2026
1e67930
refactor: test files are no split and clarified depending on the scen…
polmichel Feb 17, 2026
9a3eed6
feat: add collapsible sections into the documentation to contain meth…
polmichel Feb 17, 2026
47988d9
docs: new documentation using the collapsible sections IHS-206
polmichel Feb 17, 2026
bf88b02
refactor: simplifying code + avoid testing logic + separate test file…
polmichel Feb 17, 2026
ca223c9
fix: getter / setter / deleter where considered as overloads in the d…
polmichel Feb 19, 2026
5d4704a
docs: update API documentation regarding overloads fix on getter & se…
polmichel Feb 19, 2026
b391934
Merge pull request #822 from opsmill/pmi-20260210-sdk-api-documentation
polmichel Feb 19, 2026
04fd475
Merge pull request #832 from opsmill/pmi-20260216-sdk-api-doc-priorit…
polmichel Feb 19, 2026
dda5236
Merge pull request #833 from opsmill/pmi-20260217-sdk-api-doc-collaps…
polmichel Feb 19, 2026
0bf611d
Merge remote-tracking branch 'origin/develop' into merge-822-832-deve…
polmichel Feb 19, 2026
17edb63
Merge PRs 822 832 833 into develop: fixing linter
polmichel Feb 19, 2026
b29fcbb
docs: Fixing wrong documentation format related to Python code exampl…
polmichel Feb 19, 2026
0b99ab7
docs: Updating related SDK API docs IHS-193
polmichel Feb 19, 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
3 changes: 2 additions & 1 deletion .github/file-filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ markdown_all: &markdown_all

infrahub_reference_generated: &infrahub_reference_generated
- "docs/docs/infrahubctl/*.mdx"
- "docs/docs/python-sdk/reference/config.mdx"
- "docs/docs/python-sdk/reference/*.mdx"
- "docs/docs/python-sdk/sdk_ref/**/*.mdx"

documentation_all:
- *development_files
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: "Linting: markdownlint"
uses: DavidAnson/markdownlint-cli2-action@v22
with:
config: .markdownlint.yaml
config: docs/.markdownlint.yaml
globs: |
**/*.{md,mdx}
!changelog/*.md
Expand Down Expand Up @@ -176,7 +176,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 @@ -207,6 +207,15 @@ jobs:
uses: "actions/checkout@v6"
with:
submodules: true
- name: Install NodeJS
uses: actions/setup-node@v5
with:
node-version: 20
cache: "npm"
cache-dependency-path: docs/package-lock.json
- name: "Install npm dependencies"
run: npm install
working-directory: ./docs
- name: Set up Python
uses: actions/setup-python@v6
with:
Expand All @@ -217,9 +226,11 @@ jobs:
version: "${{ needs.prepare-environment.outputs.UV_VERSION }}"
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: Docs unit tests
run: npx --no-install vitest run
working-directory: ./docs
- name: Validate generated documentation
run: uv run invoke docs-validate

validate-documentation-style:
if: |
always() && !cancelled() &&
Expand All @@ -236,6 +247,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
10 changes: 6 additions & 4 deletions .github/workflows/sync-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ 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'
- 'docs/sidebars/sidebar-utils.ts'

jobs:
sync:
Expand All @@ -33,8 +34,9 @@ jobs:
rm -f target-repo/docs/sidebars-python-sdk.ts
rm -f target-repo/docs/sidebars-infrahubctl.ts
cp -r source-repo/docs/docs/* target-repo/docs/docs-python-sdk/
cp source-repo/docs/sidebars-infrahubctl.ts target-repo/docs/
cp source-repo/docs/sidebars-python-sdk.ts target-repo/docs/
cp source-repo/docs/sidebars/sidebars-infrahubctl.ts target-repo/docs/
cp source-repo/docs/sidebars/sidebars-python-sdk.ts target-repo/docs/
cp source-repo/docs/sidebars/sidebar-utils.ts target-repo/docs/
cd target-repo
git config user.name github-actions
git config user.email github-actions@github.com
Expand Down
7 changes: 7 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ BasedOnStyles =

[*]
BasedOnStyles = Infrahub

# Generated API reference docs: use GeneratedRef spelling (allows snake_case)
# instead of global Infrahub spelling. Must be last to override [*].
[docs/docs/python-sdk/sdk_ref/**/*.mdx]
BasedOnStyles = Infrahub, GeneratedRef
Infrahub.spelling = NO
BlockIgnores = (?s) *((import.*?\n)|(```.*?```\n))
10 changes: 10 additions & 0 deletions .vale/styles/GeneratedRef/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
extends: spelling
message: "Did you really mean '%s'?"
level: error
filters:
- '[pP]y.*\b'
- '\bimport_.*\b' # Ignore variables starting with 'import_'
- '\w+__value' # Skip Infrahub filters in documentation (name__value)
- '\b\w+_\w+\b' # Ignore snake_case identifiers in generated API reference docs
ignore: spelling-exceptions.txt
4 changes: 2 additions & 2 deletions .vale/styles/Infrahub/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ message: "Did you really mean '%s'?"
level: error
filters:
- '[pP]y.*\b'
- '\bimport_.*\b' # New filter to ignore variables starting with 'import_'
- '\w+__value' # New filter to skip Infrahub filters in documentation (name__value)
- '\bimport_.*\b' # Ignore variables starting with 'import_'
- '\w+__value' # Skip Infrahub filters in documentation (name__value)
ignore: spelling-exceptions.txt
1 change: 1 addition & 0 deletions .vale/styles/spelling-exceptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Alibaba
Ansible
append_git_suffix
APIs
Args
artifact_definitions
artifact_name
async
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 @@
Python SDK API documentation is now generated directly from the docstrings of the classes, functions, and methods contained in the code.
File renamed without changes.
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