Skip to content

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

Closed
palladius wants to merge 1 commit intomainfrom
fix-1475-1477-rails-ubuntu22
Closed

fix(appengine): modernize rails-cloudsql gae flex ruby examples#1672
palladius wants to merge 1 commit intomainfrom
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:30
@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 Ruby rails-cloudsql examples for Google App Engine flexible environment. It updates the required Ruby version to 3.2.0 or newer and configures the App Engine deployment to use Ubuntu 22. These changes ensure compatibility with the latest Rails versions and align the examples with current best practices, while also adjusting the CI pipeline to correctly test these updated configurations.

Highlights

  • Ruby Version Update: The rails-cloudsql examples for both MySQL and PostgreSQL now explicitly require Ruby version 3.2.0 or newer in their Gemfiles.
  • App Engine Runtime Configuration: The app.yaml files for the rails-cloudsql examples have been updated to specify ubuntu22 as the operating system in the runtime_config.
  • CI Pipeline Adjustment: The Kokoro CI configuration has been modified to ensure that the rails-cloudsql examples are tested only with the newest Ruby version, aligning with their Rails 7 and Ruby 3.2+ requirements, and are excluded from runs using older Ruby versions.
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.

@palladius palladius closed this Mar 19, 2026
@palladius palladius deleted the fix-1475-1477-rails-ubuntu22 branch March 19, 2026 08:30
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-cloudsql examples for App Engine Flex by updating them to use Ruby 3.2 and the Ubuntu 22 operating system. The changes to the Gemfile and app.yaml files are appropriate for this goal. The CI configuration in .toys/kokoro-ci.rb is also updated to ensure these modernized examples are tested with the correct Ruby version. I have added a comment with a suggestion to improve the maintainability and readability of the CI script by refactoring repeated code.

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 logic can be improved for readability and maintainability. The directory names are repeated from earlier in the file (lines 157-158) and the chained != checks are less clear than using Array#include?.

Consider defining the list of cloudsql directories as a constant or local variable at a higher scope, for example:

CLOUDSQL_DIRS = %w[
  appengine/rails-cloudsql-postgres
  appengine/rails-cloudsql-mysql
].freeze

Then you could use it to simplify the logic in both places. Here, it would look like this:

@products.delete_if do |dir|
  dir.start_with?("appengine/") && !CLOUDSQL_DIRS.include?(dir)
end

And on lines 157-158, the deletion could be simplified to:

CLOUDSQL_DIRS.each { |dir| @products.delete dir }

This would make the code DRY and easier to update.

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