Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/schemas/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Allowed lifetime presets matching the Wizard dropdown.
# Keep this in sync with appstore-frontend/src/pages/DeploymentWizard.tsx.
ALLOWED_RUNTIME_MONTHS = (1, 3, 4, 6, 12, 24)
ALLOWED_RUNTIME_MONTHS = (1, 3, 4, 6, 12, 24, 36)
DEFAULT_RUNTIME_MONTHS = 4


Expand Down
2 changes: 1 addition & 1 deletion src/utils/deployment_expiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
WARNING_FRACTION_OF_RUNTIME = 0.25

# Average month length used to derive timedelta from ``runtime_months``. Calendar
# months vary; over 1..24 months this ~30.44-day approximation drifts at most a
# months vary; over 1..36 months this ~30.44-day approximation drifts at most a
# day or two from the calendar date — acceptable for an expiry deadline.
DAYS_PER_MONTH = 30

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_deployment_expiry_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def _now() -> datetime:
return datetime(2026, 6, 20, 12, 0, 0, tzinfo=timezone.utc)


@pytest.mark.parametrize("months", [1, 3, 4, 6, 12, 24])
@pytest.mark.parametrize("months", [1, 3, 4, 6, 12, 24, 36])
def test_compute_expiry_returns_two_future_timestamps(months: int):
"""expires_at and expiry_warning_at must both be in the future."""
now = _now()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_deployment_runtime_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ def test_default_runtime_months_is_4():

def test_allowed_set_matches_wizard_dropdown():
"""Backend's allowed set must match the Wizard <Select> options exactly."""
assert set(ALLOWED_RUNTIME_MONTHS) == {1, 3, 4, 6, 12, 24}
assert set(ALLOWED_RUNTIME_MONTHS) == {1, 3, 4, 6, 12, 24, 36}


@pytest.mark.parametrize("months", [1, 3, 4, 6, 12, 24])
@pytest.mark.parametrize("months", [1, 3, 4, 6, 12, 24, 36])
def test_extend_accepts_each_allowed_runtime(months: int):
"""Every dropdown option must validate."""
extend = DeploymentExtend(runtime_months=months)
assert extend.runtime_months == months


@pytest.mark.parametrize("bad", [0, -1, 2, 5, 7, 18, 36, 100])
@pytest.mark.parametrize("bad", [0, -1, 2, 5, 7, 18, 48, 100])
def test_extend_rejects_disallowed_runtime(bad: int):
"""Anything outside the wizard's offered set must fail validation."""
with pytest.raises(ValidationError):
Expand Down
Loading