Skip to content

fix(aws): round-trip typed DynamoDB cursors and allow percentile-only CloudWatch statistics - #9967

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/atlassian-aws-release-review
Nov 13, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/atlassian-aws-release-review

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Fixes from the v0.9.55 release review (#9963) that touch the AWS sweep (#9952/#9961).

  • DynamoDB pagination cursors round-trip for every key type.
    • lastEvaluatedKey encoded integers a JS number can't hold, and binary keys, as plain strings. Passed back as exclusiveStartKey, they went out as S, so fetching the next page failed the key type check.
    • The cursor now encodes those values as { N } / { B } (key attributes are always scalar, so this can't collide with a real key value), and exclusiveStartKey decodes them back to NumberValue / binary.
    • String and safe-number cursors are unchanged, and item output is byte-identical.
    • Not a regression from main, where these tables failed on page 1 (BigInt serialization).
  • CloudWatch get_metric_statistics accepts percentile-only requests.
    • statistics is optional on the tool and in the contract, which now requires at least one of statistics / extendedStatistics.
    • Direct and agent calls that pass only extendedStatistics no longer fail the required-param check.
    • The block is unchanged: its Statistics field is still required and always populated, and ExtendedStatistics still takes precedence when both are set.

Not changed: the review note on dynamodb-get (expression attribute names without a projection) doesn't apply. tools/dynamodb/get.ts only forwards names together with a projection, and the contract has no other caller.

Type of Change

  • Bug fix

Testing

  • New regression tests, each red on the pre-fix code:
    • DynamoDB cursor round trip: large-number and binary keys come back as N/B, while strings and safe numbers are unchanged.
    • CloudWatch percentile-only request: passes the required-param check and the contract.
    • The "neither statistic" rejection, pinned to the refine and guard-revert checked.
  • vitest across DynamoDB, CloudWatch, the AWS contracts, the stale-input test and the block tests: 45 passed.
  • check-block-registry.ts origin/staging, check:tool-metadata, check:docs, check:integration-catalog, check:unused-exports, check:utils, check:test-patterns, check:explicit-any, check:api-validation:strict and biome pass.
  • /simplify and /cleanup run on the diff.
  • Type-check runs in CI.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 13, 2026 1:10am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Preserves DynamoDB cursor types and allows CloudWatch requests that ask only for percentiles.

  • DynamoDB query and scan cursors keep binary and exact-number key types.
  • CloudWatch metric requests can use percentile statistics without standard statistics.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[DynamoDB page] --> B[Keep exact numbers and binary keys]
  B --> C[Encode typed cursor as JSON]
  C --> D[Next-page request]
  D --> E[Restore number and binary types]
  E --> F[DynamoDB next page]
Loading

Reviews (3) · Last reviewed commit: "fix(dynamodb): treat a number as exact o..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

… CloudWatch statistics

Encode large-number and binary keys in lastEvaluatedKey as {N}/{B} and decode
them in exclusiveStartKey, so pagination resumes on tables whose keys a JS
number or string cannot carry. Item output is unchanged. Let
get_metric_statistics take extendedStatistics alone: statistics is optional and
the contract requires one of the two.
Hold every N value a JS number cannot represent exactly as a NumberValue so the
cursor encodes it as {N}; item output keeps the same number/string rule.
…d-trips

A decimal like 1.0000000000000000001 parses to a safe integer, so the safe-integer
shortcut dropped its digits. Return a JS number only when String(parsed) equals the
DynamoDB value (and it is not an unsafe integer); item output is unchanged.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@waleedlatif1
waleedlatif1 force-pushed the fix/atlassian-aws-release-review branch from 409b866 to fc0c438 Compare November 13, 2026 01:06
@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit c79ff1a into staging Nov 13, 2026
83 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/atlassian-aws-release-review branch November 13, 2026 01:30

This branch was successfully deployed

1 active deployment
Preview — fc0c4383 Deployed Nov 13, 2026 by vercel[bot]
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