Skip to content

Commit 7824c4a

Browse files
authored
Merge pull request #5757 from opsmill/stable
Merge stable into develop
2 parents a2302e8 + b453fec commit 7824c4a

File tree

7 files changed

+55
-26
lines changed

7 files changed

+55
-26
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
# yamllint disable rule:truthy
3-
name: Publish Infrahub-Server Package
4-
3+
name: Publish Infrahub-Server, Infrahub-Testcontainers Packages
54
on:
65
workflow_dispatch:
76
inputs:
@@ -30,39 +29,40 @@ on:
3029

3130
jobs:
3231
publish_to_pypi:
33-
name: "Publish Infrahub SDK to PyPI"
32+
name: "Publish Infrahub-Server and Infrahub-Testcontainers to PyPI"
3433
runs-on: "ubuntu-22.04"
34+
strategy:
35+
matrix:
36+
package_dir: ["", "python_testcontainers"]
3537
steps:
3638
- name: "Set up Python"
3739
uses: "actions/setup-python@v5"
3840
with:
3941
python-version: "3.12"
40-
4142
- name: "Install Poetry"
4243
uses: "snok/install-poetry@v1"
4344
with:
4445
version: 1.8.5
4546
virtualenvs-create: true
4647
virtualenvs-in-project: true
4748
installer-parallel: true
48-
4949
- name: "Check out repository code"
5050
uses: "actions/checkout@v4"
5151
with:
5252
submodules: true
53-
5453
- name: "Install Dependencies"
5554
run: "poetry install"
56-
55+
working-directory: ${{ matrix.package_dir }}
5756
- name: "Add PyPI secret"
5857
run: "poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}"
59-
58+
working-directory: ${{ matrix.package_dir }}
6059
- name: "Poetry build"
6160
run: "poetry build"
62-
61+
working-directory: ${{ matrix.package_dir }}
6362
- name: "show output"
6463
run: "ls -la dist/"
65-
64+
working-directory: ${{ matrix.package_dir }}
6665
- name: "Poetry push PyPI"
6766
if: ${{ inputs.publish }}
6867
run: "poetry publish"
68+
working-directory: ${{ matrix.package_dir }}

.vale/styles/spelling-exceptions.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ graphene
5151
graphiql
5252
graphql
5353
greymatter
54+
healthcheck
5455
hfid
5556
hfids
5657
hostname
@@ -95,6 +96,7 @@ order_weight
9596
openconfig
9697
opentelemetry
9798
order_by
99+
Postgress
98100
Prefetch
99101
profile_name
100102
pseudocode

changelog/5739.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix Docker task-manager-db Postgress healthcheck test by adding database and user parameters.

development/docker-compose-deps-nats.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ services:
4949
volumes:
5050
- workflow_db:/var/lib/postgresql/data
5151
healthcheck:
52-
test: ["CMD-SHELL", "pg_isready"]
52+
test:
53+
- "CMD-SHELL"
54+
- "pg_isready -q -d ${INFRAHUB_TASKMANAGER_DB_DATABASE:-prefect} -U ${INFRAHUB_TASKMANAGER_DB_USER:-postgres}"
5355
interval: 10s
5456
timeout: 5s
5557
retries: 5

development/docker-compose-deps.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ services:
5151
volumes:
5252
- workflow_db:/var/lib/postgresql/data
5353
healthcheck:
54-
test: ["CMD-SHELL", "pg_isready"]
54+
test:
55+
- "CMD-SHELL"
56+
- "pg_isready -q -d ${INFRAHUB_TASKMANAGER_DB_DATABASE:-prefect} -U ${INFRAHUB_TASKMANAGER_DB_USER:-postgres}"
5557
interval: 10s
5658
timeout: 5s
5759
retries: 5

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ services:
199199
volumes:
200200
- workflow_db:/var/lib/postgresql/data
201201
healthcheck:
202-
test: ["CMD-SHELL", "pg_isready"]
202+
test:
203+
- "CMD-SHELL"
204+
- "pg_isready -q -d ${INFRAHUB_TASKMANAGER_DB_DATABASE:-prefect} -U ${INFRAHUB_TASKMANAGER_DB_USER:-postgres}"
203205
interval: 10s
204206
timeout: 5s
205207
retries: 5

docs/docs/topics/computed-attributes.mdx

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,36 @@
22
title: Computed attributes
33
---
44

5-
The computed attributes feature enables the dynamic calculation of attribute values based on user-defined logic. Currently, Infrahub supports two main types of computed attributes: **Jinja2** and **Python**.
5+
The computed attributes feature enables the dynamic calculation of attribute values based on user-defined logic.
6+
7+
Currently, Infrahub supports two main types of computed attributes:
8+
9+
* **Jinja2** – Lightweight, but limited in relationship handling.
10+
* **Python** – More flexible and powerful, but requires async execution.
11+
12+
::::info Limitations
13+
14+
Computed attributes have some inherent restrictions due to system constraints and performance considerations. Keep these in mind when designing your schema:
15+
16+
* Computed attributes **can only** be used on nodes, not generics.
17+
* Only `URL` and `Text` attribute kinds are supported for computed attributes.
18+
19+
::::
620

721
## Jinja2 computed attributes {#jinja-computed-attribute}
822

923
Users can input a concise Jinja2 template directly within the schema definition. Any change to any field used to compute the value will automatically update it.
1024

1125
See the [guide](../guides/computed-attributes) for instructions on creating Jinja2 computed attribute in Infrahub.
1226

13-
### Limitations
27+
### Restrictions
28+
29+
::::warning
30+
31+
* Jinja2 computed attributes **cannot** reference relationships with cardinality `many`.
32+
* Only **direct** relationships can be used (i.e., a relationship of a relationship is not accessible).
1433

15-
- Jinja2 computed attributes cannot reference relationships with cardinality `many`.
16-
- Only direct relationships can be used (i.e., a relationship of a relationship is not accessible).
17-
- Only `URL` and `Text` attribute kinds are supported at the moment.
34+
::::
1835

1936
## Python computed attributes {#python-computed-attribute}
2037

@@ -24,17 +41,20 @@ Python scripts do not have the limitations of Jinja2 computed attributes and can
2441

2542
See the [guide](../guides/computed-attributes) for instructions on creating Python computed attribute in Infrahub.
2643

27-
### Limitations
44+
### Restrictions
45+
46+
::::warning
47+
48+
* Mandatory attributes **cannot** use Python computed attributes.
49+
* Complex scripts **may impact system performance**.
2850

29-
- Python computed attributes cannot be used on mandatory attribute.
30-
- Complex scripts can impact system performance.
31-
- Only `URL` and `Text` attribute kinds are supported at the moment.
51+
::::
3252

3353
## Choosing Between Jinja2 and Python
3454

35-
Computed attribute kind | Mandatory attributes | Relationship limitations | Complexity Handling
36-
------------------------|----------------------|-------------------------------------------|---------------------
37-
Jinja2 | Compatible | No use of `many` cardinality; direct only | Straightforward operations
38-
Python | Not compatible | No limitations | Handles complex logic
55+
| Computed Attribute Kind | Mandatory Attribute Support | Relationship Constraints | Complexity Handling |
56+
|-------------------------|-----------------------------|----------------------------------------------------------|---------------------------------------|
57+
| **Jinja2** | ✅ Supported | Cannot use `many` cardinality; only direct relationships | Best for straightforward operations |
58+
| **Python** | ❌ Not supported | No restrictions | Suitable for complex logic |
3959

4060
See the [guide](../guides/computed-attributes) for instructions on creating computed attribute in Infrahub.

0 commit comments

Comments
 (0)