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

Check if RBIs are up-to-date #8704

Merged
merged 4 commits into from
Jan 5, 2024
Merged

Conversation

JamieMagee
Copy link
Contributor

@JamieMagee JamieMagee commented Jan 4, 2024

The previous RBI check, bin/tapioca && git add . && git diff --cached --exit-code would always succeed because bin/tapioca prints the help message, but doesn't generate the RBIs.

The updated script runs tapioca gem --verify instead.

Related to #8670

@JamieMagee JamieMagee requested a review from a team as a code owner January 4, 2024 21:58
@JamieMagee JamieMagee force-pushed the jamiemagee/check-rbis-up-to-date branch 7 times, most recently from 666b3e6 to 331f0ef Compare January 4, 2024 23:04
@JamieMagee
Copy link
Contributor Author

JamieMagee commented Jan 4, 2024

Turns out I have Bundler 2.4.22 installed locally. However the ruby/setup-ruby action uses the version of Bundler that ships with the installed version of Ruby by default. Ruby 3.1.4 ships with Bundler 2.3.271

It looks like Bundler switched to a different dependency resolution algorithm2, pub_grub, in version 2.4. I suspect that's what's causing the difference.

Footnotes

  1. https://github.com/ruby/ruby/blob/ruby_3_1/lib/bundler/version.rb#L4

  2. https://bundler.io/v2.4/whats_new.html

@JamieMagee JamieMagee force-pushed the jamiemagee/check-rbis-up-to-date branch from 331f0ef to e4f44bb Compare January 4, 2024 23:15
@JamieMagee JamieMagee added the sorbet 🍦 Relates to Sorbet types label Jan 4, 2024
@JamieMagee JamieMagee force-pushed the jamiemagee/check-rbis-up-to-date branch 4 times, most recently from 6b59062 to 7ccf72c Compare January 4, 2024 23:48
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

🙈 Thanks for catching my mistake!

@JamieMagee JamieMagee force-pushed the jamiemagee/check-rbis-up-to-date branch from 76761bb to c5308fb Compare January 5, 2024 17:04
@deivid-rodriguez
Copy link
Contributor

I'm afraid this is not going to work. Since there's no Gemfile.lock file, any release of any dependency will cause the check to fail. Should we add a lockfile?

@JamieMagee
Copy link
Contributor Author

JamieMagee commented Jan 5, 2024

I'm afraid this is not going to work. Since there's no Gemfile.lock file, any release of any dependency will cause the check to fail. Should we add a lockfile?

Yeah, I did always wonder why there was no Gemfile.lock. Do you know?

EDIT: It was removed in this commit f2b3f9a

@deivid-rodriguez
Copy link
Contributor

No idea.

We should eventually merge this Gemfile with the one in updater (once aarch64 is supported by sorbet) and manage everything together, but for now we can add a root lockfile. Mind if I add that to this PR?

@JamieMagee
Copy link
Contributor Author

I don't think Sorbet Linux + aarch64 support is a huge blocker? It just means you won't be able to typecheck locally in a devcontainer. CI will still typecheck, and it will still work in mac + aarch64.

Go ahead with the lockfile. Which Bundler version are you going to use?

@deivid-rodriguez
Copy link
Contributor

I think the Bundler version should not change anything but I'll lock the latest. The Ruby version could make a difference since it's common that gems bring different requirements on the Ruby version so different rubies could lead to different resolutions. The Ruby version used will be 3.1.4 as per the root .ruby-version file.

Regarding Mac + aarch64, it's not that you cannot run type check, but that Bundler won't be able to resolve the updater Gemfile at all in macOS if it includes sorbet-static.

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Jan 5, 2024

I pushed a lockfile and also added Dependabot config to bump all gems in it weekly. That weekly PR will need an amend to run bin/tapioca gem, but that seems fine?

@deivid-rodriguez
Copy link
Contributor

Good to go @JamieMagee?

@JamieMagee
Copy link
Contributor Author

Yep!

@deivid-rodriguez deivid-rodriguez merged commit be6ae6c into main Jan 5, 2024
50 checks passed
@deivid-rodriguez deivid-rodriguez deleted the jamiemagee/check-rbis-up-to-date branch January 5, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sorbet 🍦 Relates to Sorbet types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants