Skip to content

feat: add automations module#90

Merged
zenorocha merged 11 commits intomainfrom
feat/automations
Apr 10, 2026
Merged

feat: add automations module#90
zenorocha merged 11 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.

Comment thread src/main/java/com/resend/services/automations/model/CreateAutomationOptions.java Outdated
Comment thread src/main/java/com/resend/services/automations/model/CreateAutomationOptions.java Outdated
Comment thread src/test/java/com/resend/services/automations/AutomationsTest.java
Comment thread src/main/java/com/resend/Resend.java
Comment thread src/main/java/com/resend/services/automations/model/UpdateAutomationOptions.java Outdated
Comment thread src/main/java/com/resend/services/automations/model/UpdateAutomationOptions.java Outdated
Comment thread src/main/java/com/resend/services/automations/Automations.java Outdated
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.

1 issue found across 3 files (changes from recent commits).

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/GetAutomationRunOptions.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/GetAutomationRunOptions.java:58">
P2: Validate `automationId` and `runId` in `build()` before creating the options to prevent malformed run lookup URLs.</violation>
</file>

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

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 3 files (changes from recent commits).

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/ListAutomationsParams.java">

<violation number="1" location="src/main/java/com/resend/services/automations/model/ListAutomationsParams.java:86">
P1: Query parameters are serialized without URL encoding, which can break pagination/status values containing reserved characters.</violation>
</file>

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

<violation number="1" location="src/main/java/com/resend/services/automations/model/ListAutomationRunsParams.java:86">
P2: Query parameters are concatenated without URL encoding, which can break pagination/status requests when values contain reserved URL characters.</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:87">
P1: Possible NullPointerException: `params` is dereferenced without a null check when building the query string.</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/Automations.java Outdated
zenorocha
zenorocha previously approved these changes Apr 10, 2026
@zenorocha
Copy link
Copy Markdown
Member

@cursor resolve conflicts

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 10, 2026

  • I merged main into feat/automations and resolved the only conflict in src/main/java/com/resend/Resend.java by keeping both events() and automations() service accessors.
  • Committed and pushed the resolution to feat/automations (latest commit: Resolve merge conflict in Resend.java: keep both events() and automations() services). The PR now shows as mergeable; any remaining “blocked” state is from checks, not conflicts.

Note: I couldn’t run the build locally because the repo uses Gradle 7.4, which isn’t compatible with JDK 21 on this VM. If you want me to run tests here, either switch the VM to JDK 17 or upgrade the Gradle wrapper to a Java 21–compatible version (e.g., 8.6+).

Open in Web Open in Cursor 

…ions() services

Co-authored-by: Zeno Rocha <zenorocha@users.noreply.github.com>
@zenorocha zenorocha merged commit 94a66d4 into main Apr 10, 2026
4 checks passed
@zenorocha zenorocha deleted the feat/automations branch April 10, 2026 16:36
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.

3 participants