Skip to content

feat(domains): add forge activation methods - #262

Open
lucasfcosta wants to merge 2 commits into
mainfrom
feature/dev-2474-ruby-sdk-internal-squad-devtools
Open

lucasfcosta wants to merge 2 commits into
mainfrom
feature/dev-2474-ruby-sdk-internal-squad-devtools

Conversation

@lucasfcosta

@lucasfcosta lucasfcosta commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Forge activation, matching the folded API surface (the standalone forge verify and update endpoints no longer exist). Ports resend/resend-node#1193 to Ruby; the API surface is defined in resend/resend-openapi#144.

  • Resend::Domains::Forge.enable(id:, return_path:) → POST /domains/:id/forge. Returns the full domain response. return_path is optional; when omitted, the API picks a label that is free in the domain's DNS, and only return_path is ever sent in the body. Idempotent on the API side.
  • Resend::Domains.verify(domain_id, scope: ["forge"]) → POST /domains/:id/verify with {"scope":["forge"]}. Scoped, only the Forge record is re-checked, so the records that are already verified are not re-proven. The existing verify(domain_id) call still sends {} exactly as before.
  • Resend::Domains.update({ id: ..., forge_return_path: ... }) → PATCH /domains/:id. forge_return_path passes through like every other update field: moves the Forge return path while the Forge record is still verifying, does not start verification, and once the record verifies the API refuses with 422 return_path_unavailable.

Bumps the version to 1.20.0.

Validation

  • bundle exec rubocop: 52 files inspected, no offenses detected.
  • bundle exec rake spec: 484 examples, 0 failures (Ruby 3.3).
  • Specs assert the wire shapes: enable with and without return_path (empty body asserted), the scoped verify body, and the forge_return_path PATCH body.

Notes for reviewers

  • verify keeps its positional domain_id and takes the scope as a trailing params hash, so existing callers are untouched.
  • Forge.enable sends only return_path (params.slice(:return_path)), so the id used to build the path never leaks into the payload.

Part of DEV-2474.

The Forge enable endpoint is live in production; the scoped verify and forge_return_path land with the API reshape, which deploys before this ships. Ships with the next resend-ruby release.

@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 5 files

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

View guided diff | Re-trigger cubic

Comment thread spec/domain_forge_spec.rb Resolved

@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.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

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

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta marked this pull request as ready for review November 11, 2026 21:25
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 11, 2026
@lucasfcosta
lucasfcosta marked this pull request as draft November 11, 2026 23:44
@lucasfcosta
lucasfcosta marked this pull request as ready for review November 11, 2026 23:45

@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.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

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

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta force-pushed the feature/dev-2474-ruby-sdk-internal-squad-devtools branch from 3fc2fc8 to 1b59b6e Compare November 11, 2026 23:50

@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.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

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

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods feat(domains): add forge activation methods and forge_status Nov 11, 2026
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Nov 12, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lucasfcosta
lucasfcosta force-pushed the feature/dev-2474-ruby-sdk-internal-squad-devtools branch from 1b59b6e to 202a61c Compare November 12, 2026 12:45
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 12, 2026

@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.

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

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

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

Matches the reshaped API: Domains::Forge keeps only enable
(return_path optional), Domains.verify gains an optional
scope: ["forge"] that re-checks only the Forge record, and
Domains.update accepts forge_return_path to move the Forge
return path without starting verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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.

2 issues found across 4 files (changes from recent commits).

Confidence score: 4/5

  • The Forge-provider examples in spec/domains_spec.rb exercise domain update and verification calls alongside API-key permission checks. Confirm the SDK methods and permissions those tests rely on are supported.
  • The verification examples in spec/domains_spec.rb depend on API-key state from earlier examples, so they fail when run alone. Configure Resend locally for those examples.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="spec/domains_spec.rb">

<violation number="1" location="spec/domains_spec.rb:214">
P3: This example depends on API-key state left by earlier examples, so it fails when run by itself (for example, while debugging this line). Add a local `Resend.configure` setup for the verification examples, or move the configuration to the outer `Domains` group.</violation>

<violation number="2" location="spec/domains_spec.rb:303">
P2: Custom agent: **API Key Permission Check SDK Methods**

These tests exercise new Forge provider operations — PATCH `domains/:id` with `forge_return_path` and POST `domains/:id/verify` with `scope: ["forge"]` — plus the new `/domains/:id/forge` endpoints in `lib/resend/domains/forge.rb`. Per the API-key permission checklist, confirm the API keys used in production have the required permissions for these new operations before deploying, to avoid permission-related failures.</violation>
</file>

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

View guided diff | Re-trigger cubic

Comment thread spec/domains_spec.rb
expect { Resend::Domains.verify }.not_to raise_error
end

it "verifies only the Forge record when scoped" do

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.

P2: Custom agent: API Key Permission Check SDK Methods

These tests exercise new Forge provider operations — PATCH domains/:id with forge_return_path and POST domains/:id/verify with scope: ["forge"] — plus the new /domains/:id/forge endpoints in lib/resend/domains/forge.rb. Per the API-key permission checklist, confirm the API keys used in production have the required permissions for these new operations before deploying, to avoid permission-related failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At spec/domains_spec.rb, line 303:

<comment>These tests exercise new Forge provider operations — PATCH `domains/:id` with `forge_return_path` and POST `domains/:id/verify` with `scope: ["forge"]` — plus the new `/domains/:id/forge` endpoints in `lib/resend/domains/forge.rb`. Per the API-key permission checklist, confirm the API keys used in production have the required permissions for these new operations before deploying, to avoid permission-related failures.</comment>

<file context>
@@ -278,5 +299,21 @@
       expect { Resend::Domains.verify }.not_to raise_error
     end
+
+    it "verifies only the Forge record when scoped" do
+      resp = {
+        "object": "domain",
</file context>

Comment thread spec/domains_spec.rb
forge_return_path: "outbound"
}

expect(Resend::Request).to receive(:new)

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.

P3: This example depends on API-key state left by earlier examples, so it fails when run by itself (for example, while debugging this line). Add a local Resend.configure setup for the verification examples, or move the configuration to the outer Domains group.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At spec/domains_spec.rb, line 214:

<comment>This example depends on API-key state left by earlier examples, so it fails when run by itself (for example, while debugging this line). Add a local `Resend.configure` setup for the verification examples, or move the configuration to the outer `Domains` group.</comment>

<file context>
@@ -199,6 +199,27 @@
+        forge_return_path: "outbound"
+      }
+
+      expect(Resend::Request).to receive(:new)
+        .with("domains/479e3145-dd38-476b-932c-529ceb705947", update_params, "patch")
+        .and_call_original
</file context>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant