Skip to content

feat: typed builder#99

Merged
kewynakshlley merged 5 commits intomainfrom
feat/typed-builder
Apr 12, 2026
Merged

feat: typed builder#99
kewynakshlley merged 5 commits intomainfrom
feat/typed-builder

Conversation

@kewynakshlley
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

3 issues found across 50 files

Confidence score: 3/5

  • There is a concrete regression risk in src/main/java/com/resend/services/automations/model/SendEmailStepBuilder.java: build() can emit template.id even when templateId is null, which may produce invalid email-step payloads at runtime.
  • src/main/java/com/resend/services/automations/model/AbstractStepBuilder.java currently shares the mutable config map with built objects; without a defensive copy, later builder mutations can unexpectedly alter previously built AutomationStep instances.
  • src/main/java/com/resend/services/automations/model/ContactUpdateStepBuilder.java should copy the input map in properties(...) to prevent aliasing and potential failures when property(...) mutates an immutable map.
  • Pay close attention to src/main/java/com/resend/services/automations/model/SendEmailStepBuilder.java, src/main/java/com/resend/services/automations/model/AbstractStepBuilder.java, src/main/java/com/resend/services/automations/model/ContactUpdateStepBuilder.java - null template payloads and mutable map aliasing are the main correctness risks before merge.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/main/java/com/resend/services/automations/model/ContactUpdateStepBuilder.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/ContactUpdateStepBuilder.java:64">
P2: Copy the input map in `properties(...)` to avoid aliasing and immutable-map mutation failures during fluent `property(...)` calls.</violation>
</file>

<file name="src/main/java/com/resend/services/automations/model/AbstractStepBuilder.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/AbstractStepBuilder.java:66">
P2: Build should pass a defensive copy of `config` to avoid mutating already-built `AutomationStep` instances through later builder changes.</violation>
</file>

<file name="src/main/java/com/resend/services/automations/model/SendEmailStepBuilder.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/SendEmailStepBuilder.java:98">
P1: `build()` unconditionally adds `template.id` even when `templateId` is null, which can produce invalid `template` payloads.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/main/java/com/resend/services/automations/model/SendEmailStepBuilder.java Outdated
Comment thread src/main/java/com/resend/services/automations/model/ContactUpdateStepBuilder.java Outdated
Comment thread src/main/java/com/resend/services/automations/model/AbstractStepBuilder.java Outdated
zenorocha
zenorocha previously approved these changes Apr 12, 2026
@kewynakshlley kewynakshlley dismissed zenorocha’s stale review April 12, 2026 04:28

The merge-base changed after approval.

@kewynakshlley kewynakshlley merged commit 9e99d43 into main Apr 12, 2026
3 checks passed
@kewynakshlley kewynakshlley deleted the feat/typed-builder branch April 12, 2026 04:30
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.

2 participants