Skip to content

Add unit tests for builder payload shape#1721

Merged
WcaleNieWolny merged 1 commit into
feat/forward-split-payloadfrom
test/builder-payload-shape
Feb 28, 2026
Merged

Add unit tests for builder payload shape#1721
WcaleNieWolny merged 1 commit into
feat/forward-split-payloadfrom
test/builder-payload-shape

Conversation

@WcaleNieWolny
Copy link
Copy Markdown
Contributor

Summary

  • Extract buildBuilderPayload() from inline fetch() body in the build request proxy
  • Add 6 vitest unit tests asserting the forwarded JSON shape to the builder

What's tested

  1. build_options (snake_case) maps to buildOptions (camelCase)
  2. build_credentials (snake_case) maps to buildCredentials (camelCase)
  3. Legacy flat credentials field is NOT present
  4. userId, artifactKey, fastlane present with correct values
  5. Exact top-level key set (no extra keys)
  6. Contents pass through unchanged

Context

Companion to #1717 (forward split payload). Ensures the snake_case → camelCase mapping and payload shape contract are regression-tested.

Test plan

  • npx vitest run tests/builder-payload.unit.test.ts — 6/6 pass

Extract buildBuilderPayload() from the inline fetch body so the
snake_case → camelCase mapping and exact key set can be tested.
6 vitest cases verify: camelCase output, no legacy credentials field,
correct metadata keys, and pass-through of contents.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/builder-payload-shape

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@WcaleNieWolny WcaleNieWolny changed the base branch from main to feat/forward-split-payload February 28, 2026 14:48
@sonarqubecloud
Copy link
Copy Markdown

@WcaleNieWolny WcaleNieWolny marked this pull request as ready for review February 28, 2026 14:55
@WcaleNieWolny WcaleNieWolny merged commit 5d64ebb into feat/forward-split-payload Feb 28, 2026
14 checks passed
@WcaleNieWolny WcaleNieWolny deleted the test/builder-payload-shape branch February 28, 2026 14:55
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