Skip to content

feat: add automations module#90

Open
kewynakshlley wants to merge 6 commits intomainfrom
feat/automations
Open

feat: add automations module#90
kewynakshlley wants to merge 6 commits intomainfrom
feat/automations

Conversation

@kewynakshlley
Copy link
Copy Markdown
Collaborator

No description provided.

@kewynakshlley kewynakshlley requested a review from vcapretz April 7, 2026 20:24
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.

7 issues found across 27 files

Confidence score: 2/5

  • There is a concrete runtime regression risk in the builder APIs: CreateAutomationOptions and UpdateAutomationOptions use Arrays.asList in steps(...)/edges(...), so later step(...)/edge(...) calls can throw UnsupportedOperationException in normal chaining flows.
  • src/test/java/com/resend/services/automations/AutomationsTest.java currently mocks the class under test, which weakens verification of real Automations behavior and makes the above regressions more likely to slip through.
  • src/main/java/com/resend/Resend.java introduces Automations service wiring, and API-key permission requirements for Automations are still a deployment risk if production keys are not aligned.
  • Pay close attention to src/main/java/com/resend/services/automations/model/CreateAutomationOptions.java, src/main/java/com/resend/services/automations/model/UpdateAutomationOptions.java, and src/test/java/com/resend/services/automations/AutomationsTest.java - mutable list safety in builders and real behavior test coverage need fixes 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/UpdateAutomationOptions.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/UpdateAutomationOptions.java:92">
P2: `steps(...)` stores a fixed-size list. If a caller later uses `step(...)`, it will throw UnsupportedOperationException. Wrap the varargs in a mutable list to keep the builder API safe.</violation>

<violation number="2" location="src/main/java/com/resend/services/automations/model/UpdateAutomationOptions.java:110">
P2: `edges(...)` stores a fixed-size list. If a caller later uses `edge(...)`, it will throw UnsupportedOperationException. Wrap the varargs in a mutable list to keep the builder API safe.</violation>
</file>

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

<violation number="1" location="src/main/java/com/resend/services/automations/model/CreateAutomationOptions.java:74">
P1: Using `Arrays.asList` in `steps(...)` creates a fixed-size list that breaks subsequent `step(...)` calls with `UnsupportedOperationException`.</violation>

<violation number="2" location="src/main/java/com/resend/services/automations/model/CreateAutomationOptions.java:89">
P1: Using `Arrays.asList` in `edges(...)` creates a fixed-size list that breaks subsequent `edge(...)` calls with `UnsupportedOperationException`.</violation>
</file>

<file name="src/test/java/com/resend/services/automations/AutomationsTest.java">

<violation number="1" location="src/test/java/com/resend/services/automations/AutomationsTest.java:22">
P1: These tests mock the class under test, so they only verify Mockito stubbing instead of real Automations behavior.</violation>
</file>

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

<violation number="1" location="src/main/java/com/resend/services/automations/Automations.java:165">
P2: `buildQueryString` and `buildRunsQueryString` duplicate the same query assembly logic; consolidate to one shared helper to prevent drift.</violation>
</file>

<file name="src/main/java/com/resend/Resend.java">

<violation number="1" location="src/main/java/com/resend/Resend.java:171">
P1: Custom agent: **API Key Permission Check SDK Methods**

This adds the Automations service to the SDK. Please confirm that production API keys have the required permissions for Automations operations to prevent permission-related failures after deployment.</violation>
</file>

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

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