Skip to content

Commit 1c1407d

Browse files
authored
Merge pull request #856 from opsmill/pmi-20260226-merge-develop-into-infrahub-develop
Manual merge from develop into infrahub-develop. This includes additional test-only typing and linting rules adaptation
2 parents a17f18b + 52d475e commit 1c1407d

24 files changed

Lines changed: 1543 additions & 672 deletions

.vale/styles/Infrahub/sentence-case.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ exceptions:
5252
- Jinja
5353
- Jinja2
5454
- JWT
55+
- MDX
5556
- Namespace
5657
- NATS
5758
- Node

.vale/styles/spelling-exceptions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ kbps
7979
Keycloak
8080
Loopbacks
8181
markdownlint
82+
MDX
8283
max_count
8384
memgraph
8485
menu_placement

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Infrahub Python SDK - async/sync client for Infrahub infrastructure management.
77
```bash
88
uv sync --all-groups --all-extras # Install all deps
99
uv run invoke format # Format code
10-
uv run invoke lint # All linters (code + yamllint + documentation)
10+
uv run invoke lint # Full pipeline: ruff, yamllint, ty, mypy, markdownlint, vale
1111
uv run invoke lint-code # All linters for Python code
1212
uv run pytest tests/unit/ # Unit tests
1313
uv run pytest tests/integration/ # Integration tests

changelog/497.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed Python SDK query generation regarding from_pool generated attribute value

dev/commands/feedback.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Session Feedback
2+
3+
Analyze this conversation and identify what documentation or context was missing, incomplete, or incorrect. The goal is to continuously improve the project's knowledge base so future conversations are more efficient.
4+
5+
## Step 1: Session Analysis
6+
7+
Reflect on the work done in this conversation. For each area, identify friction points:
8+
9+
1. **Exploration overhead**: What parts of the codebase did you have to discover by searching that should have been documented? (e.g., patterns, conventions, module responsibilities)
10+
2. **Wrong assumptions**: Did you make incorrect assumptions due to missing or misleading documentation?
11+
3. **Repeated patterns**: Did you discover recurring patterns or conventions that aren't documented anywhere?
12+
4. **Missing context**: What background knowledge would have helped you start faster? (e.g., architecture decisions, data flow, naming conventions)
13+
5. **Tooling gaps**: Were there commands, scripts, or workflows that you had to figure out?
14+
15+
## Step 2: Documentation Audit
16+
17+
For each friction point identified, determine the appropriate fix. Check the existing documentation to avoid duplicating what's already there:
18+
19+
- `AGENTS.md` — Top-level project instructions and component map
20+
- `CLAUDE.md` — Entry point referencing AGENTS.md
21+
- `docs/AGENTS.md` — Documentation site guide
22+
- `infrahub_sdk/ctl/AGENTS.md` — CLI development guide
23+
- `infrahub_sdk/pytest_plugin/AGENTS.md` — Pytest plugin guide
24+
- `tests/AGENTS.md` — Testing guide
25+
26+
Read the relevant existing files to understand what's already documented before proposing changes.
27+
28+
## Step 3: Generate Report
29+
30+
Present the feedback as a structured report with the following sections. Only include sections that have content — skip empty sections.
31+
32+
### Format
33+
34+
```markdown
35+
## Session Feedback Report
36+
37+
### What I Was Working On
38+
<!-- Brief summary of the task(s) performed in this conversation -->
39+
40+
### Documentation Gaps
41+
<!-- Things that should be documented but aren't -->
42+
43+
For each gap:
44+
45+
- **Topic**: What's missing
46+
- **Where**: Which file should contain this (existing file to update, or new file to create)
47+
- **Why**: How this would have helped during this conversation
48+
- **Suggested content**: A draft of what should be added (be specific and actionable)
49+
50+
### Documentation Corrections
51+
<!-- Things that are documented but wrong or misleading -->
52+
53+
For each correction:
54+
55+
- **File**: Path to the file
56+
- **Issue**: What's wrong or misleading
57+
- **Fix**: What it should say instead
58+
59+
### Discovered Patterns
60+
<!-- Conventions or patterns found in the code that aren't documented -->
61+
62+
For each pattern:
63+
64+
- **Pattern**: Description of the convention
65+
- **Evidence**: Where in the code this pattern is used (file paths)
66+
- **Where to document**: Which AGENTS.md or guide file should capture this
67+
68+
### Memory Updates
69+
<!-- Propose additions/changes to MEMORY.md for cross-session persistence -->
70+
71+
For each update:
72+
73+
- **Action**: Add / Update / Remove
74+
- **Content**: What to write
75+
- **Reason**: Why this is worth remembering across sessions
76+
```
77+
78+
## Step 4: Apply Changes
79+
80+
After presenting the report, ask the user which changes they want to apply. Present the options:
81+
82+
1. **Apply all** — Create/update all proposed documentation files and memory
83+
2. **Cherry-pick** — Let the user select which changes to apply
84+
3. **None** — Just keep the report as reference, don't modify any files
85+
86+
87+
For approved changes:
88+
89+
- Edit existing files when updating documentation
90+
- Create new files only when no appropriate existing file exists
91+
- Update `MEMORY.md` with approved memory changes
92+
- Keep all changes minimal and focused — don't over-document

dev/commands/pre-ci.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Run a subset of fast CI checks locally. These are lightweight validations that catch common issues before pushing. Run all steps and report a summary at the end.
2+
3+
## Steps
4+
5+
1. **Format** Python code:
6+
```bash
7+
uv run invoke format
8+
```
9+
10+
2. **Lint** (YAML, Ruff, ty, mypy, markdownlint, vale):
11+
```bash
12+
uv run invoke lint
13+
```
14+
15+
3. **Python unit tests**:
16+
```bash
17+
uv run pytest tests/unit/
18+
```
19+
20+
4. **Docs unit tests** (vitest):
21+
```bash
22+
(cd docs && npx --no-install vitest run)
23+
```
24+
25+
5. **Validate generated documentation** (regenerate and check for drift):
26+
```bash
27+
uv run invoke docs-validate
28+
```
29+
30+
## Instructions
31+
32+
- Run each step in order using the Bash tool.
33+
- If a step fails, continue with the remaining steps.
34+
- At the end, print a summary table of all steps with pass/fail status.
35+
- Do NOT commit or push anything.
36+

docs/AGENTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docs/AGENTS.md
1+
# Documentation agents
22

33
Docusaurus documentation following Diataxis framework.
44

@@ -34,12 +34,12 @@ Sidebar navigation is dynamic: `sidebars-*.ts` files read the filesystem at buil
3434

3535
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.
3636

37-
## Adding Documentation
37+
## Adding documentation
3838

3939
1. Create MDX file in appropriate directory
4040
2. Add frontmatter with `title`
4141

42-
## MDX Pattern
42+
## MDX pattern
4343

4444
Use Tabs for async/sync examples, callouts for notes:
4545

docs/docs/python-sdk/guides/client.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Your client is now configured to use the specified default branch instead of `ma
251251

