Skip to content

docs(organizations): document the service, and add the SDK-level journey (#578) - #614

Merged
scttfrdmn merged 1 commit into
mainfrom
docs/organizations-v0.97.0
Aug 9, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
docs/organizations-v0.97.0

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

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 ParseEpochSeconds on the
member — so a string failed the whole response and every SDK caller got
deserialization failed from ListAccounts, CreateAccount and
DescribeCreateAccountStatus, while the operations behind them were correct.

JoinedAt, RequestedTimestamp and CompletedTimestamp now use the existing
EpochSeconds type. The unit tests had decoded those members as string and so
asserted the broken form; they now assert the number, and ListAccounts gained the
JoinedTimestamp assertion 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 predated
    this milestone. It now covers all thirty, plus p-FullAWSAccess, asynchronous
    vending, 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 CreateOrganization is deliberately absent: the
    organization already exists on first contact.
  • test/e2e/journey_organizations_test.go — three journeys through the real
    organizations client, all asserting via typed exceptions since errors.As on
    the typed error is the branch a consumer's handling actually takes:
    1. the vending run — stable root across two ListRoots, OU with a create-time
      tag read back, create → poll → move, both listings agreeing on placement, then
      the re-run hitting DuplicateAccountException and
      SourceParentNotFoundException rather than silently duplicating;
    2. the seeded async failure — CreateAccount still answers 200, and only
      DescribeCreateAccountStatus reveals FAILED/EMAIL_ALREADY_EXISTS/no
      AccountId;
    3. the disabled-SCP state — a fresh root carries only p-FullAWSAccess, the last
      SCP cannot be detached, CreatePolicy succeeds while the type is disabled,
      AttachPolicy is refused, and re-enabling restores p-FullAWSAccess alone.
  • 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 ./... and
go test -C test/e2e ./....

Mutation testing, the five targets the plan named, all CAUGHT on a
full-package -race run with a verified-green baseline before and after:

Mutation Caught by
The persisted root reverted to per-call generation (the #577 bug) 10+ tests, incl. the whole OU and vending suites
The OU depth boundary off by one TestOrganizations_OUDepthLimit
The minimum-one-SCP guard dropped TestOrganizations_MinAttachmentFloor
MoveAccount's destination-equals-parent check removed TestOrganizations_FullVend, TestOrganizations_VendingRefusals
The MaxResults upper clamp dropped TestOrganizations_Paginate

Live server (:4678, AWS_MAX_ATTEMPTS=1, scratch dir since removed): stable
root across two ListRoots; JoinedTimestamp now parsing into a datetime instead
of failing; OU tree with the 6th level refused as OU_DEPTH_LIMIT_EXCEEDED; vend →
poll → move → DuplicateAccountException on the re-run; ListParents reporting the
OU; an aws:-prefixed tag refused on create with INVALID_SYSTEM_TAGS_PARAMETER;
the full disabled-SCP journey; the seeded failure answering 200 with only the status
revealing FAILED; and AccountNotFoundException at HTTP 400.

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

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 2a8e2da into main Aug 9, 2026
16 checks passed
@scttfrdmn
scttfrdmn deleted the docs/organizations-v0.97.0 branch August 9, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organizations: OUs, policies, and account placement are unimplemented, so the whole account-vending surface is unreachable

1 participant