Skip to content

fix: always bundle runpod-flash in flash build + versioning report#227

Merged
deanq merged 6 commits intomainfrom
fix/ae-2265-bug-cross-endpoint
Feb 26, 2026
Merged

fix: always bundle runpod-flash in flash build + versioning report#227
deanq merged 6 commits intomainfrom
fix/ae-2265-bug-cross-endpoint

Conversation

@deanq
Copy link
Member

@deanq deanq commented Feb 26, 2026

Problem

When a Flash app is deployed, the worker container has two copies of runpod_flash: one pip-installed in the base image, and one bundled during flash build. The bundled copy is the one that actually executes at runtime (via sys.path.insert after unpack), but version reporting was reading from the pip-installed metadata — reporting stale versions in both the startup banner and HTTP User-Agent headers.

Additionally, --use-local-flash was a development-only flag that created confusion about how bundling works. Flash should always bundle from the installed environment.

Changes

Always bundle runpod_flash during build

  • flash build now unconditionally copies runpod_flash from site-packages into the build artifact
  • Removed --use-local-flash flag from build and deploy commands and CLI docs
  • Renamed internal functions to reflect the simplified flow

Accurate version sourcing via __version__

  • Added __version__ to __init__.py so the bundled package carries its version with it
  • User-Agent (user_agent.py) now reads runpod_flash.__version__ instead of importlib.metadata.version(), ensuring HTTP requests from inside worker containers report the actual bundled version
  • Configured release-please extra-files to auto-bump __version__ on each release (zero maintenance)

Companion PR

Test plan

  • make quality-check passes (1263 tests, 73% coverage)
  • Deploy an app and verify the startup banner shows the bundled flash version, not the base image version
  • Verify User-Agent in outbound HTTP requests reflects the bundled version

runpod_flash is now unconditionally bundled from site-packages during
every build, making --use-local-flash unnecessary. Adds __version__
constant to __init__.py so bundled code carries its own version for
accurate runtime reporting in deployed workers.

- Rename copy functions to reflect site-packages source
- Remove --use-local-flash from deploy command and docs
- Add tests for unconditional bundling behavior
- Update dotenv test to allow __version__ before imports
Added x-release-please-version annotation to __init__.py and configured
extra-files in release-please-config.json so __version__ is bumped
automatically on each release.
importlib.metadata reads the pip-installed version, which differs from
the bundled version inside worker containers. Using __version__ ensures
the user-agent reports the actual running version.
@deanq deanq changed the title Always bundle runpod_flash, add version logging Ensure accurate runtime version reporting in deployed workers Feb 26, 2026
@deanq deanq changed the title Ensure accurate runtime version reporting in deployed workers Always bundle runpod_flash in flash build, remove --use-local-flash Feb 26, 2026
@deanq deanq changed the title Always bundle runpod_flash in flash build, remove --use-local-flash fix: always bundle runpod_flash in flash build + versioning report Feb 26, 2026
@deanq deanq requested a review from Copilot February 26, 2026 17:18
@deanq deanq changed the title fix: always bundle runpod_flash in flash build + versioning report fix: always bundle runpod-flash in flash build + versioning report Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes stale version reporting in Flash worker containers by ensuring the bundled runpod_flash package is always the source of truth (both for runtime execution and for version/user-agent reporting), and removes the confusing --use-local-flash development flag.

Changes:

  • Make flash build always bundle runpod_flash from the current environment and remove --use-local-flash from build/deploy commands and docs.
  • Add runpod_flash.__version__ and update User-Agent generation to read from it instead of importlib.metadata.
  • Configure release-please to bump src/runpod_flash/__init__.py version automatically; adjust/add unit tests for the new bundling behavior.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Bumps locked version for runpod-flash to 1.4.1.
tests/unit/test_dotenv_loading.py Updates import-order assertion logic to match new __init__.py layout.
tests/unit/cli/commands/test_build.py Adds bundling-related tests and _find_runpod_flash tests; updates existing build tests for unconditional bundling.
src/runpod_flash/core/utils/user_agent.py Switches version source for User-Agent to runpod_flash.__version__.
src/runpod_flash/cli/docs/flash-deploy.md Removes --use-local-flash docs and local-dev section.
src/runpod_flash/cli/docs/README.md Removes --use-local-flash from deploy options list.
src/runpod_flash/cli/commands/deploy.py Removes --use-local-flash option wiring.
src/runpod_flash/cli/commands/build.py Implements unconditional bundling flow and removes flag-driven logic.
src/runpod_flash/__init__.py Adds __version__ constant for bundled version reporting.
release-please-config.json Adds extra-files entry so release-please bumps __version__.
Comments suppressed due to low confidence (2)

src/runpod_flash/init.py:4

  • The comment says ".env vars ... before everything else", but __version__ is now defined above the dotenv import. Either adjust the comment to reflect the new ordering (e.g., "before other imports") or move __version__ below the dotenv load if you truly intend dotenv to run first.
__version__ = "1.4.1"  # x-release-please-version

# Load .env vars from file before everything else
from dotenv import load_dotenv

src/runpod_flash/core/utils/user_agent.py:15

  • The docstring example hard-codes a specific version string (1.4.1). This will go stale on the next release and can cause confusion when comparing actual output. Consider using a placeholder in the example (e.g., <version>) or omitting the exact version value.
    Example:
        >>> get_user_agent()
        'Runpod Flash/1.4.1 (Python 3.11.12; Darwin 25.2.0; arm64)'
    """

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Package names are case-insensitive per PEP 503, so entries like
`Runpod-Flash` or `RUNPOD_FLASH` in requirements.txt would survive
filtering and reintroduce the duplicated-install conflict.
…tches

Patches were entered immediately on ExitStack before the `with` block
started, risking leaks if an exception occurred during setup. Wrapping
in @contextmanager ensures patch lifetime is strictly scoped.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deanq deanq merged commit 8f883ee into main Feb 26, 2026
10 checks passed
@deanq deanq deleted the fix/ae-2265-bug-cross-endpoint branch February 26, 2026 20:27
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.

3 participants