Skip to content

chore(env): rename KOBO_SUPPORT_EMAIL to CONSTANCE_SUPPORT_EMAIL DEV-1976#373

Open
platreth wants to merge 1 commit into
masterfrom
dev-1976-constance-support-email
Open

chore(env): rename KOBO_SUPPORT_EMAIL to CONSTANCE_SUPPORT_EMAIL DEV-1976#373
platreth wants to merge 1 commit into
masterfrom
dev-1976-constance-support-email

Conversation

@platreth

@platreth platreth commented Jul 9, 2026

Copy link
Copy Markdown

🔗 Related PRs

Part of a 3-repo Constance env-var standardization:

kpi keeps backward compatibility (old names still read, with a DeprecationWarning), so this can land independently — it simply migrates the default env file to the new name.

Description

Renames KOBO_SUPPORT_EMAILCONSTANCE_SUPPORT_EMAIL in the default django env file. Only the var name changes; the value is unchanged.

…1976

Match the Constance env-var standardization in kpi (CONSTANCE_ prefix).
Paired with kobotoolbox/kpi#7230 and kobotoolbox/kobo-install#279 — must ship together.
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR renames the KOBO_SUPPORT_EMAIL environment variable to CONSTANCE_SUPPORT_EMAIL in env/envfiles/django.txt as part of a coordinated Constance env-var standardization across three repositories. The value is unchanged; only the key name is updated.

  • Single-line env rename: KOBO_SUPPORT_EMAILCONSTANCE_SUPPORT_EMAIL in env/envfiles/django.txt; no other occurrences of the old name remain in this repo.
  • Coordinated merge required: The PR description clearly notes that kpi#7230 (app-side read) and kobo-install#279 (install template) must be released together to avoid silently reverting to the default support email.

Confidence Score: 5/5

Safe to merge once the companion PRs (kpi#7230 and kobo-install#279) are ready to release together.

The change is a single env-var key rename with the value left untouched. No old references to KOBO_SUPPORT_EMAIL remain anywhere in this repo, so there is no risk of stale lookups within kobo-docker itself. The only coordination risk is the cross-repo dependency explicitly documented in the PR description.

No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["kobo-docker env/envfiles/django.txt\n(this PR)"] -->|"CONSTANCE_SUPPORT_EMAIL\n(renamed from KOBO_SUPPORT_EMAIL)"| B["kpi app\n(kpi#7230 — reads CONSTANCE_SUPPORT_EMAIL)"]
    C["kobo-install env template\n(kobo-install#279)"] -->|"sets CONSTANCE_SUPPORT_EMAIL"| A
    B --> D["Support email surfaced to users"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["kobo-docker env/envfiles/django.txt\n(this PR)"] -->|"CONSTANCE_SUPPORT_EMAIL\n(renamed from KOBO_SUPPORT_EMAIL)"| B["kpi app\n(kpi#7230 — reads CONSTANCE_SUPPORT_EMAIL)"]
    C["kobo-install env template\n(kobo-install#279)"] -->|"sets CONSTANCE_SUPPORT_EMAIL"| A
    B --> D["Support email surfaced to users"]
Loading

Reviews (1): Last reviewed commit: "chore(env): rename KOBO_SUPPORT_EMAIL to..." | Re-trigger Greptile

@noliveleger noliveleger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but do not merge it.
We will to merge it when KPI changes are going to be released.

platreth added a commit to kobotoolbox/kpi that referenced this pull request Jul 15, 2026
… prefix DEV-1976 (#7230)

### 🔗 Related PRs
Part of a 3-repo Constance env-var standardization:
- **kobotoolbox/kobo-install#279** — same rename in the kobo-install env
template
- **kobotoolbox/kobo-docker#373** — same rename in the kobo-docker
default env file

Backward compatibility is preserved (see below), so these can land
independently — the deploy-repo PRs simply complete the migration to the
new names.

### 📣 Summary
Standardize all Constance override env vars on a single `CONSTANCE_`
prefix.

### 📖 Description
The env vars that override Constance defaults used three conventions
(bare, `KOBO_`, `CONSTANCE_`). This unifies them on `CONSTANCE_`,
matching the existing `CONSTANCE_ASR_MT_GOOGLE_*` precedent.

Renamed:
- `KOBO_SUPPORT_EMAIL` → `CONSTANCE_SUPPORT_EMAIL`
- `KOBO_SUPPORT_URL` → `CONSTANCE_SUPPORT_URL`
- `KOBO_ACADEMY_URL` → `CONSTANCE_ACADEMY_URL`
- `KOBO_COMMUNITY_URL` → `CONSTANCE_COMMUNITY_URL`
- `USAGE_LIMIT_ENFORCEMENT` → `CONSTANCE_USAGE_LIMIT_ENFORCEMENT` (env
fallback in `base.py` + pytest `env` in `pyproject.toml`)

**Backward compatible:** each override reads the new
`CONSTANCE_`-prefixed variable and falls back to the deprecated name
(`KOBO_*` / bare) when it's unset, emitting a `DeprecationWarning` so
deployments know to migrate. Old env vars keep working — no hard break.

The fallback logic lives in a new `constance_env` helper in
`kobo/settings/utils.py`, moved out of `base.py` along with
`dj_stripe_request_callback_method`.

### ✅ Test plan
- [x] `test_api_environment.py` — both settings axes
- [x] usage-limit-enforcement tests (KPI submissions, OpenRosa,
subsequences)
- [x] deprecated env var still read + `DeprecationWarning` fired
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants