fix(glue,cloudwatch,logs): order list results most-recent-first like AWS#2001
Merged
Conversation
The 'read element [0] = latest' idiom was broken across three services: - Glue GetJobRuns iterated a UUID-keyed map (random order); now sorts by StartedOn descending so JobRuns[0] is the latest run. - CloudWatch GetMetricData ignored ScanBy and always returned oldest-first; now honors ScanBy with the AWS default TimestampDescending (newest first). - Logs DescribeLogStreams ignored orderBy=LastEventTime and descending; now sorts by lastEventTimestamp when requested and flips on descending, and its pagination resumes positionally so LastEventTime ordering paginates too. Tests: e2e for each (Glue newest run first; CW default-descending vs TimestampAscending; Logs LastEventTime descending puts newest-event stream first).
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.
2026-06-27 bug-hunt Tier 1 finding 1.16.
The "read element [0] = latest" idiom was broken across three services:
StartedOndescending soJobRuns[0]is the latest run.ScanByand always returned oldest-first; now honors it with the AWS defaultTimestampDescending(newest first).orderBy=LastEventTimeanddescending; now sorts bylastEventTimestampwhen requested and flips ondescending. Pagination now resumes positionally so LastEventTime ordering paginates correctly too.Tests: an e2e for each (Glue newest run first; CW default-descending vs TimestampAscending; Logs LastEventTime descending puts the newest-event stream first). Glue/CW/Logs unit suites green.
Summary by cubic
Make Glue, CloudWatch, and Logs return results newest-first to match AWS. This lets clients safely treat the first item as the latest and fixes ordering-dependent pagination.
JobRuns[0]is the latest run.ScanBywith defaultTimestampDescending(newest first).orderBy=LastEventTimeanddescending; sort by last event time and paginate positionally so ordering is consistent.Written for commit 92bf255. Summary will update on new commits.