github opsmill/infrahub 0.5.0
0.5.0 - Tech Preview #3

latest releases: infrahub-v1.4.6, infrahub-v1.3.9, infrahub-v1.4.5...
pre-release2 years ago

Summary

This release is a consolidation release with a lot of changes under the hood and only few visible changes from the outside. The main change in this release is the introduction of the pagination across the board, this feature is really important because without it wouldn't be possible to work with large dataset.

Highlights

New GraphQL format

In order to support pagination we had to make some significant changes to the GraphQL API, as a result the format of the query has changed significantly.

If you are using the SDK, these changes should be transparent to you as the client providing a layer of abstraction on top of GraphQL.

The new format of the GraphQL schema is inspired from the GraphQL Relay format that recommend to have

  • All relationship wrap into a node container
  • All list of relationship wrap into an edges container

The query below is using the new format. and it's showing how to control the pagination with limit and offset as well as how to query the total number of objects with count

query($device: String!) {
  device(name__value: $device, limit: 20, offset: 40) {
    count
    edges {
      node {
        id
        name {
          value
        }
        asn {
          node {
            asn {
              value
            }
          }
        }
        interfaces {
          count
          edges {
            properties {
                source: {
                   id
                }
            }
            node {
              id
              name {
                value
              }
            }
          }
        }
      }
    }
  }

Improved tooling to develop your own Jinja Templates and Python Transform function

Improved infrahubctl render command to develop your Jinja template locally

The command infrahubctl render provides better error message to help you develop your jinja template faster.

new infrahubctl validate graphql-query command to validate your GraphQL query

Schema: order_by

The schema now supports a new order_by attribute on all nodes and generics

order_by must be a List of attribute or relationship pointer like name__value or role__name__value

  - name: autonomous_system
    kind: AutonomousSystem
    order_by: ["asn__value"]

Changelog

User facing Changes

  • Add support for pagination in GraphQL, in the frontend and in the Python SDK
  • Add support for result ordering
  • Add ability to filter branches in GraphQL
  • Improve import of resources from a Git Repository
  • Add new command to generate the jsonschema file of some user facing files
  • Documentation Update
  • Configure logging to use structlog
  • Add support for Python 3.11

Internal Changes

  • Replaced the GraphQL client in the frontend with the Apollo Client for GraphQL
  • Replaced React Create Application with Vite
  • Replaced Jest with Vitest for Frontend unit tests
  • Added more unit & integration tests based on Vitest and Cypress
  • Changed the schema of the internal Graph to attach node to a root element
  • Add a feature flag mechanism to control experimental features both on the backend and on the frontend
  • Replaced Flake8 with Ruff for linting
  • Expose execution time metric per Neo4j query
  • Initial work to support authentication in the backend.

Migration Guide

It's mandatory to completely rebuild your environment with the following commands.

invoke demo.destroy demo.build demo.init demo.start
invoke demo.load-infra-schema
invoke demo.load-infra-data

All data will be lost, please make sure to backup everything you need before running this command.

The repository https://github.com/opsmill/infrahub-demo-edge has been updated to reflect the latest format of the GraphQL API
it's recommend to pull the latest changes into your fork otherwise it won't work with the latest version of Infrahub.

Don't miss a new infrahub release

NewReleases is sending notifications on new releases.