carlos / platform Public

console: claim census door for the Environments form Save

POST /a/{sqid}/apps/{app}/settings/environments writes the app's config
through writeConfig and appconfig.ApplyAtVersion under the app mutation,
so it is registered as a door beside the config PUT: a Save of one new
default-bundle var at the bundle's current version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev ceaaed997fc3753a2234d6769818be2608a6d593 parent 6b53c2a
2 files changed, +17 −0
  • internal/console/claim_invariant_fixtures_test.go +16 −0
  • internal/console/testdata/claim-routes.txt +1 −0
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go
index a2761aae0..3ab1594ff 100644
--- a/internal/console/claim_invariant_fixtures_test.go
+++ b/internal/console/claim_invariant_fixtures_test.go
@@ -1367,6 +1367,22 @@ var claimFixtures = map[string]claimFixture{
},
do: claimForm("/a/bab/apps/kass/rollback", "channel", "canary/x", "confirmed", "1"),
}},
+ // The settings Environments form's Save (envform.go, envsave.go) is the
+ // config PUT's browser twin: the same writeConfig, through appconfig's
+ // ApplyAtVersion under the app mutation. It states the version it was
+ // drawn from, so the form is built from the bundle as it is now.
+ "route POST /a/{sqid}/apps/{app}/settings/environments": {door: &claimDoor{
+ apps: claimRefs("bab/titogo"),
+ do: func(t *testing.T, cx *claimCase) int {
+ _, ver, err := appconfig.GetBundle(context.Background(), cx.rel, "bab", "titogo", "")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return claimForm("/a/bab/apps/titogo/settings/environments",
+ "op", "save", "bundle", appconfig.DefaultBundle, "ver."+appconfig.DefaultBundle, ver.String(),
+ "new."+appconfig.DefaultBundle+".PORT", "8080")(t, cx)
+ },
+ }},
"route POST /a/{sqid}/apps/{app}/store/destroy": {door: &claimDoor{
apps: claimRefs("bab/titogo"),
setup: func(t *testing.T, cx *claimCase) {
diff --git a/internal/console/testdata/claim-routes.txt b/internal/console/testdata/claim-routes.txt
index 0875511de..7f884a328 100644
--- a/internal/console/testdata/claim-routes.txt
+++ b/internal/console/testdata/claim-routes.txt
@@ -200,6 +200,7 @@ route POST /a/{sqid}/apps/{app}/region
route POST /a/{sqid}/apps/{app}/rename
route POST /a/{sqid}/apps/{app}/restart
route POST /a/{sqid}/apps/{app}/rollback
+route POST /a/{sqid}/apps/{app}/settings/environments
route POST /a/{sqid}/apps/{app}/star
route POST /a/{sqid}/apps/{app}/store/destroy
route POST /a/{sqid}/apps/{app}/swap