Conversation
Bumps [infrahub-testcontainers](https://github.com/opsmill/infrahub) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/opsmill/infrahub/releases) - [Changelog](https://github.com/opsmill/infrahub/blob/stable/CHANGELOG.md) - [Commits](opsmill/infrahub@infrahub-v1.8.1...infrahub-v1.8.2) --- updated-dependencies: - dependency-name: infrahub-testcontainers dependency-version: 1.8.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
…stcontainers-1.8.2 chore(deps-dev): bump infrahub-testcontainers from 1.8.1 to 1.8.2
…ratorDefintionConfig-descriptions improve InfrahubGeneratorDefintionConfig descriptions
WalkthroughThe change updates field descriptions in 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
infrahub_sdk/schema/repository.py (1)
84-113: Run formatting, linting, and documentation generation commands before merging.You've modified Field descriptions in Pydantic models. Before merging, run:
uv run invoke format lint-codeto ensure code formatting and linting complianceuv run invoke docs-generateto regenerate documentation from updated docstrings🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@infrahub_sdk/schema/repository.py` around lines 84 - 113, The Field descriptions on the Pydantic model InfrahubGeneratorDefinitionConfig were changed; before merging, run the repository formatting, linting, and docs generation steps to ensure consistency and updated docs: execute "uv run invoke format lint-code" to apply formatting and lint fixes for the modified Field usages (e.g., name, file_path, query, parameters, targets, class_name, convert_query_response, execute_in_proposed_change, execute_after_merge) and then run "uv run invoke docs-generate" to regenerate documentation from the updated docstrings/descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@infrahub_sdk/schema/repository.py`:
- Around line 90-93: The Field description for the parameters attribute is
inaccurate; update the Field(description=...) for the parameters variable in the
repository.Schema class so it says that keys are member object attribute names
used to extract values (via getattr on member.peer) and those extracted values
are passed directly as GraphQL variables, rather than describing any
double-underscore path parsing. Reference the parameters Field and the usage via
getattr(member.peer, identifier) in generator modules when editing the text.
---
Nitpick comments:
In `@infrahub_sdk/schema/repository.py`:
- Around line 84-113: The Field descriptions on the Pydantic model
InfrahubGeneratorDefinitionConfig were changed; before merging, run the
repository formatting, linting, and docs generation steps to ensure consistency
and updated docs: execute "uv run invoke format lint-code" to apply formatting
and lint fixes for the modified Field usages (e.g., name, file_path, query,
parameters, targets, class_name, convert_query_response,
execute_in_proposed_change, execute_after_merge) and then run "uv run invoke
docs-generate" to regenerate documentation from the updated
docstrings/descriptions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f99bb3d8-46cb-4756-bd34-9c0990c40fdd
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
infrahub_sdk/schema/repository.py
| parameters: dict[str, Any] = Field( | ||
| default_factory=dict, description="The input parameters required to run this check" | ||
| default_factory=dict, | ||
| description="Maps GraphQL query variable names to target object attribute paths using double-underscore notation.", | ||
| ) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Search for code that parses double-underscore notation in parameters
# Search for patterns that might indicate double-underscore parsing
rg -n -C5 '__' --type=py --glob='**/generator*.py' --glob='**/repository*.py'
# Look for methods that process params/parameters in generator classes
ast-grep --pattern 'def $FUNC($$$) {
$$$
params
$$$
}'Repository: opsmill/infrahub-sdk-python
Length of output: 11179
🏁 Script executed:
# Search for InfrahubGeneratorDefinitionConfig usage and definition
rg -n "InfrahubGeneratorDefinitionConfig" --type=py -A 5 -B 2
# Look at the actual parameters field definition and usage
rg -n "parameters" --type=py infrahub_sdk/schema/repository.py
# Check for any documentation or tests about how parameters work
fd -e py -e md | xargs rg -l "parameters.*GraphQL\|parameters.*double" 2>/dev/null | head -10Repository: opsmill/infrahub-sdk-python
Length of output: 3468
🏁 Script executed:
# Look at the full definition of InfrahubGeneratorDefinitionConfig
sed -n '84,115p' infrahub_sdk/schema/repository.py
# Search for how params/parameters are used in generator execution
rg -n "self.params\|parameters" infrahub_sdk/generator.py -B 3 -A 3
# Look for any transformation or parsing of parameters
rg -n "\.get\(|split\(|parse" infrahub_sdk/generator.py --type=py -A 2 -B 2Repository: opsmill/infrahub-sdk-python
Length of output: 2081
🏁 Script executed:
# Search for actual examples or tests showing how the parameters field is used
rg -n "parameters.*=" --type=py -B 2 -A 2 | grep -A 5 -B 5 "InfrahubGeneratorDefinitionConfig\|generator.*parameters" | head -50
# Look at how collect_data and other methods use self.params
sed -n '45,80p' infrahub_sdk/generator.py
# Search for any documentation or examples in md/yaml files
fd -e md -e yaml | xargs grep -l "generator" 2>/dev/null | head -5Repository: opsmill/infrahub-sdk-python
Length of output: 1392
🏁 Script executed:
# Find where self.params is initialized
rg -n "self.params\s*=" --type=py -B 5 -A 5
# Look for InfrahubOperation class definition
rg -n "class InfrahubOperation" --type=py -A 30
# Check if there's any initialization from InfrahubGeneratorDefinitionConfig
rg -n "InfrahubGenerator\|InfrahubOperation" infrahub_sdk/generator.py | head -20Repository: opsmill/infrahub-sdk-python
Length of output: 4037
🏁 Script executed:
# Search for tests or examples using InfrahubGeneratorDefinitionConfig with parameters
fd -e py | xargs grep -l "InfrahubGeneratorDefinitionConfig\|generator.*config" 2>/dev/null | head -10
# Look at tests directory for generator tests
fd test.*generator -type f
# Search for any usage examples in comments or docstrings
rg -n "parameters.*:" --type=py -B 5 -A 5 infrahub_sdk/schema/repository.pyRepository: opsmill/infrahub-sdk-python
Length of output: 2254
🏁 Script executed:
# Look at how generator definitions are actually used in ctl/generator.py
sed -n '1,100p' infrahub_sdk/ctl/generator.py
# Search for examples of generator configs in test files
fd test -type d
# Look for any YAML examples of generators
fd -e yaml -e yml | xargs grep -l "generator" 2>/dev/null | head -5Repository: opsmill/infrahub-sdk-python
Length of output: 4029
🏁 Script executed:
# Get more context from ctl/generator.py around the parameter usage
sed -n '85,100p' infrahub_sdk/ctl/generator.py
# Search for any double-underscore usage in context of parameters or attributes
rg -n "identifier\|check_parameter\|params" infrahub_sdk/ctl/generator.py -B 2 -A 2 | head -60Repository: opsmill/infrahub-sdk-python
Length of output: 881
🏁 Script executed:
# Check if there's any double-underscore transformation in getattr or attribute access
rg -n "split.*__\|\.replace.*__\|parse.*__" --type=py
# Look more carefully at how parameters are used in the actual generator run
rg -n "params\|parameters" infrahub_sdk/ctl/generator.py -A 3 -B 3
# Check if there's any documentation about this in README or docs
find . -name "*.md" | xargs grep -i "generator.*parameter\|double.*underscore" 2>/dev/nullRepository: opsmill/infrahub-sdk-python
Length of output: 55
🏁 Script executed:
# Search more carefully for double-underscore pattern in context of parameters/attributes
rg "parameters" infrahub_sdk/ctl/generator.py -C 10
# Check if parameters are actually transformed or mapped anywhere
rg -n "\.keys\(\)|identifier|check_parameter" infrahub_sdk/ctl/generator.py
# Look at the complete generator config loading
sed -n '40,100p' infrahub_sdk/ctl/generator.pyRepository: opsmill/infrahub-sdk-python
Length of output: 3964
Correct the inaccurate parameters field description.
The current description states parameters "Maps GraphQL query variable names to target object attribute paths using double-underscore notation." However, investigation of infrahub_sdk/ctl/generator.py and infrahub_sdk/generator.py reveals that parameter keys are used directly as Python attribute names (via getattr(member.peer, identifier)) and passed to GraphQL queries without any parsing of double-underscore notation. No such transformation logic exists in the codebase.
Revise the description to accurately reflect that parameter keys represent member object attribute names used to extract values passed as GraphQL variables.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@infrahub_sdk/schema/repository.py` around lines 90 - 93, The Field
description for the parameters attribute is inaccurate; update the
Field(description=...) for the parameters variable in the repository.Schema
class so it says that keys are member object attribute names used to extract
values (via getattr on member.peer) and those extracted values are passed
directly as GraphQL variables, rather than describing any double-underscore path
parsing. Reference the parameters Field and the usage via getattr(member.peer,
identifier) in generator modules when editing the text.
Summary by CodeRabbit