-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Trigger Github checks via Github API instead of commits + Refactor checks #84
Conversation
app/services/compats/check.rb
Outdated
compat_id: @compat.id.to_s, | ||
ruby_version: @compat.rails_release.compatible_ruby_version.to_s, | ||
bundler_version: @compat.rails_release.compatible_bundler_version.to_s, | ||
dependencies: dependencies.to_json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manuelmeurer Is this workflow running synchronously? I don't quite follow how the status is updated after getting the result from the GitHub action... Maybe I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it just triggers the workflow, which runs asynchronously in a GitHub action. It would then be the workflow's responsibility to ping the RailsBump API with the results.
Oh, right, now it makes sense. We would need to specify these versions:
We already have some of this information in text format over here: https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html Then we would need one of these things:
|
Sounds good! I implemented a similar flow in another app recently, and went with option 2 (callback in the workflow to the API, when the workflow finishes). |
@manuelmeurer I took a stab at this and I moved the "check with bundler locally" logic to this project: https://github.com/railsbump/checker/blob/main/lib/rails_bump/checker/bundle_locally_check.rb I'm interested in moving most of the "check" logic to the checker project and lean heavily on GitHub Actions to get the results we need. I think that will provide us the most flexibility because we should be able to set up environments for these platforms:
|
@manuelmeurer After some tinkering and debugging, I managed to get the "check with bundler" logic to work over here: https://github.com/railsbump/checker/actions/runs/11061342765 I'll start working on the callback mechanism/logic now. Stay tuned! 🤓 |
@manuelmeurer Quick update: I got the new GitHub action to work and call back the RailsBump API. If it is okay with you, I can continue your work in this PR? |
Here is the callback action: https://github.com/railsbump/app/blob/main/app/controllers/api/results_controller.rb#L5-L18 |
e97542b
to
0d26c53
Compare
@manuelmeurer Alright, I think this is in a state where it can be reviewed. Could you please take a look? It's working for some cases but not for all cases I think some of the issues might be related to the combination of ruby + bundler + rails. I don't know if the database has the right information. On top of that, what could happen is that GitHub Actions simply doesn't support certain combinations of older Ruby + Bundler versions? That's why this is a good strategy but not bulletproof. :) This is an example of the compatibility check working: https://github.com/railsbump/checker/actions/runs/11075699535/job/30777217054 This is an example of the compatibility check action erroring before it gets to the check code: https://github.com/railsbump/checker/actions/runs/11075783938/job/30777474329 I think it might be a Rails Bump issue that is trying to combine a version of Rails + Bundler that will never work (?) |
7a2c33b
to
3205fc7
Compare
5b8e8cd
to
9c06372
Compare
It would be much more effective to trigger checks in the checker repo via the Github API instead of checking out the repo, adding a commit and pushing it.
The workflow action in the checker repo would need to accept some inputs, and call an endpoint in the Railsbump API (which still needs to be added), but overall this would be a much faster and more stable setup.
Happy to do a PR in the checker repo with the necessary changes!
@etagwerker wdyt?