Skip to content

Add a new is_local info function - #218

Merged
bradhe merged 3 commits into
developfrom
tasks/add-is-local-flag-to-sdk
Mar 9, 2026
Merged

Add a new is_local info function#218
bradhe merged 3 commits into
developfrom
tasks/add-is-local-flag-to-sdk

Conversation

@bradhe

Copy link
Copy Markdown
Contributor

Helps us write logic that's specific to local runs. Otherwise, adds some tests for the existing functions as I found a bug along the way in how we process some environment variables.

@coderabbitai

coderabbitaiBot commented Mar 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 332a782a-1668-4338-b2c0-bc916ee26b70

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tasks/add-is-local-flag-to-sdk

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

CopilotAI 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.

Pull request overview

This PR adds a new runtime info helper to detect Tower CLI “local runs”, and hardens boolean env-var parsing by ensuring missing values default to "false" instead of raising.

Changes:

  • Add info.is_local() backed by TOWER__RUNTIME__IS_LOCAL.
  • Fix info.is_cloud_run() to default to "false" when TOWER__RUNTIME__IS_TOWER_MANAGED is missing.
  • Add comprehensive pytest coverage for the tower.info env-var helpers, and set TOWER__RUNTIME__IS_LOCAL=true in the CLI local-run path.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

FileDescription
tests/tower/test_info.pyAdds new unit tests covering tower.info env-var accessors and boolean parsing.
src/tower/info/__init__.pyImplements is_local() and adjusts is_cloud_run() default behavior.
crates/tower-cmd/src/run.rsInjects TOWER__RUNTIME__IS_LOCAL=true for CLI local execution.

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

Comment threadtests/tower/test_info.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bradhe
bradhe merged commit 6d703fd into developMar 9, 2026
30 checks passed
@bradhe
bradhe deleted the tasks/add-is-local-flag-to-sdk branch March 9, 2026 16:38
Sign up for freeto 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

@bradhe@socksy