-
Notifications
You must be signed in to change notification settings - Fork 1
2026-1-2 Updates #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
2026-1-2 Updates #15
Changes from all commits
306b68a
9a09a09
87581a5
67073c3
6b38aae
1bbf56b
1b6be06
12255f5
097d2f9
0b453be
4e6b6c3
33ea2bf
a8040a8
b6fefdb
29ab643
b158b33
0f63800
fe3f7f1
ca25193
7b7633a
e8c973d
89fb36e
3441eba
47d4f71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| schema: "{{ infrahub_server_url }}/schema.graphql" | ||
| documents: "**/*.gql" |
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||
| # yaml-language-server: $schema=https://schema.infrahub.app/python-sdk/repository-config/latest.json | ||||||
| --- | ||||||
| # https://docs.infrahub.app/reference/dotinfrahub | ||||||
| schemas: # Schema definitions to load (files or directories) | ||||||
| - schemas | ||||||
|
|
||||||
| {% if objects %} | ||||||
| objects: # Object definitions to load (files or directories) | ||||||
| - objects | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| {% endif %} | ||||||
| {% if menus %} | ||||||
| menus: # Menu definitions to load (files or directories) | ||||||
| - menus | ||||||
|
|
||||||
| {% endif %} | ||||||
| {% if transforms %} | ||||||
| jinja2_transforms: | ||||||
| - name: <string> | ||||||
| query: <string> | ||||||
| template_path: transforms/templates/<string>.j2 | ||||||
|
|
||||||
| python_transforms: | ||||||
| - name: <string> | ||||||
| file_path: transforms/<string>.py | ||||||
|
|
||||||
| {% endif %} | ||||||
| {% if generators %} | ||||||
| generator_definitions: | ||||||
| - name: <string> | ||||||
| file_path: generators/<string>.py | ||||||
| query: <string> | ||||||
| targets: <string> | ||||||
|
|
||||||
| {% endif %} | ||||||
| queries: | ||||||
| - name: <string> | ||||||
| file_path: queries/<string>.gql | ||||||
|
|
||||||
| {% if checks %} | ||||||
| check_definitions: | ||||||
| - name: <string> | ||||||
| file_path: checks/<string>.py | ||||||
|
|
||||||
| {% endif %} | ||||||
| artifact_definitions: | ||||||
| - name: <string> | ||||||
| parameters: {} | ||||||
| content_type: <string> | ||||||
| targets: <string> | ||||||
| transformation: <string> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.14.10 | ||
| hooks: | ||
| # Run the linter. | ||
| - id: ruff-check | ||
| args: [--fix] | ||
| # Run the formatter. | ||
| - id: ruff-format | ||
| - repo: https://github.com/adrienverge/yamllint.git | ||
| rev: v1.37.1 | ||
| hooks: | ||
| - id: yamllint | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-merge-conflict | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| exclude: ^\.vscode/|/\.vscode/ | ||
| - id: mixed-line-ending | ||
| - id: trailing-whitespace |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| { | ||
| "recommendations": [ | ||
| "charliermarsh.ruff", | ||
| "ms-python.python", | ||
| "opsmill.infrahub", | ||
| "redhat.vscode-yaml", | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "python.defaultInterpreterPath": ".venv/bin/python3", | ||
| "python.testing.pytestArgs": [ | ||
| "tests" | ||
| ], | ||
| "python.testing.unittestEnabled": true, | ||
| "python.testing.pytestEnabled": true, | ||
| "infrahub-vscode.servers": [ | ||
| { | ||
| "name": "{{ project_name }}", | ||
| "address": "{{ infrahub_server_url }}", | ||
| "api_token": "{{ infrahub_api_token }}" | ||
| } | ||
| ], | ||
| "[yaml]": { | ||
| "editor.defaultFormatter": "redhat.vscode-yaml", | ||
| "editor.formatOnSave": true, | ||
| "files.trimTrailingWhitespace": true, | ||
| "files.insertFinalNewline": true | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,99 @@ | ||
| --- | ||
| _envops: | ||
| lstrip_blocks: true | ||
| trim_blocks: true | ||
|
|
||
| project_name: | ||
| type: str | ||
| help: The name for your new Infrahub repository. This will be used as the package name. | ||
| help: Name for this Infrahub repository (also used as the package name). | ||
| validator: >- | ||
| {% if not (project_name | regex_search('^[a-z][a-z0-9\-]+$')) %} | ||
| project_name must start with a letter, followed one or more letters, digits or dashes all lowercase. | ||
| {% endif %} | ||
| qmark: 📔 | ||
|
|
||
| is_local_development: | ||
| type: bool | ||
| default: true | ||
| help: Is this repository intended for local development only? If false, additional configuration options will be requested. | ||
| qmark: 🏗️ | ||
|
|
||
| default_infrahub_branch: | ||
| # Only ask if not a local development project | ||
| when: "{{ not is_local_development }}" | ||
| type: str | ||
| nullable: true | ||
| help: Branch name to use instead of the server default. Leave empty to use the server default. | ||
| validator: >- | ||
| {% if not default_infrahub_branch and (default_infrahub_branch | regex_search('^[A-Za-z][A-Za-z0-9\-_]+$')) %} | ||
| default_infrahub_branch must start with a letter, followed one or more letters, digits or dashes. | ||
| {% endif %} | ||
| qmark: 🌲 | ||
|
|
||
| infrahub_server_url: | ||
| # Only ask if not a local development project | ||
| when: "{{ not is_local_development }}" | ||
| type: str | ||
| default: http://localhost:8000 | ||
| help: URL of the Infrahub server (e.g., http://host:port or https://host). | ||
| validator: >- | ||
| {% if infrahub_server_url and not (infrahub_server_url | regex_search('^https?:\/\/[A-Za-z][A-Za-z0-9\-_]+(?::(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]?\d{1,4}))?$')) %} | ||
| Invalid url. Must be something like `http://<host>:<port_num>` or `https://<host>` | ||
| {% endif %} | ||
| qmark: 🖥️ | ||
|
|
||
| infrahub_api_token: | ||
| # Only ask if not a local development project | ||
| when: "{{ not is_local_development }}" | ||
| type: str | ||
| default: 06438eb2-8019-4776-878c-0941b1f1d1ec | ||
| help: API token for authentication. | ||
| qmark: 🔐 | ||
|
|
||
| objects: | ||
| type: bool | ||
| help: >- | ||
| Enable support for Infrahub object files. | ||
| default: false | ||
| help: Include support for object files (preloads data entries). | ||
| qmark: 🗃️ | ||
|
|
||
| generators: | ||
| type: bool | ||
| help: >- | ||
| Enable support for Infrahub data generators. | ||
| Generators are plugins that create objects based on input data in Infrahub. | ||
| default: false | ||
| help: Include support for data generators (plugins that create objects from input data). | ||
| qmark: ⚙️ | ||
|
|
||
| transforms: | ||
| type: bool | ||
| help: >- | ||
| Enable support for Infrahub data transforms. | ||
| A Transformation is a generic plugin to transform a dataset into a different format to simplify it's ingestion by third-party systems. | ||
| default: false | ||
| help: Include support for data transforms (Jinja2 & Python plugins that convert data for third-party systems). | ||
| qmark: 🏗️ | ||
|
|
||
| scripts: | ||
| type: bool | ||
| help: Include a 'scripts/' directory for custom automation scripts that interact with the Infrahub API. | ||
| default: false | ||
| help: Include a `scripts/` directory for custom automation scripts." | ||
| qmark: 📜 | ||
|
|
||
| menus: | ||
| type: bool | ||
| help: Include a 'menus/' directory and configuration to define custom navigation menus in the Infrahub UI. | ||
| default: false | ||
| help: Include a `menus/` directory for custom UI navigation menus. | ||
| qmark: ⚙️ | ||
|
|
||
| checks: | ||
| type: bool | ||
| default: false | ||
| help: Include a `checks/` directory for custom validation logic. | ||
| qmark: ✅ | ||
|
|
||
| tests: | ||
| type: bool | ||
| help: Set up a Python testing environment with pytest for integration testing your schemas and data. | ||
| default: false | ||
| help: Include a pytest environment for integration testing schemas and data. | ||
| qmark: 🧪 | ||
|
|
||
| package_mode: | ||
| type: bool | ||
| help: Initialize the repository as an installable Python package (with pyproject.toml). | ||
| default: false | ||
| help: Configure as an installable Python package with pyproject.toml. | ||
| qmark: 📦 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| server_address="{{ infrahub_server_url }}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this rendered and not sure if there is an option/question for this? Maybe just add this to the README.md? I'd rather than enforce this via the config file by default. |
||
| api_token="{{ infrahub_api_token }}" | ||
| {% if infrahub_default_branch and infrahub_default_branch not in ["", "main"] %} | ||
| default_branch="{{ infrahub_default_branch }}" | ||
| {% endif %} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears we generate an
schemas/example.ymlfile. We should update this to include the path to this example.