Repository navigation
docs(organizations): document the service, and add the SDK-level journey (#578) - #614
Merged
Merged
Conversation
The docs/services.md Organizations section still described the five operations that existed before this milestone. It now covers all thirty: the OU tree, the policy lifecycle, asynchronous vending, tagging, the refusal table, the quotas with their User Guide values, pagination, and both seed endpoints. The journey test is the part that earns its keep. It goes through the real Organizations client rather than a hand-built request, which is the only level that catches the plugin being unreachable — #610 was exactly that, and it found a second bug of the same class immediately: Organizations timestamps were RFC3339 strings. The JSON 1.1 protocol carries a timestamp as epoch seconds, and aws-sdk-go-v2 calls ParseEpochSeconds on the member, so every SDK caller got "deserialization failed" from ListAccounts, CreateAccount and DescribeCreateAccountStatus while the operations themselves were correct. JoinedAt, RequestedTimestamp and CompletedTimestamp now use the existing EpochSeconds type. The unit tests had decoded those members as strings and so asserted the broken form; they now assert the number, and ListAccounts gained the JoinedTimestamp assertion it never had. Three journeys: the vending run (stable root, create → poll → move, then a re-run that must hit DuplicateAccountException rather than silently duplicating), the seeded async failure (200 from CreateAccount, and only DescribeCreateAccountStatus reveals FAILED), and the disabled-SCP state (CreatePolicy succeeds, AttachPolicy is refused, re-enabling restores only p-FullAWSAccess). All assert through the SDK's typed exceptions, since errors.As on the typed error is the branch a consumer actually takes. Mutation testing, five targets from the plan, all CAUGHT: the persisted root reverted to per-call generation, the OU depth boundary off by one, the minimum-one-SCP guard dropped, MoveAccount's destination-equals-parent check removed, and the MaxResults upper clamp dropped. Part of #578.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #578.
The last piece of the v0.97.0 Organizations milestone: the service reference, the
SDK-level journey, and the changelog for the four lanes that landed without one.
A bug the journey found
Organizations timestamps were RFC3339 strings. The JSON 1.1 protocol carries a
timestamp as epoch seconds, and aws-sdk-go-v2 calls
ParseEpochSecondson themember — so a string failed the whole response and every SDK caller got
deserialization failedfromListAccounts,CreateAccountandDescribeCreateAccountStatus, while the operations behind them were correct.JoinedAt,RequestedTimestampandCompletedTimestampnow use the existingEpochSecondstype. The unit tests had decoded those members asstringand soasserted the broken form; they now assert the number, and
ListAccountsgained theJoinedTimestampassertion it never had.This is the second bug of #610's class in this milestone — correct, unit-tested,
and unreachable from any SDK. That is what the journey level exists for.
What changed
docs/services.md— the section covered the five operations that predatedthis milestone. It now covers all thirty, plus
p-FullAWSAccess, asynchronousvending, the disabled-SCP state, how tags reach the authorization decision, the
refusal table, the quotas with their User Guide values, pagination, and both seed
endpoints. Notes that
CreateOrganizationis deliberately absent: theorganization already exists on first contact.
test/e2e/journey_organizations_test.go— three journeys through the realorganizationsclient, all asserting via typed exceptions sinceerrors.Asonthe typed error is the branch a consumer's handling actually takes:
ListRoots, OU with a create-timetag read back, create → poll → move, both listings agreeing on placement, then
the re-run hitting
DuplicateAccountExceptionandSourceParentNotFoundExceptionrather than silently duplicating;CreateAccountstill answers 200, and onlyDescribeCreateAccountStatusrevealsFAILED/EMAIL_ALREADY_EXISTS/noAccountId;p-FullAWSAccess, the lastSCP cannot be detached,
CreatePolicysucceeds while the type is disabled,AttachPolicyis refused, and re-enabling restoresp-FullAWSAccessalone.CHANGELOG.md— the OU tree, the policy lifecycle, and asynchronous vending(the three lanes that landed without an entry), plus organizations: every SDK call answers "service not emulated" — the X-Amz-Target prefix has no alias #610 and the timestamp fix.
Verification
gofmt -l .clean;go build ./...;go vet ./...;golangci-lint run ./...(0 issues);
make test(race detector);make docs-reference docs-reference-check docs-versions;npm --prefix docs run build;go vet -C test/e2e ./...andgo test -C test/e2e ./....Mutation testing, the five targets the plan named, all CAUGHT on a
full-package
-racerun with a verified-green baseline before and after:TestOrganizations_OUDepthLimitTestOrganizations_MinAttachmentFloorMoveAccount's destination-equals-parent check removedTestOrganizations_FullVend,TestOrganizations_VendingRefusalsMaxResultsupper clamp droppedTestOrganizations_PaginateLive server (
:4678,AWS_MAX_ATTEMPTS=1, scratch dir since removed): stableroot across two
ListRoots;JoinedTimestampnow parsing into a datetime insteadof failing; OU tree with the 6th level refused as
OU_DEPTH_LIMIT_EXCEEDED; vend →poll → move →
DuplicateAccountExceptionon the re-run;ListParentsreporting theOU; an
aws:-prefixed tag refused on create withINVALID_SYSTEM_TAGS_PARAMETER;the full disabled-SCP journey; the seeded failure answering 200 with only the status
revealing
FAILED; andAccountNotFoundExceptionat HTTP 400.