Skip to content

fix(build): resolve gcl_sdk migrations path instead of hardcoding it - #551

Open
VasilyStepanov wants to merge 1 commit into
masterfrom
fix/gcl-sdk-migrations-path
Open

fix(build): resolve gcl_sdk migrations path instead of hardcoding it#551
VasilyStepanov wants to merge 1 commit into
masterfrom
fix/gcl-sdk-migrations-path

Conversation

@VasilyStepanov

@VasilyStepanov VasilyStepanov commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fix ra-apply-migration failing with FileNotFoundError when applying gcl_sdk's migrations during the core image build.

install.sh/bootstrap.sh hardcoded the migrations path as $GC_PATH/.venv/lib/python3.14/site-packages/gcl_sdk/migrations. This breaks in dev-mode builds (LOCAL_GENESIS_SDK_PATH set), where
gcl_sdk is installed editable via pip install -e and no physical site-packages/gcl_sdk/ directory exists — only a finder redirect to the source tree.

Resolve the path dynamically instead:

GCL_SDK_MIGRATIONS_PATH=$(python3 -c "import os, gcl_sdk.migrations as m; print(os.path.dirname(m.__file__))")
ra-apply-migration --path "$GCL_SDK_MIGRATIONS_PATH"

Works for both a normal and an editable install, and isn't tied to a specific python version.

Summary by Sourcery

Resolve gcl_sdk migration path dynamically during image bootstrap and install to avoid failures in different installation modes.

Bug Fixes:

  • Fix core image build migrations failing with FileNotFoundError when gcl_sdk is installed in editable mode.

Build:

  • Make migration application scripts robust to Python version and installation layout by computing gcl_sdk migrations path at runtime.

The path baked in a literal python3.14 site-packages location. That
assumption already breaks in the common dev-mode build (LOCAL_GENESIS_SDK_PATH
set -> gcl_sdk reinstalled with `pip install -e`), since an editable
install has no physical site-packages/gcl_sdk directory at all, only
a finder redirecting to the source tree - regardless of python version.

Resolve it via gcl_sdk.migrations.__file__ in the already-activated
venv instead, which works for both a normal and an editable install.
@VasilyStepanov
VasilyStepanov requested a review from a team as a code owner August 3, 2026 18:06
@sourcery-ai

sourcery-ai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR fixes build-time migration application for gcl_sdk by dynamically resolving the migrations module path via Python instead of hardcoding a site-packages path tied to a specific Python version and installation layout.

File-Level Changes

Change Details Files
Resolve gcl_sdk migrations path dynamically via Python instead of hardcoding a version-specific site-packages path in build scripts.
  • Replace hardcoded gcl_sdk migrations directory string with a Python one-liner that imports gcl_sdk.migrations and prints its directory path.
  • Introduce a GCL_SDK_MIGRATIONS_PATH shell variable to hold the resolved migrations directory.
  • Update ra-apply-migration invocations to use GCL_SDK_MIGRATIONS_PATH for gcl_sdk migrations while leaving other migration paths unchanged.
exordos/images/bootstrap.sh
exordos/images/install.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants