Flows and dashboards are created by POST under an issued or superuser-pinned id; PUT only updates; deleted flows leave a tombstone with their key; the controller stores by id and runs by key, hooks live under /hooks/<flow id>; a key with state or queued work behind it is refused until cleared

This commit is contained in:
2026-11-02 17:41:23 +01:00
parent fae85f5ecb
commit 08a6376836
63 changed files with 2832 additions and 936 deletions
+7 -8
View File
@@ -7,6 +7,7 @@ from sqlmodel import Session, select
from fluksio.core.config import settings
from fluksio.core.db import seed_flavors
from fluksio.models import Flavor
from tests.utils.flows import put_flow
def test_an_instance_starts_with_sizes_to_pick_from(
@@ -97,12 +98,11 @@ def test_a_flow_cannot_name_a_size_that_does_not_exist(
client: TestClient, superuser_token_headers: dict[str, str]
) -> None:
"""Caught at the save, which covers the canvas and `fluksio sync` at once."""
response = client.put(
f"{settings.API_V1_STR}/flows/flavor_check",
response = client.post(
f"{settings.API_V1_STR}/flows/",
headers=superuser_token_headers,
json={
"name": "flavor_check",
"version": 1,
"nodes": [
{"id": "fit", "type": "python", "resources": {"flavor": "imaginary"}}
],
@@ -120,12 +120,11 @@ def test_a_size_a_node_still_asks_for_is_not_deleted(
headers=superuser_token_headers,
json={"name": "in-use", "cpus": 2},
)
client.put(
f"{settings.API_V1_STR}/flows/flavor_user",
headers=superuser_token_headers,
json={
put_flow(
client,
superuser_token_headers,
{
"name": "flavor_user",
"version": 1,
"nodes": [
{"id": "fit", "type": "python", "resources": {"flavor": "in-use"}}
],