Skip to content

Commit 7e241d2

Browse files
authored
Merge branch 'develop' into chore/rename-permission-guard
2 parents 397b9d6 + 1bc73c7 commit 7e241d2

File tree

57 files changed

+3082
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3082
-250
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
name: Release Tracker
3+
about: Track the release handoff to OFA, staging validation, and production deployment.
4+
title: Release Tracker vX.X.X
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
# Release Tracker Issue Template
11+
12+
**TITLE:** Release vX.X.X
13+
14+
**CONTENT:**
15+
16+
### 🔗 Included Pull Requests (Dev Team)
17+
*List the PRs included in this release. **Testing instructions for each feature must be located within these linked PRs.***
18+
* #XXX - [Feature/Bugfix Title]
19+
* #XXX - [Feature/Bugfix Title]
20+
21+
### ➡️ URL of GitHub Release Tag:
22+
https://github.com/raft-tech/TANF-app/releases/tag/vX.X.X
23+
24+
---
25+
26+
### 📦 1. Preparation & Handoff (Dev / UX / PM)
27+
*Ensuring the release branch is ready and documented before ACF takes over.*
28+
29+
- [ ] **Release Tagged:** `develop` branch tagged with the new release version.
30+
- [ ] **Release Branch Created:** Branch cut from `develop`.
31+
- [ ] **PR Opened to Staging:** PR opened from the release branch to `HHS:main`.
32+
- [ ] **Testing Instructions Verified:** All linked PRs contain clear testing instructions for ACF validation.
33+
- [ ] **UX/Documentation Check:** UX team has reviewed the PRs, confirmed user-facing changes, and started drafting Release Notes and Knowledge Center guidance.
34+
- [ ] **Migration Flag:** Does this release include a database migration? **[Yes / No]** *(If Yes, rollback from production will be highly complex).*
35+
- [ ] **Handoff Complete:** Issue assigned to @[Alex_username] for Staging validation.
36+
37+
---
38+
39+
### 🧪 2. Staging Validation & QASP (ACF / Alex)
40+
*Tracking the status once ACF takes over deployment and testing.*
41+
42+
- [ ] **Staging Cleared:** Team notified that Staging is about to be updated/restarted.
43+
- [ ] **Deployed to Staging:** PR merged and deployed to the Staging environment.
44+
- [ ] **Feature Validation:** Testing instructions from the linked PRs have been executed and passed.
45+
- [ ] **Regression Validation:** Core workflows (login, submissions, data integrity, etc.) remain functional.
46+
47+
**🐛 Bug Tracking Protocol (If issues are found in Staging):**
48+
1. **Non-Dev Team:** Add a comment on this issue describing the bug/unexpected behavior.
49+
2. **Dev Team:** Review the comment, investigate root cause, and open a formal GitHub Issue.
50+
3. **Triage Decision:**
51+
* *Revert:* If isolated to a new feature, revert the PR out of the release candidate.
52+
* *Hotfix:* Warranted **only if** the bug blocks the release entirely AND the production release is needed ASAP. (Dev cuts hotfix PR against the release branch -> merged to `HHS:main` for re-testing).
53+
54+
- [ ] **Documentation Finalized:** UX team confirms all Release Notes and Knowledge Center updates are finalized and ready for launch.
55+
56+
---
57+
58+
### 🚦 3. Production-Ready Sign-Off
59+
- [ ] ACF/Alex confirms all PRs are validated, no blocking bugs exist, documentation is finalized, and the release is approved for production deployment.
60+
61+
---
62+
63+
### 🛟 4. Rollback & Contingency Reference
64+
*Review before production deployment.*
65+
66+
* **Pipeline/CircleCI Failure:** Retry the pipeline. If it fails again, requires a hotfix to unblock.
67+
* **Missing Config/Secrets (App crashes on boot):** Do not rollback. ACF updates environment variables in the production console and restarts the app.
68+
* **Third-Party API Blocked in Prod:** Dev provides an emergency hotfix to hide the broken UI component.
69+
* **Performance/Database Lockup Under Load:** Dev writes an emergency hotfix for the offending query.
70+
* **Critical Regression Post-Deploy:**
71+
* *No migrations in release:* Rollback the deployment to the previous stable version.
72+
* *Migrations in release:* Rollback is generally not possible; requires an emergency hotfix.
73+
74+
---
75+
76+
### 🚀 5. Production Deployment (ACF / Alex)
77+
*The final deployment executed by ACF.*
78+
79+
- [ ] **Maintenance Mode:** Alex has enabled the maintenance page to ensure users are out of the system.
80+
- [ ] **Deployed to Prod:** PR opened and merged to `HHS:master`, triggering deployment.
81+
- [ ] **Post-Launch Verification:** Quick check that the production environment is stable post-deploy, and the maintenance page is deactivated.
82+
83+
---
84+
85+
### 📢 6. Post-Release Communication (PM / UX / ACF)
86+
*Closing the loop with users and stakeholders.*
87+
88+
- [ ] **Release Notes Published:** (UX team) Plain-language, user-facing release notes and Knowledge Center guidance have been published.
89+
- [ ] **Stakeholders Notified:** (ACF) Any required external communication regarding the new version has been sent.
90+
- [ ] **Close this Issue:** (ACF / PM) The release is fully deployed and stable.

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tdrs-frontend/yarn-error.log*
1212
tdrs-frontend/vars-frontend.yml
1313
tdrs-frontend/pa11y-screenshots/*
1414
tdrs-frontend/cypress/reports*
15+
tdrs-frontend/test-results*.xml
1516
.eslintcache
1617
downloads/
1718

@@ -125,8 +126,3 @@ cypress.env.json
125126
tdrs-backend/*.pg
126127
tdrs-backend/django.log
127128

128-
# Pytest cache
129-
tdrs-backend/.pytest_cache/*
130-
131-
# frontend cypress test results
132-
tdrs-frontend/test-results*.xml

Taskfile.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ tasks:
293293
dir: tdrs-backend
294294
cmds:
295295
- export CYPRESS_TOKEN=local-cypress-token
296-
- docker-compose exec web python manage.py delete_cypress_users -usernames new-cypress@teamraft.com cypress-admin@teamraft.com
297-
- docker-compose exec web python manage.py loaddata cypress/users cypress/data_files cypress/regions cypress/profile_editing_regions cypress/profile_editing_users
296+
- docker compose -f docker-compose.yml exec web python manage.py delete_cypress_users -usernames new-cypress@teamraft.com cypress-admin@teamraft.com cypress-data-analyst-dana@teamraft.com cypress-fra-data-analyst-derek@teamraft.com cypress-data-analyst-donna@teamraft.com cypress-fra-data-analyst-david@teamraft.com cypress-fra-ofa-regional-staff-rachel@acf.hhs.gov cypress-fra-ofa-regional-staff-robert@acf.hhs.gov cypress-fra-ofa-regional-staff-rita@acf.hhs.gov cypress-fra-ofa-regional-staff-ryan@acf.hhs.gov
297+
- docker compose -f docker-compose.yml exec web python manage.py loaddata cypress/users cypress/data_files cypress/regions cypress/profile_editing_regions cypress/profile_editing_users
298298

299299
frontend-e2e-local:
300300
desc: Run Cypress E2E tests locally (Cypress on host, app in docker)
@@ -325,6 +325,13 @@ tasks:
325325
CYPRESS_API_URL=http://localhost:8989/v1 CYPRESS_ADMIN_URL=http://localhost:8989/admin CYPRESS_TOKEN={{.CYPRESS_TOKEN}} env -u ELECTRON_RUN_AS_NODE npx --yes @yarnpkg/cli-dist@4.6.0 test:e2e-ci
326326
fi
327327
328+
frontend-e2e-cmd:
329+
desc: Run Cypress E2E tests headlessly from the command line (app in docker)
330+
dir: tdrs-frontend
331+
cmds:
332+
- docker compose -f docker-compose.yml up -d --build tdp-frontend
333+
- CYPRESS_TOKEN=${CYPRESS_TOKEN:-local-cypress-token} npm run test:e2e-ci
334+
328335
k6:
329336
desc: Run k6 performance tests
330337
dir: performance-tests

cf-memory-usage.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env bash
2+
# Show memory allocation per app in the current CF space vs the space's quota.
3+
4+
set -euo pipefail
5+
6+
if ! command -v cf &>/dev/null; then
7+
echo "Error: cf CLI not found. Install it first."
8+
exit 1
9+
fi
10+
11+
if ! cf target &>/dev/null; then
12+
echo "Error: Not logged in to Cloud Foundry. Run 'cf login' first."
13+
exit 1
14+
fi
15+
16+
target_info=$(cf target)
17+
org=$(echo "$target_info" | awk '/^org:/{print $2}')
18+
space=$(echo "$target_info" | awk '/^space:/{print $2}')
19+
20+
echo "Org: $org"
21+
echo "Space: $space"
22+
echo ""
23+
24+
# Get app names from cf apps (skip header lines)
25+
app_names=$(cf apps | awk 'NR>4 && NF>0 {print $1}')
26+
27+
if [ -z "$app_names" ]; then
28+
echo "No apps found in this space."
29+
exit 0
30+
fi
31+
32+
printf "%-40s %8s %12s %15s %15s\n" "APP" "STATE" "INSTANCES" "ALLOCATED" "USED"
33+
printf "%-40s %8s %12s %15s %15s\n" "---" "-----" "---------" "---------" "----"
34+
35+
total_allocated_mb=0
36+
37+
for app_name in $app_names; do
38+
app_info=$(cf app "$app_name" 2>/dev/null || true)
39+
40+
state=$(echo "$app_info" | awk '/^requested state:/{print $3}')
41+
instances=$(echo "$app_info" | awk '/^instances:/{print $2}')
42+
mem_alloc=$(echo "$app_info" | awk '/^memory usage:/{print $3}')
43+
44+
# Parse instance memory usage from the instance line (e.g. "809M of 1G")
45+
mem_used=$(echo "$app_info" | awk '/^#[0-9]/{print $4}' | head -1)
46+
[ -z "$mem_used" ] && mem_used="N/A"
47+
48+
# Parse allocated memory into MB
49+
alloc_val=$(echo "$mem_alloc" | sed 's/[^0-9.]//g')
50+
alloc_unit=$(echo "$mem_alloc" | sed 's/[0-9.]//g')
51+
case "$alloc_unit" in
52+
G) alloc_mb=$(echo "$alloc_val * 1024" | bc) ;;
53+
M) alloc_mb="$alloc_val" ;;
54+
*) alloc_mb=0 ;;
55+
esac
56+
57+
# Multiply by total instances
58+
total_inst=$(echo "$instances" | cut -d'/' -f2)
59+
[ -z "$total_inst" ] && total_inst=1
60+
app_total_mb=$(echo "$alloc_mb * $total_inst" | bc)
61+
62+
total_allocated_mb=$(echo "$total_allocated_mb + $app_total_mb" | bc)
63+
64+
printf "%-40s %8s %12s %13sMB %15s\n" "$app_name" "$state" "$instances" "$app_total_mb" "$mem_used"
65+
done
66+
67+
echo ""
68+
echo "--- Summary ---"
69+
echo "Total memory allocated across all apps: ${total_allocated_mb}MB"
70+
71+
72+
echo ""
73+
echo ""
74+
echo ""
75+
echo "--- Space Quota Available ---"
76+
77+
# Derive env from space name (expects space like "tanf-dev", "tanf-staging", "tanf-prod")
78+
env=$(echo "$space" | awk -F'-' '{print $NF}')
79+
quota_name="${env}_quota"
80+
81+
echo "Using space quota: $quota_name"
82+
cf space-quota "$quota_name" 2>/dev/null || echo "Could not find space quota '$quota_name'."

0 commit comments

Comments
 (0)