# Clinic App-Delivery Notes

## Clinic API feature-gate whitelist

For Clinic API org whitelist changes, use the helper script instead of editing
the three lists by hand. From the repo root:

```bash
python3 clinic/scripts/add_clinic_feature_gate_org.py \
  --org-id 1372813089209325856 \
  --comment "Wetech"
```

From the `clinic/` directory:

```bash
python3 scripts/add_clinic_feature_gate_org.py \
  --org-id 1372813089209325856 \
  --comment "Wetech"
```

By default the script updates these prod-cloud Clinic API feature gates in
`clinic/clinic-api/envs/prod-cloud/configmap/config.yaml`:

- `external-feature-gates.orgs.enabledOrgs`
- `external-feature-gates.slow-query.enabledOrgs`
- `external-feature-gates.top-sql.enabledOrgs`

The script is idempotent. If an org id already exists in a target list, it will
not add a duplicate entry.

After changing the config, verify from the repo root:

```bash
kubectl kustomize clinic/clinic-api/envs/prod-cloud
```

## ArgoCD impact

`clinic/app-registry` is the ArgoCD application registry, and the Clinic API
ApplicationSet points ArgoCD at `clinic/clinic-api/envs/{{env}}`.

Adding docs or tooling files under `clinic/`, such as this `AGENTS.md` or files
under `clinic/scripts/`, does not affect ArgoCD by itself because those files
are not referenced by the app registry or any kustomization. Editing
`clinic/clinic-api/envs/prod-cloud/configmap/config.yaml` does affect the
prod-cloud Clinic API deployment because that file is included by the
prod-cloud kustomization's `clinic-config` ConfigMap generator.
