Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ErrorReporter unexpected method #264

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Conversation

bdewater
Copy link
Contributor

Type of Change

  • Add RBI for a new gem
  • Modify RBI for an existing gem
  • Other:

Changes

@bdewater bdewater requested a review from a team as a code owner July 17, 2024 19:09
@bdewater
Copy link
Contributor Author

bdewater commented Jul 17, 2024

It's kind of funny this fails the runtime checks even with the version constraint added 🙈

Checking RBI files against runtime execution...

Checking runtime for activesupport...

Error: Missing runtime method ::ActiveSupport::ErrorReporter#unexpected (defined at rbi/annotations/activesupport.rbi:485:2-485:100)
Note: unexpected could be delegated to :method_missing but the RBI definition isn't annotated with @method_missing.

@@ -472,4 +472,15 @@ class ActiveSupport::ErrorReporter
).void
end
def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end

# @version >= 7.2.0.beta1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you win the award for the very first version annotation? 🥇

Copy link
Contributor

Choose a reason for hiding this comment

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

How do we want to handle runtime checks? I think CI will use the latest version however beta versions can only be specified in the Gemfile?

There's also the case of annotations with an incompatible version, < 7.2.0beta1. Should we just use @method_missing instead of dealing with this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to think more about this today

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this PR is fine thanks to Shopify/tapioca#1585 but I'll leave it to @egiurleo before merging. We may wanna test versioning with apps that use lower Rails versions as we merge this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah let's merge this and I'll add a note to our meeting on Monday to talk about it.

@bdewater
Copy link
Contributor Author

With Rails 7.2 out this now passes CI.

@egiurleo egiurleo merged commit a18cf20 into Shopify:main Aug 16, 2024
3 checks passed
@bdewater bdewater deleted the as/unexpected branch August 17, 2024 17: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.

3 participants