Skip to main content

Dev loop

A change, start to finish​

  1. Branch from main: git checkout main && git pull && git checkout -b feat/<short-name>.

  2. Make the change, and update the page on this site that describes it (AGENTS.md, "Docs move with the code").

  3. Run the checks for what you touched:

    (cd api && go test ./...) # needs Docker for DynamoDB Local
    (cd shared/go-common && go test ./...)
    pnpm --filter @caregiver/infra test
    pnpm --filter @caregiver/docs build && python3 scripts/check-docs.py
    pnpm exec prettier --check "**/*.{ts,tsx,json,md,yaml,yml}"
  4. Commit with a Conventional Commit message (feat:, fix:, docs:…), lowercase after the colon. A hook checks it.

  5. Push and open a PR. CI deploys it to dev, and the cdk diff comment shows any infra changes.

  6. Merge when it's green. Merging deploys to prod.

Adding a feature flag​

  1. Add it to infra/lib/appconfig-schema.json (an object with a boolean enabled).
  2. Add it to infra/lib/appconfig-content.ts with enabled: false.
  3. Read it in Go through the flags client (shared/go-common/flags), or in the app through GET /flags.
  4. After the deploy, change it in the AWS AppConfig console. Note when it can be removed.

Recording a decision​

Copy docs/decisions/_template.md to the next number, fill it in, and add a row to the Decisions index.

Useful commands​

aws logs tail /aws/lambda/caregiver-dev-api --follow # dev API logs
make -C api smoke-dev # acceptance scenarios against dev
aws ce get-cost-and-usage --granularity DAILY --metrics UnblendedCost \
--time-period Start=$(date -v-30d +%Y-%m-%d),End=$(date +%Y-%m-%d) # last 30 days' cost