Skip to content

[platform] Fixed run-migrations script#2126

Merged
kvaps merged 1 commit intomainfrom
fix/migrations
Mar 2, 2026
Merged

[platform] Fixed run-migrations script#2126
kvaps merged 1 commit intomainfrom
fix/migrations

Conversation

@myasnikovdaniil
Copy link
Contributor

@myasnikovdaniil myasnikovdaniil commented Mar 2, 2026

What this PR does

Release note

[platform] Fixed off-by-one error where the first required migration was always skipped.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected migration range handling so upgrade steps run for the intended version window, preventing skipped or duplicated migrations.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 2, 2026
@gemini-code-assist
Copy link
Contributor

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 addresses a critical bug in the platform's migration script, ensuring that all necessary database migrations are executed as intended. By rectifying an indexing error, it guarantees the integrity and consistency of the system's state during version upgrades.

Highlights

  • Migration Script Fix: Corrected an off-by-one error in the run-migrations.sh script that caused the first required migration to be skipped. The script now correctly starts the migration sequence from the CURRENT_VERSION.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/core/platform/images/migrations/run-migrations.sh
    • Fixed off-by-one error where the first required migration was always skipped.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fda178 and 79c5787.

📒 Files selected for processing (1)
  • packages/core/platform/images/migrations/run-migrations.sh

📝 Walkthrough

Walkthrough

The migration script's loop bounds were changed to iterate from CURRENT_VERSION (inclusive) to TARGET_VERSION (exclusive), altering which migration indices are executed; no public interfaces or exported declarations were modified.

Changes

Cohort / File(s) Summary
Migration Script
packages/core/platform/images/migrations/run-migrations.sh
Updated loop bounds to iterate from CURRENT_VERSION (inclusive) up to TARGET_VERSION (exclusive); one-line change affecting which migrations run.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through code and nudged the range,
Now versions march in a cleaner arrange,
A tiny fix, a careful hop,
Migrations line up, then I stop—🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fixed run-migrations script' directly relates to the main change, which is fixing an off-by-one error in the run-migrations script. It accurately summarizes the primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/migrations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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 fixes an off-by-one error in the migration script, ensuring that the migration for the current version is executed. However, this change appears to introduce another issue where the migration loop overshoots the target version. I've added a comment with a suggested fix to correct the loop's end condition. With that change, the migration logic should be more robust.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/platform/images/migrations/run-migrations.sh`:
- Line 27: The for-loop uses invalid arithmetic expansion around TARGET_VERSION;
replace the malformed expression so the arithmetic is evaluated inside $((...))
and pass quoted seq arguments for robustness: compute TARGET_VERSION minus one
with $((TARGET_VERSION - 1)) and call seq with the start and that computed end
as quoted arguments (e.g., seq "$CURRENT_VERSION" "$((TARGET_VERSION - 1))") so
the for loop over CURRENT_VERSION..TARGET_VERSION-1 parses and handles spaces
correctly.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e79c2f4 and 6fda178.

📒 Files selected for processing (1)
  • packages/core/platform/images/migrations/run-migrations.sh

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 2, 2026
@kvaps kvaps added the backport Should change be backported on previus release label Mar 2, 2026
@kvaps kvaps merged commit 20c91f2 into main Mar 2, 2026
10 checks passed
@kvaps kvaps deleted the fix/migrations branch March 2, 2026 16:53
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Successfully created backport PR for release-1.0:

kvaps added a commit that referenced this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previus release lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants