Skip to content

Set group country from country_code on save, and backfill - #916

Merged
edwh merged 3 commits into
developfrom
group-country-from-code
Oct 1, 2026
Merged

edwh merged 3 commits into
developfrom
group-country-from-code

Conversation

@edwh

@edwh edwh commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator
  • Group::countryNameForCode() gives the English country name for a code ('' if empty or unknown; UK is treated as GB).
  • Group sets country from it whenever country_code is set. groups:country and the backfill migration use the same lookup.
  • The migration fills country where it is empty, logging any code it can't map.

country is kept for backwards compatibility with external reports; the app itself uses country_code.

🤖 Generated with Claude Code

edwh and others added 3 commits September 23, 2026 16:05
country was only filled in by the hourly groups:country job, and recent
groups were found without it. It's kept for backwards compatibility
(Metabase reports etc.), so set it (in English) whenever country_code is
set, and backfill existing gaps.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…unknown codes

- Group::countryNameForCode() is used by the mutator, groups:country and the
  backfill migration, so they agree: '' for an empty or unknown code (the
  job's existing behaviour) instead of null from the mutator, which made the
  column flip on every save/job run.
- 'UK' (used by group CSV imports) maps to GB.
- The backfill logs codes it can't map.
- Locale test uses fr-BE, which has its own country names; fr fell back to
  English, so it couldn't catch a regression.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@edwh
edwh merged commit 7186d55 into develop Oct 1, 2026
5 checks passed
@edwh
edwh deleted the group-country-from-code branch October 1, 2026 20:16
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.

1 participant