Skip to content

Add types for actionmailbox v8.1 - #1095

Merged
github-actions[bot] merged 5 commits into
ruby:mainfrom
amatsuda:actionmailbox-8.1
Oct 19, 2026
Merged

github-actions[bot] merged 5 commits into
ruby:mainfrom
amatsuda:actionmailbox-8.1

Conversation

@amatsuda

Copy link
Copy Markdown
Member

Adds signatures for actionmailbox 8.1, based on 8.1.4. This is a new gem in this repository.

This PR is stacked on #1093 (activestorage 8.1), which is stacked on #1090 (activejob 8.1), because actionmailbox 8.1 needs their signatures. Until they are merged, their commits show up here too. The commits for this PR are the ones starting with actionmailbox:.

The reviewers are the same as activerecord's, and actionmailbox is added to the target gems listed in the README of the Rails gems. The RuboCop config enables the strict cops.

How it is made

actionmailbox-generated.rbs comes from rbs prototype rb run on lib and app, then post-processed the same way as the other Rails 8.1 gems:

  • Drop members that core, dependencies, or the hand-written RBS already define
  • Fill missing type arguments of generic classes with untyped
  • Add accessors defined with class_attribute, mattr_accessor, and cattr_accessor, and methods defined with delegate
  • Generate the methods defined inside class_methods do ... end as the concern's ClassMethods, which rbs prototype skips, so mailboxes have routing and before_processing
  • Make the classes extend the ClassMethods of the concerns they include, directly or through other concerns, as ActiveSupport::Concern does
  • Declare the namespaces that Zeitwerk defines for the controllers in app (ActionMailbox::Ingresses::Mailgun, Rails::Conductor, ...)

The generators in lib/generators and lib/rails are left out, since their superclasses come from railties, which actionmailbox doesn't depend on.

Methods the generator doesn't see

The columns of ActionMailbox::InboundEmail (status, message_id, ...), the methods of its status enum (delivered?, bounced!, ...), and its raw_email attachment. The model is in the gem, so apps' generated model signatures don't have them.

Return types

A mailbox's inbound_email and mail, and InboundEmail#mail, source, and processed?.

Optional blocks

All required blocks were checked against the source, and 5 were made optional: before_processing, after_processing, and around_processing with method names, and create_inbound_email_from_mail and receive_inbound_email_from_mail, which build the mail from keyword arguments without one.

Tests

Each commit that changes types adds tests that fail without it. bin/test gems/actionmailbox/8.1 and RuboCop's strict cops pass on every commit from the generation commit onward.

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown

@amatsuda Thanks for your contribution!

Please follow the instructions below for each change.
See also: https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md

Available commands

You can use the following commands by commenting on this PR.

  • /merge: Merge this PR if CI passes

actioncable

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


actionmailbox

This RBS files are newly added.

You can merge this PR immediately if the CI passes.
Just comment /merge to merge this PR.


actionmailer

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @ydah, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


actionpack

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


actiontext

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@tk0miya, @ksss, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


actionview

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @ydah, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


activejob

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


activemodel

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@hibariya, @ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


activerecord

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@hibariya, @ksss, @Little-Rubyist, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


activestorage

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


activesupport

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@hibariya, @ksss, @ydah, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.


railties

You changed RBS files for an existing gem.
You need to get approval from the reviewers of this gem.

@ksss, @tk0miya, please review this pull request.
If this change is acceptable, please make a review comment including APPROVE from here.
Screen Shot 2024-03-19 at 14 13 36

After that, the PR author or the reviewers can merge this PR.
Just comment /merge to merge this PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file contains the names mechanically assigned to reviewers, as well as an indication of the intention to conduct a review, the declaration of which is left up to the individual.
I have the intention to review, but I do not know about others.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So, what shall I do? Should I better remove others in order for this patch to get merged?

As a Rails committer, I personally feel like Rails is just Rails. Technically, everyone in the team maintains Action Mailbox thing, although I don't actually know anything about it at all. Thus, to me it feels natural to add everyone who are willing to maintain Rails to all Rails components' reviewers. I mean, that's just what I thought when I created this file, but of course I'll follow your team's policy and decision.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please delete the file or make sure to list only your own name.
Basically, the only name you should write in _reviewers.yaml is your own.

Example: #580

I apologize for the confusion, but this is a mechanism for the entire gem_rbs_collection rather than a specific Rails rule.
We haven't received requests to add users other than oneself until now, so the documentation might need to be updated.

https://github.com/ruby/gem_rbs_collection/blob/main/docs/CONTRIBUTING.md#gem-reviewer

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

OMG! RTFM!!! Just updated the reviewers to be "only me" 🙇

amatsuda and others added 5 commits October 19, 2026 07:26
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Generated with `rbs prototype rb` from the actionmailbox 8.1.4 lib and
app sources and post-processed the same way as the other Rails 8.1 gems:
drop members already defined elsewhere, fill missing type arguments, add
accessors defined with class_attribute, mattr_accessor, and
cattr_accessor and methods defined with delegate, generate the methods
defined inside `class_methods do ... end` as the concern's ClassMethods,
and make the classes extend the ClassMethods of the concerns they
include. The namespaces that Zeitwerk defines for the controllers in app
(ActionMailbox::Ingresses::Mailgun, Rails::Conductor, ...) are declared
as modules.

The generators in lib/generators and lib/rails are left out, as their
superclasses come from railties, which actionmailbox doesn't depend on.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…Email

They're defined by the action_mailbox_inbound_emails table, enum, and
has_one_attached, which rbs prototype doesn't see, and the model is in
the gem, so apps' generated model signatures don't have them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A mailbox's inbound_email and mail, and InboundEmail's mail, source, and
processed?.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rbs prototype marks a block as required unless the method checks it.
before_processing, after_processing, and around_processing take method
names, and create_inbound_email_from_mail and
receive_inbound_email_from_mail pass the block to Mail.new, which builds
the mail from the keyword arguments without one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@ksss ksss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE

@github-actions

Copy link
Copy Markdown

Thanks for your review, @ksss!

@amatsuda, @ksss This PR is ready to be merged.
Just comment /merge to merge this PR.

@amatsuda

Copy link
Copy Markdown
Member Author

/merge

@github-actions
github-actions Bot merged commit 957ba06 into ruby:main Oct 19, 2026
7 checks passed
@amatsuda
amatsuda deleted the actionmailbox-8.1 branch October 19, 2026 04:40
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