fix(appengine): modernize rails-cloudsql gae flex ruby examples#1673
fix(appengine): modernize rails-cloudsql gae flex ruby examples#1673palladius wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request modernizes the App Engine Flex Ruby examples for Rails Cloud SQL (PostgreSQL and MySQL). The updates involve specifying a minimum Ruby version of 3.2.0 and setting the operating system to Ubuntu 22 in their respective configurations. These changes ensure the examples leverage current technologies and are correctly integrated into the CI pipeline, which has been updated to run these specific examples only on the newest Ruby environment. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request modernizes the Rails Cloud SQL examples for App Engine Flex by updating them to use a newer Ruby version (>= 3.2.0) and a more recent operating system image (ubuntu22). The CI configuration in .toys/kokoro-ci.rb has been adjusted accordingly to ensure these examples are tested with the newest Ruby version. The changes are logical and well-implemented. I've added one suggestion to improve the maintainability of the CI script by reducing code repetition.
| @products.delete_if do |dir| | ||
| dir.start_with?("appengine/") && | ||
| dir != "appengine/rails-cloudsql-postgres" && | ||
| dir != "appengine/rails-cloudsql-mysql" | ||
| end |
There was a problem hiding this comment.
This condition can be simplified by checking for inclusion in an array of the rails-cloudsql samples. This improves readability and makes it easier to add more exceptions in the future. A similar list of samples is used on lines 157-158; using an array here could be the first step toward removing that duplication by defining the array once and using it in both places.
@products.delete_if do |dir|
dir.start_with?("appengine/") &&
!["appengine/rails-cloudsql-postgres",
"appengine/rails-cloudsql-mysql"].include?(dir)
end513cd9f to
04dde9c
Compare
|
I've addressed the simplification by isolating the array, and resolved the RuboCop formatting offenses inside the |
Fixes #1671. Replaces and closes #1475 and #1477.