Repository navigation
feat(ec2): DescribeLaunchTemplates pages, the last of #1024's sixteen (#1024) - #1055
Merged
Merged
Conversation
…#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 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 #1024.
DescribeLaunchTemplatespublishedMaxResultsandNextTokenand read neither, answering its wholelisting with no
nextToken— the divergence a paginating caller cannot see, because the loopterminates 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
MaxResultsrange, verbatimMaxResultsAPI_DescribeLaunchTemplatesValid Range: Minimum value of 1. Maximum value of 200., repeated in prose as "This value can be between 1 and 200"API_DescribeLaunchTemplateVersionsValid RangelineBoth pages publish the range themselves, so one pair of constants —
ec2MinLaunchTemplateResults/ec2MaxLaunchTemplateResults, moved intoec2_pagination.gobesidethe 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 Rangeline 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
ec2MinUnpublishedMaxResultsstays a separate constanteven though the number agrees.
MaxResults=1000is accepted atDescribeNatGatewaysand refused hereand at
DescribeRouteTables; the shared test table asserts each row's edges from its own bounds.LaunchTemplateId.NrefusesMaxResults;LaunchTemplateName.Ndoes notQuery-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 theonly 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
MaxResultstogether 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
updateStringIndexkeepssorted 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 thebasis is stated, per the obligation
getRestAPIsrecords.IncludeManagedResourcesis published and read nowhere: substrate models no launch template anotherservice 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,IncludeUnsupportedInRegionandAllRegions.Tests
DescribeLaunchTemplatesbecomes the twelfth row of the shared table inec2_pagination_test.go, soall seven of its cases run against it: an absent
MaxResultsreports the whole listing with no<nextTokenelement in the raw body, a walk of eleven templates at five per page reports every oneexactly 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_ALaunchTemplateNameListCoexistsWithMaxResultscovers what the table has no column for: the name list paging alongside
MaxResults, and thecombination with an ID list still refused.
Verification
The nine-command gate:
gofmt/build/vet,golangci-lint run ./...,make test, the same underGOTOOLCHAIN=go1.26.6,make coverage,make docs-reference docs-reference-check docs-versions authz-reference-check, the docs site build, andtest/e2e. Coverage holds the release floor. Theconversion was also mutation-checked: removing the
ec2Pagecut and zeroing the offset each fail thenew cases.