Repository navigation
feat(quotas): seed the organizations service quotas (#620) - #627
Merged
Merged
Conversation
`organizations` was in neither Service Quotas seed table, so `L-E619E033` — the accounts-per-organization ceiling — answered `NoSuchResourceException`. `CreateAccount` worked but nothing could read the limit it runs into. Found by driving a consumer against `substrate server` at v0.97.0, not by reading the API model. The three quotas are seeded at the values substrate's Organizations plugin actually enforces, asserted against `orgMaxAccounts`/`orgMaxSCPsPerOrg`/ `orgMaxOUsPerOrg` directly: a quota table that disagrees with its own emulator is worse than a missing one, because a test written against the published number would fail for a reason unrelated to the code under test. #620 reported SCPs and OUs as 1,000 each; both AWS pages and substrate's constants say 10,000 and 2,000. The two seed tables are maintained by hand and read by different operations, so a service in one and not the other is either undiscoverable or discoverable with no quotas — invisible in any single response. A test now pins the two together, closing that drift for the existing ten services too. Also fixes the refusals that made the gap hard to diagnose. An unrecognized service code on `ListServiceQuotas` was HTTP 200 with an empty list, which claims the service exists and publishes nothing; it now answers `NoSuchResourceException`, the error the model declares. `GetServiceQuota` distinguishes an unknown service from an unknown quota code in the message, since both carry the only code the model gives them. A missing required member is `IllegalArgumentException` rather than a not-found for a resource the request never named. Closes #620
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Aug 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
organizationswas in neither Service Quotas seed table, soL-E619E033— the accounts-per-organization ceiling — answeredNoSuchResourceException.CreateAccountworked but nothing could read the limit it runs into. Like #619, this was found by driving a consumer againstsubstrate serverat v0.97.0 rather than by reading the API model.The quotas
L-E619E033L-29A0C5DFL-0F0F51F4Each value is the one substrate's Organizations plugin actually enforces, and a test asserts that against
orgMaxAccounts/orgMaxSCPsPerOrg/orgMaxOUsPerOrgdirectly rather than against a copied literal. A quota table that disagreed with its own emulator would be worse than a missing one: a test written against the published number would fail for a reason unrelated to the code under test.All three are
GlobalQuota: true— Organizations is a global service hosted inus-east-1.A correction to the issue
#620 gives SCPs-per-organization and OUs-per-organization as 1,000 each. Both Endpoints and quotas and the User Guide say 10,000 and 2,000, matching substrate's own constants. Same class of error as #578's RCP-for-SCP mixup, so the corrected values ship.
Provenance of the quota codes
Only
L-E619E033's code is confirmable from AWS documentation: the endpoints page publishes a quota code only for the adjustable quotas, and that is the adjustable one.L-29A0C5DFandL-0F0F51F4come from #620's report; the User Guide warns that quota codes may change and says to useListServiceQuotasto discover them. Their values are documented and cited. This will be repeated in the release notes'## Provenancesection.The two-table drift
defaultServiceQuotasis read only byListServiceQuotas/GetServiceQuota,defaultServiceListonly byListServices, and both are maintained by hand. A service added to one and not the other is either undiscoverable or discoverable with no quotas, and neither state is visible in any single response.TestServiceQuotas_TheTwoTablesAgreenow pins the two together on every service code and name, which closes that drift for the existing ten services as well.The refusals that made this hard to diagnose
ListServiceQuotasfor an unknown service was HTTP 200 with{"Quotas": []}. That claims this service exists and publishes no quotas — a different statement from there is no such service, and only the second is true of a code substrate does not carry. It now answersNoSuchResourceException, which the model declares for this operation.GetServiceQuota/GetAWSDefaultServiceQuotacould not distinguish an unknown service from an unknown quota code. Both areNoSuchResourceException— the only code the model declares — so the message is the sole place they can differ: an unknown service names the service and points atListServices, an unknown quota code names the code and points atListServiceQuotas. Conflating them is what sends a caller to audit a quota code when the service name was wrong.IllegalArgumentException, also from the model's error list, rather than a not-found for a resource the request never named.Verification
gofmt,go build,go vet,golangci-lint run ./...— 0 issuesmake test(race detector) green;make coverageat 81.5% total, 82.2% foremulator. Every function touched here is at 100% statement coverage.make docs-reference docs-reference-check docs-versions;npm --prefix docs run buildgo vet -C test/e2e ./...andgo test -C test/e2e ./...green, including the newTestJourney_ServiceQuotasOrganizations— the level that catches an unrouted operation, since the SDK's SigV4 name (servicequotasv20190624) and target prefix are neither of them the plugin name.substrate server --address :4678withAWS_MAX_ATTEMPTS=1, running Service Quotas: organizations is not seeded, so L-E619E033 (accounts per organization) reads as NoSuchResourceException #620's repro verbatim:get-service-quota organizations L-E619E033reads 10 / adjustable,list-service-quotasreturns all three,list-servicesnames it once, both unknown-service refusals arrive with distinguishable messages, and a pending increase leaves the quota reading 10.defaultServiceListentry removed (caught by 2 tests), the unknown-service check reverted to the empty list, the two refusals conflated, the accounts value drifted off the enforced limit (caught by 3 tests), and the required-member check dropped (caught by 2). All caught, no survivors. Three more against Organizations: DescribeResourcePolicy/PutResourcePolicy are unimplemented, so delegated administration cannot be observed #619's merged code — re-minting the resource-policy ID on replacement, the 40,000-character bound off by one, and delete made a silent no-op — were also all caught.Out of scope
The hardcoded
accountID := "000000000000"inrequestServiceQuotaIncreaseand friends, filed as #624:HandleRequestdiscards theRequestContext, so increases are recorded under a placeholder account rather than the caller's. A real defect, but a separate concern from #620.Closes #620