Skip to content

Commit 9cc26af

Browse files
TECH_DEBT: Add QA2 environment support to get_deployed_commit.py
The Deploy_All_Services pipeline has offered scale-qa2 as an environment since 82f073a, but get_deployed_commit.py only recognized dev-scale, scale-test and scale-qa. Selecting QA2 failed the Summarize job with "Unknown environment 'scale-qa2'", which skipped the dependent Deploy job. - Map scale-qa2 to a QA2_BASE_URL environment variable, alongside the existing three - List scale-qa2 in the unknown-environment and empty-BASE_URL error messages - Document scale-qa2 in the script docstring and the Scripts/README.md row - Mention QA2 in the pipeline's environment parameter displayName Verified by running the script against scale-qa2 with QA2_BASE_URL set to https://qa2-admin.nhsnlink.org, which resolved the deployed commit 78b98b4 from /api/info. Unknown environments and the direct https:// URL argument are unchanged. Requires a QA2_BASE_URL variable to be added in Azure DevOps wherever QA_BASE_URL is already defined; without it the script reports the empty-BASE_URL error rather than querying the wrong host.
1 parent e54a921 commit 9cc26af

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

Azure_Pipelines/_deploy_all_services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pool:
99

1010
parameters:
1111
- name: environment
12-
displayName: Which environment is this for? (DEV | TEST | QA)
12+
displayName: Which environment is this for? (DEV | TEST | QA | QA2)
1313
type: string
1414
values:
1515
- dev-scale

Scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ subfolder and is summarised at the end.
3434
| `set_kubernetes_services.bat <namespace> <registry> <image>` | Points a Kubernetes namespace at a registry and image. |
3535
| `aca-container-statuses.ps1` | Lists Azure Container App running state and replica bounds. |
3636
| `aca-logs.bat <container> rep\|rev <id>` | Tails Container App logs for a replica or revision. |
37-
| `get_deployed_commit.py <environment>` | Reports the commit currently deployed to `dev-scale`, `scale-test` or `scale-qa`. |
37+
| `get_deployed_commit.py <environment>` | Reports the commit currently deployed to `dev-scale`, `scale-test`, `scale-qa` or `scale-qa2`. |
3838
| `list-deploy-changes.py <from> <to>` | Lists the deployment-relevant changes between two git refs. |
3939
| `upload_to_share.py` | Uploads a directory to an Azure File Share. |
4040

Scripts/get_deployed_commit.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
python3 scripts/get_deployed_commit.py <environment>
77
88
Arguments:
9-
environment: One of dev-scale | scale-test | scale-qa
9+
environment: One of dev-scale | scale-test | scale-qa | scale-qa2
1010
1111
Environment variables expected:
12-
DEV_BASE_URL, TEST_BASE_URL, QA_BASE_URL (from your Azure DevOps variable group)
12+
DEV_BASE_URL, TEST_BASE_URL, QA_BASE_URL, QA2_BASE_URL (from your Azure DevOps variable group)
1313
1414
Purpose:
1515
- Determines the correct BASE_URL from the environment.
@@ -43,6 +43,7 @@ def main():
4343
dev_url = os.getenv("DEV_BASE_URL", "")
4444
test_url = os.getenv("TEST_BASE_URL", "")
4545
qa_url = os.getenv("QA_BASE_URL", "")
46+
qa2_url = os.getenv("QA2_BASE_URL", "")
4647

4748
base_url = ""
4849
if input_value.startswith("https://"):
@@ -56,12 +57,14 @@ def main():
5657
base_url = test_url
5758
elif environment == "scale-qa":
5859
base_url = qa_url
60+
elif environment == "scale-qa2":
61+
base_url = qa2_url
5962
else:
60-
fail(f"Unknown environment '{environment}'. Expected one of: dev-scale | scale-test | scale-qa, or a direct https:// URL")
63+
fail(f"Unknown environment '{environment}'. Expected one of: dev-scale | scale-test | scale-qa | scale-qa2, or a direct https:// URL")
6164

6265
if not base_url:
6366
fail(f"BASE_URL is empty for environment '{environment}'. "
64-
f"Ensure DEV_BASE_URL / TEST_BASE_URL / QA_BASE_URL are defined.")
67+
f"Ensure DEV_BASE_URL / TEST_BASE_URL / QA_BASE_URL / QA2_BASE_URL are defined.")
6568

6669
print(f"Environment: {environment}")
6770
print(f"BASE_URL: {base_url}")

0 commit comments

Comments
 (0)