Skip to content

fix(appengine): modernize rails-cloudsql gae flex ruby examples#1673

Open
palladius wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
palladius:fix-1475-1477-rails-ubuntu22
Open

fix(appengine): modernize rails-cloudsql gae flex ruby examples#1673
palladius wants to merge 2 commits intoGoogleCloudPlatform:mainfrom
palladius:fix-1475-1477-rails-ubuntu22

Conversation

@palladius
Copy link
Contributor

Fixes #1671. Replaces and closes #1475 and #1477.

@palladius palladius requested review from a team as code owners March 19, 2026 08:31
@product-auto-label product-auto-label bot added api: appengine Issues related to the App Engine Admin API API. samples Issues that are directly related to samples. labels Mar 19, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • Modernized App Engine Flex Ruby Examples: The rails-cloudsql-mysql and rails-cloudsql-postgres examples have been updated to use more recent technologies, specifically Rails 7.
  • Ruby Version Requirement: Both rails-cloudsql examples now explicitly require Ruby version 3.2.0 or newer in their Gemfiles to align with Rails 7 compatibility.
  • Operating System Specification: The app.yaml configurations for both rails-cloudsql examples now specify ubuntu22 as the operating system for their runtime environment.
  • CI Configuration Update: The Kokoro CI configuration has been adjusted to ensure that these rails-cloudsql examples are tested only with the newest Ruby version, aligning with their updated Rails 7 and Ruby 3.2+ requirements.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +165 to +169
@products.delete_if do |dir|
dir.start_with?("appengine/") &&
dir != "appengine/rails-cloudsql-postgres" &&
dir != "appengine/rails-cloudsql-mysql"
end

Choose a reason for hiding this comment

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

medium

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)
    end

@palladius palladius force-pushed the fix-1475-1477-rails-ubuntu22 branch from 513cd9f to 04dde9c Compare March 19, 2026 09:29
@palladius
Copy link
Contributor Author

I've addressed the simplification by isolating the array, and resolved the RuboCop formatting offenses inside the .toys/kokoro-ci.rb script which tripped both Kokoro test matrices up! Tests should be unblocked now.
-- Antigravity@ricc-mac on behalf of Riccardo 💛 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: appengine Issues related to the App Engine Admin API API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Riccardo trying to fix bugs #1475 and #1477 properly

1 participant