Skip to content

feat: adk branch create --env flag to specify source env for new branch#56

Merged
bill-parker merged 8 commits intomainfrom
bill/feat/create_branch_from_env
Apr 1, 2026
Merged

feat: adk branch create --env flag to specify source env for new branch#56
bill-parker merged 8 commits intomainfrom
bill/feat/create_branch_from_env

Conversation

@bill-parker
Copy link
Copy Markdown
Contributor

@bill-parker bill-parker commented Mar 31, 2026

Summary

Adds a --env flag to poly branch create that sources a new branch from a live or pre-release deployment snapshot instead of sandbox main.

Additional points:

  • Specifying sandbox as env arg will default to existing behaviour (sandbox being the default 'base').
  • Branch creation is also followed by push, to leave a 'clean slate' for any hotfix changes required.
  • --force flag will force overwrite of any local changes on main (restrictions still apply for creating new branch from main only).

Motivation

The motivation is to facilitate hotfixes to main live environment, bypassing any subsequent changes in testing environments.
This should be used with caution and usual protocol to be followed with pushing the change.

Changes

  • project.py: added pull_project_from_env(env, format) method to class AgentStudioProject.
  • cli.py: add --env/--environment (choices: sandbox, pre-release, live) and --force/-f to branch create
  • cli.py: when --env live/pre-release is set, pull from that environment before creating the branch and push immediately after

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

@github-actions

This comment has been minimized.

@bill-parker bill-parker changed the title feat: add branch create --env flag to specify source env for new branch feat: adk branch create --env flag to specify source env for new branch Mar 31, 2026
@polyai polyai deleted a comment from github-actions Bot Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
70.8% 71.5% +0.6% ✅

Changed file coverage

File Coverage Change
poly/cli.py 39.7% +2.2% ✅
poly/project.py 66.7% +0.6% ✅

@bill-parker bill-parker merged commit e9dd3b9 into main Apr 1, 2026
3 checks passed
@bill-parker bill-parker deleted the bill/feat/create_branch_from_env branch April 1, 2026 08:58
AaronForinton added a commit that referenced this pull request Apr 14, 2026
…ch (#57)

## Summary

This PR is related to #56

## Motivation

<!-- Why is this change needed? Link to an issue if applicable. -->

Closes #<!-- issue number -->

## Changes

<!-- Bullet list of the key changes. Focus on *what* changed, not *how*.
-->

-

## Test strategy

<!-- How did you verify this works? Check all that apply. -->

- [ ] Added/updated unit tests
- [ ] Manual CLI testing (`poly <command>`)
- [ ] Tested against a live Agent Studio project
- [ ] N/A (docs, config, or trivial change)

## Checklist

- [ ] `ruff check .` and `ruff format --check .` pass
- [ ] `pytest` passes
- [ ] No breaking changes to the `poly` CLI interface (or migration path
documented)
- [ ] Commit messages follow [conventional
commits](https://www.conventionalcommits.org/)

## Screenshots / Logs

<!-- Optional: paste terminal output, screenshots, or before/after diffs
if helpful. -->

---------

Co-authored-by: Ruari Phipps <ruari@poly-ai.com>
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