Skip to content

feat(server): bundle migrations in wheel and add agent-control-migrate - #209

Merged
abhinav-galileo merged 4 commits into
mainfrom
abhi/migrate-console-and-package-migrations
May 5, 2026
Merged

abhinav-galileo merged 4 commits into
mainfrom
abhi/migrate-console-and-package-migrations

Conversation

@abhinav-galileo

@abhinav-galileo abhinav-galileo commented May 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ship Alembic migration scripts and alembic.ini inside the installed wheel via hatch force-include, and expose a small agent-control-migrate console script that runs alembic upgrade head against the bundled config.

Lets non-Docker consumers (e.g. wheel-based deployments) run migrations from a vanilla install without vendoring migration files.

Scope

  • User-facing/API changes: new agent-control-migrate console script (subcommands: upgrade, downgrade, current, history, heads).
  • Internal changes: wheel layout adds agent_control_server/_alembic/ and agent_control_server/_alembic.ini (private, underscore-prefixed).
  • Out of scope: source-tree dev workflow (Makefile / docker-entrypoint.sh) is unchanged - existing alembic upgrade head from server/ still works.

Risk and Rollout

  • Risk level: low. Source-tree behavior unchanged; only adds new wheel content and a new entry point.
  • Rollback plan: revert; no schema or runtime change.

Testing

  • Added unit tests for the migrate entry point (server/unit_tests/test_migrate.py).
  • Verified the built wheel contains agent_control_server/_alembic/versions/*.py and agent_control_server/_alembic.ini.
  • Ran ruff check (server and root configs).
  • Manually verified agent-control-migrate against a real database.

Checklist

  • No doc updates needed (private bundle paths).

Ships server/alembic/ and alembic.ini inside the installed package via
hatch force-include, and exposes a small console script that runs
'alembic upgrade head' against the bundled config. Lets non-Docker
consumers run migrations from a wheel install without vendoring.
@codecov

codecov Bot commented May 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
server/src/agent_control_server/migrate.py 98.24% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Adds success-path coverage for upgrade/downgrade/current/history/heads
via monkeypatch-and-assert against alembic.command, plus a build-time
guard that the source paths hatch force-include reads from still
exist in-tree (catches accidental wheel regressions).
Drops the implicit '-1' default for 'agent-control-migrate downgrade'.
Downgrade is destructive; an operational CLI should not roll back the
schema on a typo or incomplete command. Users must now pass an explicit
revision (e.g. 'downgrade -1' or 'downgrade <rev>').
@abhinav-galileo
abhinav-galileo marked this pull request as ready for review May 4, 2026 12:34
Comment thread server/src/agent_control_server/migrate.py
Comment thread server/src/agent_control_server/migrate.py Outdated
Comment thread server/src/agent_control_server/migrate.py
Comment thread server/unit_tests/test_migrate.py
@abhinav-galileo
abhinav-galileo merged commit 8c5c35e into main May 5, 2026
6 checks passed
@abhinav-galileo
abhinav-galileo deleted the abhi/migrate-console-and-package-migrations branch May 5, 2026 16:26
galileo-automation pushed a commit that referenced this pull request May 28, 2026
## [2.6.0](ts-sdk-v2.5.0...ts-sdk-v2.6.0) (2026-05-28)

### Features

* **evaluators:** add new lluna client ([#213](#213)) ([f65beb9](f65beb9))
* **sdk:** add otel support ([#177](#177)) ([9530368](9530368))
* **sdk:** add runtime token auth ([#215](#215)) ([6cc0f38](6cc0f38))
* **server:** add control clone-and-bind endpoint ([#229](#229)) ([1728bf9](1728bf9))
* **server:** add runtime auth and namespace scoping ([#214](#214)) ([56e44fe](56e44fe))
* **server:** allow host-owned logging setup ([#227](#227)) ([c0fd159](c0fd159))
* **server:** bundle migrations in wheel and add agent-control-migrate ([#209](#209)) ([8c5c35e](8c5c35e))
* **server:** migrate controls routes to auth framework ([#212](#212)) ([764bd4b](764bd4b))

### Bug Fixes

* **examples:** declare local SDK workspace deps ([#222](#222)) ([d22aa1d](d22aa1d))
* **sdk:**  Get trace context from provider ([#211](#211)) ([1efe30f](1efe30f))
* **sdk-ts:** normalize generated client ([#231](#231)) ([1c097d2](1c097d2))
* **server:** make observability migration retry-safe ([#226](#226)) ([b9dd00d](b9dd00d))
* **server:** prevent migration lock transactions ([#224](#224)) ([e65a2f4](e65a2f4))
* **server:** scope auth upstream CA to HTTP provider ([#232](#232)) ([7a0ce21](7a0ce21))
* **ui:** fix editing of controls in the UI ([#218](#218)) ([981e33d](981e33d)), closes [#Risk](https://github.com/agentcontrol/agent-control/issues/Risk)
@galileo-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 2.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants