Skip to content

OpenConceptLab/ocl_online#798 | EXPANSION_FHIR_RULES_TOGGLE is in toggles.json, off in every environment - #1110

Open
paynejd wants to merge 1 commit into
masterfrom
fhir-452-rules-toggle
Open

paynejd wants to merge 1 commit into
masterfrom
fhir-452-rules-toggle

Conversation

@paynejd

@paynejd paynejd commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Ticket: OpenConceptLab/ocl_online#798

Adds EXPANSION_FHIR_RULES_TOGGLE, the switch #1086 reads, to core/fixtures/toggles.json: active, and off in every environment.

Why: python manage.py dry_run_expansions --toggle EXPANSION_FHIR_RULES_TOGGLE reports what a rebuild would change with the switch on, and saves nothing. The command refuses a toggle that has no active row in the database, and this one has none. load_fixtures adds the row when a container starts.

On master nothing reads the switch yet. #1088 and #1087 are the first to use it, so a dry run shows its effect only on a build that has them.

Nothing changes for anyone. Without a row the switch already reads as off. The list of toggles gets one more name, with its value false.

The row is pk 15, because 14 is on master and #1096 uses 13.

Tests

  • test_the_toggle_ships_off_in_every_environment: the row the fixture loads is active, off in every environment, and read as off.
  • test_a_dry_run_can_turn_the_toggle_on: the command takes the toggle and reports on an expansion. Without the row it fails with Unknown toggles.
  • core.collections, core.toggles and core.common: 982 tests OK; pylint 10.00 on core/collections.
  • With OpenConceptLab/ocl_issues#3036 | FHIR: code system supplements and reserved code spaces, and stored value sets' listed codes #1105's branch merged in locally, which holds the whole series, the tests that delete or set this row pass: core.collections, core.toggles, core.fhir.workspace, core.fhir.tests_stored and core.sources.tests.tests_supplements, 1,339 tests OK (1 skipped).

Review

One Codex pass (codex-cli 0.169.0, xhigh) on 12b39a18 raised two points. Neither changed the diff:

  • P1, the dry run shows nothing on master alone: true, and described above. It's about when to run it, not this change.
  • P2, a server whose own toggle already has id 15 would have it overwritten: accepted. Every row of this fixture is loaded by id.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qVQviVc1p6MQwqUUed

…gles.json, off in every environment

dry_run_expansions --toggle refuses a toggle with no active row in the
database, and this one had none: core/fixtures/toggles.json, which every
container loads on start, didn't have it. It's off everywhere, as an absent
one already reads, so nothing changes for anyone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVQviVc1p6MQwqUUed

@snyaggarwal snyaggarwal 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.

Verdict: approve.

Merge order: independent of the code. It merges cleanly with #1087, #1090 and #1093. Per the plan, merge it once #1088 lands and before the dry runs on staging. Those need #1088, #1087, #1090 and this PR there, with the switch off.

  • Nothing changes for anyone. Without a row, ExpansionEvaluation already reads the switch as off. The row is active and false in all six environments.
  • The pk is free. On master the file uses 3–5 and 8–12, plus 14, which REFERENCE_SEARCH_OPTIONS_TOGGLE holds. 13 is #1096's. As Codex noted, loaddata writes by pk, so a server with its own toggle at id 15 would have it replaced, as with every row in this file.
  • Each start reloads toggles.json. So turning the switch on for API users later, planned for Dec 15–19, is a change to this file in a PR. A row edited in the admin is reset at the next deploy. That's how the other toggles work; I'm noting it for whoever flips it.
  • Tests: the shipped-off check, and a dry run that takes --toggle EXPANSION_FHIR_RULES_TOGGLE and fails without the row. Elsewhere in the stack, #1088's update_or_create works with the row present, and your local run with #1105 merged in covers the tests that delete or set it. CI is green at 12b39a1.

I looked at #1101 and #1102 for context only. Neither touches this row.

This branch has not been deployed

No deployments
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