Releases: opsmill/infrahub-sdk-python
Version 1.11.0
This release focusing mainly on improving the user/developer experience with a new command to load data into Infrahub, some improvements around Python Typing as well as some fixes
Main changes
Manage data in yaml format using Object files
The new infrahubctl commands object load and object validate allows you to manage data to be loaded in Infrahub based on your own custom schema. It provides a declarative way to define and manage resources in your Infrahub instance.
Object files work well for models that don't change too often and/or that need to be tracked in Git. Examples include: Groups, tags, Users, etc.
Below is an example of an Object file that defines tags (BuiltinTag).
---
apiVersion: infrahub.app/v1
kind: Object
spec:
kind: BuiltinTag
data:
- name: Blue
- name: Yellow
- name: RedMore information is available in the documentation
New user guide on how to use Python's type system effectively with the Infrahub SDK
A new guide is available in the documentation to explain how to leverage Python's type system better with the Python SDK by leveraging Python Protocols.
Changelog
Deprecated
- The 'timeout' parameter while creating a node or fetching the schema has been deprecated. the default_timeout will be used instead.
Added
- Add support for object Template when generating protocols (#329)
- Add a Guide related to Python Typing
- Add method
client.schema.set_cache()to populate the cache manually (primarily for unit testing) - By default, schema.fetch will now populate the cache (this behavior can be changed with
populate_cache) - Add
menu validatecommand to validate the format of menu files.
Fixed
- Raise a proper branch not found error when requesting a node or schema for a branch that doesn't exist. (#286)
- Fix support for Sync when generating Python Protocols
Housekeeping
- Add
invoke lint-doccommand to help run the docs linters locally - Add a fixture to always reset some environment variables before running tests
- Update Pytest-httpx and set all responses as reusable
Version 1.10.2
1.10.2 - 2025-04-11
Fixed
- fix an issue where nodes attributes were not updated when setting the same value than the one used during node instantiation
- fixes an issue where the default branch of the client store was not properly set in a generator
Version 1.10.1
This version includes only one small change to help with the troubleshooting of a potential issue.
Changed
- Improve error message when a schema received from the server is not JSON valid. The new exception will be of type
infrahub_sdk.exceptions.JsonDecodeErrorinstead ofjson.decoder.JSONDecodeError
Version 1.10.0
This version of the Python SDK includes some improvement around Jinja2 templating with the addition of new Jinja2 filters (thanks to the netutils library) and some improvements of the object store, as well as some bug fixes.
Deprecated
- The method
get_by_hfidon the object Store has been deprecated, useget(key=[hfid])instead - Using a Store without specifying a default branch is now deprecated and will be removed in a future version.
Added
- All nodes generated by the SDK will now be assigned an
internal_id(_internal_id). This ID has no significance outside of the SDK. - Jinja2 templating has been refactored to allow for filters within Infrahub. Builtin filters as well as those from Netutils are available.
- The object store has been refactored to support more use cases in the future and it now properly support branches.
Fixed
- Fix node processing, when using fragment with
prefetch_relationships. (#331)
Version 1.9.2
Changed
- Remove hfid in upsert payload, to improve node upsert performances
Version 1.9.1
1.9.1 - 2025-03-21
Fixed
- Fixed an issue where the process_nodes method in the generators used the old format of the schema hash, so node population didn't work
Version 1.9.0
1.9.0 - 2025-03-21
Added
- Add 'schema_hash' parameter to client.schema.all to only optionally refresh the schema if the provided hash differs from what the client has already cached. (#152)
Changed
- CoreStandardGroups created or updated by a generator in Infrahub are now stored as a member of the CoreGeneratorGroup. Previously they were being stored as children of the CoreGeneratorGroup.
Fixed
- The SDK client query methods (get, filters, all) default behaviour has changed. The query methods will store the retrieved nodes in the internal store by default, where previously this behaviour had to be enabled explicitly using the
populate_storeargument. (#15)
Version 1.8.0
1.8.0 - 2025-03-19
Deprecated
- Timestamp: Direct access to
objandadd_deltahave been deprecated and will be removed in a future version. (#255)
Added
- Added support for Enum in GraphQL query and mutation. (#18)
Fixed
- Refactored Timestamp to use
wheneverinstead ofpendulumand extend Timestamp withadd(),subtract(), andto_datetime(). (#255) - Fixed support for Python 3.13 as it's no longer required to have Rust installed on the system.
Version 1.7.2
1.7.2 - 2025-03-07
Added
- Added logger to
InfrahubGeneratorclass to allow users use built-in logging (self.logger) to show logging within Infrahub CI pipeline.
Changed
- Aligned the environment variables used by
infrahubctlwith the environment variables used by the SDK. - Allowed the
infrahubctl transformcommand to return a regular string that does not get converted to a JSON string. - Changed InfrahubNode/InfrahubNodeSync
artifact_fetchandartifact_generatemethods to use the name of the artifact instead of the name of the artifact definition.
Fixed
protocolsCTL command properly gets default branch setting from environment variable. (#104)- Fixed typing for Python 3.9 and removed support for Python 3.13. (#251)
- Removed default value "main" for branch parameter from all Infrahub CTL commands. (#264)
Housekeeping
- Moved the function
read_filefrom the ctl module to the SDK.
Version 1.8.0b2
1.8.0b2 - 2025-03-04
Deprecated
- Timestamp: Direct access to
objandadd_deltahave been deprecated and will be removed in a future version. (#255)
Changed
- Changes InfrahubNode/InfrahubNodeSync
artifact_fetchandartifact_generatemethods to use the name of the artifact instead of the name of the artifact definition.
Fixed
protocolsCTL command properly gets default branch setting from environment variable. (#104)- Fix typing for Python 3.9 (#251)
- Refactor Timestamp to use
wheneverinstead ofpendulumand extend Timestamp with add(), subtract(), and to_datetime(). (#255) - Remove default value "main" for branch parameter from all Infrahub CTL commands. (#264)
- Fixed support for Python 3.13, it's no longer required to have Rust installed on the system.
Housekeeping
- Move the function
read_filefrom the ctl module to the SDK.