feat(userbot): prereqs at startup, SPA path guard, provision lock
ci / lint-prettier (push) Failing after 8s
ci / lint-ruff (push) Successful in 4s
ci / lint-yaml (push) Failing after 7s
ci / lint-dockerfiles (push) Successful in 4s
ci / validate (push) Successful in 5s
deploy / redeploy (push) Failing after 0s
ci / build (push) Has been skipped
ci / deploy-userbot-panel (push) Has been skipped
ci / lint-prettier (push) Failing after 8s
ci / lint-ruff (push) Successful in 4s
ci / lint-yaml (push) Failing after 7s
ci / lint-dockerfiles (push) Successful in 4s
ci / validate (push) Successful in 5s
deploy / redeploy (push) Failing after 0s
ci / build (push) Has been skipped
ci / deploy-userbot-panel (push) Has been skipped
- ensure_prerequisites runs on startup, not per-request; kube config errors surface as 503 PanelError - serialize provisioning with a lock; drop per-endpoint prereq checks - guard SPA fallback against path traversal (relative_to) - add backend tests for auth flow, k8s service, spa routing; ci comment for legacy userbot deployments
This commit is contained in:
1 parent
861d89d36a
commit
d9f1c8325a
10 files changed
+191
-34
No files matched your search
@@ -80,6 +80,27 @@ def test_partial_provision_rolls_back_only_created_resources() -> None:
|
||||
kube.apps.delete_namespaced_deployment.assert_not_called()
|
||||
|
||||
|
||||
def test_provision_conflict_reports_existing_instance() -> None:
|
||||
kube = service()
|
||||
kube.assert_available = Mock()
|
||||
kube.apps.create_namespaced_deployment.side_effect = ApiException(status=409)
|
||||
|
||||
with pytest.raises(PanelError) as error:
|
||||
kube.provision(account(), "SESSION")
|
||||
|
||||
assert error.value.status_code == 409
|
||||
assert "already exists" in error.value.detail
|
||||
# Partial resources created before the 409 must be rolled back.
|
||||
kube.core.delete_namespaced_secret.assert_called_once_with(
|
||||
"userbot-test-account-credentials",
|
||||
"userbot",
|
||||
)
|
||||
kube.core.delete_namespaced_persistent_volume_claim.assert_called_once_with(
|
||||
"userbot-test-account-data",
|
||||
"userbot",
|
||||
)
|
||||
|
||||
|
||||
def test_delete_retains_pvc_unless_explicitly_requested() -> None:
|
||||
kube = service()
|
||||
deployment = SimpleNamespace(
|
||||
|
||||
Reference in new issue
Block a user