Skip to content

Introduce ug command and Phase 1 migration path - #458

Open
rohita5l wants to merge 7 commits into
mainfrom
feat/ug-phase-1
Open

Introduce ug command and Phase 1 migration path#458
rohita5l wants to merge 7 commits into
mainfrom
feat/ug-phase-1

Conversation

@rohita5l

@rohita5l rohita5l commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the ug console entry point while retaining ucode as a supported alias
  • make the README and CLI commands/guidance lead with ug, while preserving Unity Gateway branding in agent launch banners and Smart Router notices
  • make ug upgrade distribution-aware: upgrade ucode normally before cutover, migrate only on uv's confirmed metadata-name mismatch, then upgrade unity-gateway normally afterward
  • preserve the existing installation on unrelated upgrade failures and verify both ug and ucode after every successful upgrade
  • add focused coverage for both entry points, invocation-aware help, all three upgrade lifecycle stages, failure safety, renamed guidance, and launch branding

Testing

  • .venv/bin/pytest tests/test_cli.py tests/test_entry_points.py -q (284 passed)
  • .venv/bin/ruff check .
  • .venv/bin/ruff format --check src/ucode/cli.py tests/test_cli.py
  • .venv/bin/ty check src/ucode/cli.py
  • git diff --check
  • isolated real-uv lifecycle probe: confirmed ucode metadata mismatch at cutover, successful reinstall as unity-gateway, and normal post-cutover uv tool upgrade unity-gateway

Release requirement

Merge and tag this commit while [project].name is still ucode. That immutable tag is the bridge release and must exist before the distribution-name cutover.

Comment thread src/ucode/cli.py
workspace=workspace,
profile=profile,
command_label="Configure Unity Gateway",
command_label="Configure ug",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

leave as Configure Unity Gateway ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Configure ug sounded better ? Configure Unity Gateway sounded weird ? thats the whole product

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Configure unity-gateway?

Comment thread src/ucode/cli.py
workspace=workspace,
profile=profile,
command_label="Configure Unity Gateway",
command_label="Configure ug",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Configure unity-gateway?

Comment thread src/ucode/cli.py
Comment thread src/ucode/cli.py
Comment thread src/ucode/cli.py
f"{f': {detail}' if detail else '.'}"
)
print_note("The existing installation was left unchanged.")
raise typer.Exit(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not 100% sure about the difference between this and

raise typer.Exit(1) from None

which seems to be used more widely below

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

agent telling me this is ok, but

typer.Exit subclasses RuntimeError, so this gets caught by the except RuntimeError below and adds a trailing ERROR 1 after the real error. Minor, but an except typer.Exit: raise before that handler would avoid it.

Comment thread src/ucode/cli.py
print_note("The existing installation was left unchanged.")
raise typer.Exit(1)

_verify_upgraded_commands()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: i think this should only be ran if migrated is true?

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