252252
## Hello world example
253253

254-
Let's create a simple "Hello World" example to verify your client configuration works correctly. This example will connect to your Infrahub instance and query the available accounts.
254+
Let's create a "Hello World" example to verify your client configuration works correctly. This example will connect to your Infrahub instance and query the available accounts.
255255

256256
1. Create a new file called `hello_world.py`:
257257

docs/docs/python-sdk/guides/python-typing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ infrahubctl graphql generate-return-types queries/get_tags.gql
131131
132132
### Example workflow
133133

134-
1. **Create your GraphQL queries** in `.gql` files preferably in a directory (e.g., `queries/`):
134+
1. **Create your GraphQL queries** in `.gql` files preferably in a directory (for example, `queries/`):
135135

136136
```graphql
137137
# queries/get_tags.gql

docs/docs/python-sdk/sdk_ref/infrahub_sdk/node/attribute.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ value(self) -> Any
2424
```python
2525
value(self, value: Any) -> None
2626
```
27+
28+
#### `is_from_pool_attribute`
29+
30+
```python
31+
is_from_pool_attribute(self) -> bool
32+
```
33+
34+
Check whether this attribute's value is sourced from a resource pool.
35+
36+
**Returns:**
37+
38+
- True if the attribute value is a resource pool node or was explicitly allocated from a pool.

0 commit comments

Comments
 (0)