Merge stable into develop#968
Open
infrahub-github-bot-app[bot] wants to merge 48 commits intodevelopfrom
Open
Conversation
Merge develop into infrahub-develop
* update schemas related to CoreKeyValue object * putting the value of KeyValue object into generic schema * updated schema since the CoreEnvironmentVariableKeyValue has been renamed CoreEnvKeyValue --------- Co-authored-by: polmichel <pol@opsmill.com>
This parameter has been deprecated for a while and should not be used anymore.
Clean up logic to load repository config items
…ttribute and relationship (#823)
Fix typing warnings with ty
Add GraphQL fragment support in .infrahub.yml
Introduce artifact_content, file_object_content, from_json, and from_yaml Jinja2 filters to enable modular configuration pipelines where templates can reference and inline rendered content from other artifacts. Replace FilterDefinition.trusted boolean with a flag-based ExecutionContext model (CORE, WORKER, LOCAL) for context-aware template validation. Jinja2Template gains an optional client parameter and a set_client() method for deferred client injection.
Merge develop into infrahub-develop
Merge develop into infrahub-develop
Merge develop into infrahub-develop
…#904) Support all three file object retrieval endpoints: by storage ID (existing), by node UUID, and by HFID. Extract shared `ObjectStore` file fetching and content-type validation into helpers. Make `InfrahubFilters` accept an optional client, checking at call time instead of maintaining separate no-client fallback functions.
The idea is that these filters should *never* be used by the main API server. Making them `LOCAL` too would allow that. So rather than doing this, we prefer making them `WORKER` only and allow any filters to run on workers if the user turns on the proper setting in the API server.
Clean up of logic within Node
…e-cleanup Reduce cyclomatic complexity in generate_query_data_node
…-enum Use RelationshipCardinality enum in favor of a string
…to generic schemas (#807) * feat: update the generic schema on python_sdk side regarding restricted_namespaces but also missing fields IHS-190 * test: New generic test on sdk module. Loading valid generic schema through infrahubctl command layer. Infrahub API is mocked IHS-190 * test: new test on sdk module. An error message is retrieved when an invalid namespace is loaded from SDK methods. Infrahub API is mocked IHS-190 * renamed and simplified the test --------- Co-authored-by: polmichel <pol@opsmill.com>
Merge develop into infrahub-develop
Merge develop into infrahub-develop
Merge develop into infrahub-develop
Merge 'develop' into 'infrahub-develop'
…api_token When username/password are explicitly provided, clear any api_token from environment variables to allow password authentication to take precedence. This resolves the issue where users with INFRAHUB_API_TOKEN in their environment couldn't use password authentication. Co-authored-by: ogenstad <6694669+ogenstad@users.noreply.github.com>
Fix authentication validation to allow password auth to override env api_token
Merge develop into infrahub-develop
Signed-off-by: Fatih Acar <fatih@opsmill.com>
Merge develop into infrahub-develop
Raise a new file not found error when loading queries
Add an optional `description` field to `InfrahubPythonTransformConfig` to achieve parity with `InfrahubJinja2TransformConfig`. This allows users to set descriptions for Python transforms in `.infrahub.yml`. Closes opsmill/infrahub#6382 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The SDK constructed URLs under /api/files/* for the three file_object_content* Jinja2 filters, but the Infrahub backend serves these endpoints under /api/storage/files/*. Every call 404ed. Updated all six URLs (async + sync) in object_store.py to the correct prefix. Added happy-path unit tests for file_object_content_by_id and file_object_content_by_hfid (string and list forms) so similar contract drift with the backend router is caught in CI. Fixes #954 * Remove changelog entry for unreleased code fix The bug was introduced in the same release cycle, so a changelog record would appear as a fix for something that was never released. --------- Co-authored-by: Phillip Simonds <phillip@opsmill.com> Co-authored-by: Guillaume Mazoyer <guillaume@opsmill.com>
render_jinja2_template in the CLI constructed a Jinja2Template and called .render() without ever calling .validate(). Today that is accidentally safe: WORKER-only filters like artifact_content fail with "requires an InfrahubClient" because infrahubctl render does not pass one. But the moment a future change threads a client through — a natural thing to do to enable iterative transform development — those filters would silently run locally, bypassing the WORKER-only gate. Add jinja_template.validate(context=ExecutionContext.LOCAL) before .render() so the context gate is enforced regardless of client state. Incidental: Jinja2Template.validate() did not handle jinja2.TemplateNotFound from env.loader.get_source() the way .render() does — a missing file-based template raised raw TemplateNotFound that escaped callers expecting JinjaTemplateError. Wrapped it in JinjaTemplateNotFoundError to match render()'s behavior and added a unit test for the case. Added a fixture template using artifact_content plus a parametrised CLI test asserting infrahubctl render rejects it with the expected violation message. Updated the invalid-filter test: missing filters are now caught at validate() time with the standard filter-gating error message rather than at render time. Fixes #955 --------- Co-authored-by: Phillip Simonds <phillip@opsmill.com> Co-authored-by: Guillaume Mazoyer <guillaume@opsmill.com>
#959) ObjectStore.get() and ObjectStore.upload() (async + sync) caught httpx.HTTPStatusError in an except block that only converted 401/403 to AuthenticationError. For any other status code (404, 500, etc.) the exception was silently dropped and execution fell through to the return statement — `return resp.text` for get() and `return resp.json()` for upload(). Callers received the error body as if it were valid content. The downstream impact surfaced during INFP-504 testing: the new `artifact_content` Jinja2 filter calls `object_store.get()`; when the filter was passed a non-existent storage_id, the backend correctly returned HTTP 404 with a GraphQL-shaped error body, but the SDK silently returned that body as a string, which became the artifact's content. The artifact was marked Ready with a corrupt payload. Fix: add a trailing `raise` at the end of the `except httpx.HTTPStatusError` block in all four places, matching the pattern already used in `_get_file()` (lines 99 and 185). Non-401/403 HTTP errors now propagate to callers. Added unit tests covering: - get() raises httpx.HTTPStatusError on 404 - upload() raises httpx.HTTPStatusError on 500 - get() still converts 401/403 to AuthenticationError (unchanged) Both parametrised for async and sync clients. Fixes #958 --------- Co-authored-by: Phillip Simonds <phillip@opsmill.com> Co-authored-by: Guillaume Mazoyer <guillaume@opsmill.com>
…observability (#965) * IHS-219: Add query_name parameter to all(), filters(), and get() for observability * update docs * update getting kind as string logic * update docs * update docs * update docs
Merge develop into infrahub-develop
Merge 'infrahub-develop' into 'stable'
Deploying infrahub-sdk-python with
|
| Latest commit: |
dec3101
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://68b058fe.infrahub-sdk-python.pages.dev |
prepare release v1.20.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging stable into develop after merging pull request #966.