Skip to content

fix(glue,cloudwatch,logs): order list results most-recent-first like AWS#2001

Merged
vieiralucas merged 1 commit into
mainfrom
wt-ordering
Jun 27, 2026
Merged

fix(glue,cloudwatch,logs): order list results most-recent-first like AWS#2001
vieiralucas merged 1 commit into
mainfrom
wt-ordering

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jun 27, 2026

Copy link
Copy Markdown
Member

2026-06-27 bug-hunt Tier 1 finding 1.16.

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 it with the AWS default TimestampDescending (newest first).
  • Logs DescribeLogStreams ignored orderBy=LastEventTime and descending; now sorts by lastEventTimestamp when requested and flips on descending. 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.

  • Bug Fixes
    • Glue GetJobRuns: sort by StartedOn descending so JobRuns[0] is the latest run.
    • CloudWatch GetMetricData: honor ScanBy with default TimestampDescending (newest first).
    • Logs DescribeLogStreams: honor orderBy=LastEventTime and descending; sort by last event time and paginate positionally so ordering is consistent.

Written for commit 92bf255. Summary will update on new commits.

Review in cubic

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).
@vieiralucas vieiralucas merged commit 61a8ac6 into main Jun 27, 2026
104 checks passed
@vieiralucas vieiralucas deleted the wt-ordering branch June 27, 2026 13:59
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.

1 participant