Skip to content

feat(ec2): DescribeLaunchTemplates pages, the last of #1024's sixteen (#1024) - #1055

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/1024-ec2-launchtemplates-page
Sep 18, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/1024-ec2-launchtemplates-page

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #1024.

DescribeLaunchTemplates published MaxResults and NextToken and read neither, answering its whole
listing with no nextToken — the divergence a paginating caller cannot see, because the loop
terminates on the first page against substrate and finds a second page in production. It is the
sixteenth and last operation of the audited set, and the third and final part of #1024: seven were
converted by #917, three publishing no range and five publishing a floor of five landed earlier in
this release, and this one is a part of its own because its published floor is not five.

No routed EC2 describe publishing both parameters implements neither any longer.

The range is shared with the versions operation; the default is not

Page MaxResults range, verbatim Absent MaxResults
API_DescribeLaunchTemplates Valid Range: Minimum value of 1. Maximum value of 200., repeated in prose as "This value can be between 1 and 200" the whole listing, no token
API_DescribeLaunchTemplateVersions "This value can be between 1 and 200" — prose alone, no Valid Range line pages at 200

Both pages publish the range themselves, so one pair of constants —
ec2MinLaunchTemplateResults / ec2MaxLaunchTemplateResults, moved into ec2_pagination.go beside
the other published ranges — serves both without either borrowing the other's bound, which is the
distinction #671 turns on. The constants' old names carried "Version"; the doc comment they replace
also attributed a Valid Range line to the versions page, which that page does not carry.

Neither page publishes a default, and the two differ: the versions operation pages at 200 (what it
shipped with, kept deliberately by #917) and this one reports everything (ec2MaxResults' contract,
and what it answered before it paginated, so a caller sending neither parameter sees no wire change).
Both readings are substrate's and are recorded at their call sites rather than reconciled by changing
behaviour a consumer already depends on.

The floor of 1 is published here, where the identical floor at the seven pages carrying no range
at all is substrate's reading — which is why ec2MinUnpublishedMaxResults stays a separate constant
even though the number agrees. MaxResults=1000 is accepted at DescribeNatGateways and refused here
and at DescribeRouteTables; the shared test table asserts each row's edges from its own bounds.

LaunchTemplateId.N refuses MaxResults; LaunchTemplateName.N does not

Query-Requests.html states the rule against "a list of IDs", and #917 already read that narrowly for
DescribeSecurityGroups' GroupName.N. This is the second operation the reading applies to and the
only one where the two selectors union, so it is asserted in both directions: a name list pages
like any other listing, and naming a name list, an ID list and MaxResults together is still refused —
the rule is about the ID list appearing, not about it being the only selector.

Two further readings recorded rather than left implicit

  • The offset counts positions in the account's launch-template index, which updateStringIndex keeps
    sorted by ID. Uniquely among the converted describes the ordering comes from an index rather than
    from StateManager.List's lexicographic guarantee (state: MemoryStateManager.List returns keys in Go map order, so 111 call sites answer differently run to run #865), so no explicit sort is needed — but the
    basis is stated, per the obligation getRestAPIs records.
  • IncludeManagedResources is published and read nowhere: substrate models no launch template another
    service owns, so the parameter has nothing to include or hide. Documented as inert rather than
    refused, since refusing a published parameter is the larger divergence — the call the EC2 gaps list
    already makes for IncludeAllInstances, IncludeUnsupportedInRegion and AllRegions.

Tests

DescribeLaunchTemplates becomes the twelfth row of the shared table in ec2_pagination_test.go, so
all seven of its cases run against it: an absent MaxResults reports the whole listing with no
<nextToken element in the raw body, a walk of eleven templates at five per page reports every one
exactly once in the unpaginated order, a full last page carries no token, an invented token is refused
before any state is read (sealed store), and the published floor, ceiling, floor−1 and ceiling+1 are
each asserted from the row's own bounds. TestEC2_OffsetPagination_ALaunchTemplateNameListCoexistsWithMaxResults
covers what the table has no column for: the name list paging alongside MaxResults, and the
combination with an ID list still refused.

Verification

The nine-command gate: gofmt/build/vet, golangci-lint run ./..., make test, the same under
GOTOOLCHAIN=go1.26.6, make coverage, make docs-reference docs-reference-check docs-versions authz-reference-check, the docs site build, and test/e2e. Coverage holds the release floor. The
conversion was also mutation-checked: removing the ec2Page cut and zeroing the offset each fail the
new cases.

…#1024)

Its published range is 1-200, the only page in the audited set whose floor is
not five, so it lands as a part of its own. The range is shared with
DescribeLaunchTemplateVersions - both pages publish it - while the default is
not: the versions operation keeps paging at 200 and this one reports the whole
listing for an absent MaxResults.

LaunchTemplateId.N refuses MaxResults and LaunchTemplateName.N does not, per
the reading #917 recorded for GroupName.N. The offset counts positions in the
sorted launch-template index, and IncludeManagedResources is recorded as inert.
@codecov

codecov Bot commented Sep 18, 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 5bd5177 into main Sep 18, 2026
17 checks passed
@scttfrdmn
scttfrdmn deleted the feat/1024-ec2-launchtemplates-page branch September 18, 2026 03:51
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.

Nine routed EC2 describes publish MaxResults and NextToken and implement neither

1 participant