Merged
Conversation
added 7 commits
March 31, 2026 18:48
…and to be flexible, verifying all necessary directories and creating them if missing
…multicloud perspective
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the macro command implementation into a dedicated Babylon/commands/macro/helpers/ package, migrates Babylon “remote state” storage from Azure Blob Storage to Kubernetes Secrets, and adjusts webapp destroy behavior to rely on Terraform state rather than Babylon’s state file.
Changes:
- Extracted shared macro logic (ACL/security diffing, workspace K8s resources + Postgres schema jobs, Terraform webapp operations) into new helper modules.
- Reworked namespace/state handling to remove
state-idand persist/list remote states via Kubernetes Secrets. - Updated templates and test scripts to match the new CLI behavior (
babylon namespace useno longer takes-s,babylon initnow requires a provider argument).
Reviewed changes
Copilot reviewed 29 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Dependency lock updates (incl. cosmotech-api bump) to support the refactor and environment changes. |
tests/unit/test_macro.py |
Updates unit test imports to point to the new shared macro helper module. |
tests/integration/test_api_endpoints.sh |
Adjusts namespace CLI usage to remove -s/--state-id. |
tests/e2e/test_e2e.sh |
Adjusts namespace CLI usage and updates babylon init invocation to require a provider argument. |
Babylon/utils/kubernetes_state.py |
Adds new Kubernetes Secret-based state persistence/retrieval utility. |
Babylon/utils/environment.py |
Removes Azure Blob state handling, adds Kubernetes-backed remote state + updated namespace persistence. |
Babylon/utils/decorators.py |
Removes --state-id injection and updates context/tenant option docs. |
Babylon/templates/working_dir/terraform_cloud/tfc_workspace_create.yaml |
Removes Terraform Cloud workspace template (no longer used). |
Babylon/templates/working_dir/terraform_cloud/tfc_variables_create.yaml |
Removes Terraform Cloud variables template (no longer used). |
Babylon/templates/working_dir/.templates/yaml/kob/Webapp.yaml |
Adds KOB/on-prem webapp manifest template. |
Babylon/templates/working_dir/.templates/yaml/kob/variables.yaml |
Adds KOB/on-prem variables template. |
Babylon/templates/working_dir/.templates/yaml/dataset/customers.csv |
Removes dataset CSV template. |
Babylon/templates/working_dir/.templates/yaml/azure/Webapp.yaml |
Adds Azure webapp manifest template. |
Babylon/templates/working_dir/.templates/yaml/azure/variables.yaml |
Expands Azure variables template with clearer guidance/comments. |
Babylon/templates/working_dir/.templates/webapp/webapp_details.yaml |
Removes legacy webapp details template. |
Babylon/templates/working_dir/.templates/webapp/webapp_config.yaml |
Removes legacy webapp config template. |
Babylon/templates/working_dir/.templates/webapp/app_insight.json |
Removes legacy Application Insights template. |
Babylon/commands/namespace/get_contexts.py |
Updates output to remove STATE ID column. |
Babylon/commands/namespace/get_all_states.py |
Refactors local/remote state listing; remote now points to Kubernetes Secrets. |
Babylon/commands/macro/init.py |
Reworks project scaffolding; init now requires a provider argument and uses provider-scoped templates. |
Babylon/commands/macro/helpers/workspace.py |
New module consolidating workspace CRUD, K8s Secret/ConfigMap lifecycle, and Postgres schema jobs. |
Babylon/commands/macro/helpers/webapp.py |
New module consolidating Terraform webapp apply/destroy helpers. |
Babylon/commands/macro/helpers/common.py |
New module consolidating include/exclude resolution and ACL/security update helpers. |
Babylon/commands/macro/helpers/__init__.py |
Adds helpers package init. |
Babylon/commands/macro/destroy.py |
Converts macro destroy into a thin orchestrator that calls helper modules; switches remote state sync to Kubernetes. |
Babylon/commands/macro/deploy.py |
Removes the old monolithic deploy helper module (split into helpers). |
Babylon/commands/macro/deploy_workspace.py |
Converts workspace deploy into an orchestrator calling the new workspace helpers; remote state sync to Kubernetes. |
Babylon/commands/macro/deploy_webapp.py |
Switches Terraform helper import to the new webapp helper module; tightens chmod. |
Babylon/commands/macro/deploy_solution.py |
Switches shared ACL/security helper import and remote state sync to Kubernetes. |
Babylon/commands/macro/deploy_organization.py |
Switches shared ACL/security helper import and remote state sync to Kubernetes. |
Babylon/commands/macro/apply.py |
Updates include/exclude helper import to the new shared module. |
.github/workflows/ci.yml |
Removes Azure Blob env secrets and clarifies step names for Azure login/AKS context. |
Comments suppressed due to low confidence (1)
Babylon/utils/environment.py:282
- The guidance printed when
namespace.yamlis missing is out of date: it suggestsbabylon namespace use <tenant-name>, but thenamespace usecommand now requires-c/--contextand-t/--tenant. Updating this message will prevent user confusion when they hit this error path.
logger.error(f" [bold red]✘[/bold red] [cyan]{ns_file}[/cyan] not found")
logger.info(" Run the following command to set your active namespace:")
logger.info(" [cyan]babylon namespace use <tenant-name>[/cyan]")
sys.exit(1)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sellisd
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi new PR