Skip to content

Commit c3b44a3

Browse files
akarivclaude
andcommitted
Add bump-max-year skill
Codifies the yearly procedure of taking a verified DB backup before incrementing MAX_YEAR in the social service editor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7dc8889 commit c3b44a3

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
name: bump-max-year
3+
description: Bump MAX_YEAR in the social-service-editor by +1 after a verified DB backup. Use when the user asks to "bump max year", "update the max input year", "increment MAX_YEAR", or open the yearly data-entry window for the next year. Do not run in other contexts.
4+
---
5+
6+
# Bump MAX_YEAR
7+
8+
Yearly procedure: take a fresh DB backup, then widen the input window by one year.
9+
10+
## Steps
11+
12+
### 1. Trigger the backup workflow and wait for it to finish
13+
14+
```bash
15+
gh workflow run "Backup PostgreSQL database to S3" \
16+
--repo OpenBudget/budgetkey-app-data-input --ref master
17+
```
18+
19+
Grab the run ID and watch it:
20+
21+
```bash
22+
sleep 3
23+
RUN_ID=$(gh run list --repo OpenBudget/budgetkey-app-data-input \
24+
--workflow="Backup PostgreSQL database to S3" --limit 1 --json databaseId \
25+
--jq '.[0].databaseId')
26+
gh run watch "$RUN_ID" --repo OpenBudget/budgetkey-app-data-input --exit-status
27+
```
28+
29+
If the run fails, STOP. Report the failure to the user and do not proceed to the bump — a bump without a successful backup is what this skill exists to prevent.
30+
31+
### 2. Verify a new object landed in the bucket
32+
33+
```bash
34+
gcloud storage ls -l gs://soproc-backups/ --project=hasadna-general \
35+
| sort -k2 | tail -3
36+
```
37+
38+
Confirm the newest object's timestamp is from this run (not an older one). If no new object, STOP.
39+
40+
### 3. Bump MAX_YEAR by 1
41+
42+
File: `ui/src/app/social-service-editor/social-service-utils.ts`
43+
44+
Read the current value of the `MAX_YEAR` constant, add 1, and edit in place. Do not touch `MIN_YEAR`. Do not edit any other file.
45+
46+
### 4. Commit and push
47+
48+
```bash
49+
git add ui/src/app/social-service-editor/social-service-utils.ts
50+
git commit -m "Bump MAX_YEAR to <NEW_VALUE>"
51+
git push origin master
52+
```
53+
54+
Use the actual new value in the commit message (e.g. `Bump MAX_YEAR to 2025`).
55+
56+
## Notes
57+
58+
- The backup step is load-bearing — it exists so that a bad bump can be recovered by restoring. Never skip it, even if "nothing could go wrong."
59+
- Secrets and infra for the backup live in the `OpenBudget/budgetkey-app-data-input` repo and the `hasadna-general` GCP project (bucket `gs://soproc-backups`, SA `soproc-backup-writer@hasadna-general.iam.gserviceaccount.com`).

0 commit comments

Comments
 (0)