From 8733d05c03c8072307f3b3933a893ff3511d5d88 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Sat, 19 Sep 2026 03:55:44 +0200 Subject: [PATCH] Rename environment variable ITEM_INVESTIGATION_AND_STRIKES_ENABLED to SCYLLA_ENABLED --- CHANGELOG.md | 2 +- server/.env.example | 2 +- server/iocContainer/index.ts | 16 ++++------------ server/scylla/noOpScylla.test.ts | 4 ++-- server/scylla/noOpScylla.ts | 6 +++--- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc13d7c8b..ebb6ccd95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ For more information about each release including git tags and artifacts, see [R ### Changed -- Scylla is now optional via `ITEM_INVESTIGATION_AND_STRIKES_ENABLED` ([#918](https://github.com/roostorg/coop/pull/918) by [@sunilatlas](https://github.com/sunilatlas)) +- Scylla is now optional via `SCYLLA_ENABLED` ([#918](https://github.com/roostorg/coop/pull/918) by [@sunilatlas](https://github.com/sunilatlas), [#1268](https://github.com/roostorg/coop/pull/1268) by [@thisismissem](https://github.com/thisismissem)) - Settings "Other" tab renamed to "Partial Items" and its settings relocated ([#965](https://github.com/roostorg/coop/pull/965) by [@golden-fox07](https://github.com/golden-fox07)) - Queue deletion is refused while routing rules still reference the queue ([#808](https://github.com/roostorg/coop/pull/808) by [@reitblatt](https://github.com/reitblatt)) - Long text fields in the review console collapse behind a "Read more" control ([#903](https://github.com/roostorg/coop/pull/903) by [@taobojlen](https://github.com/taobojlen)) diff --git a/server/.env.example b/server/.env.example index 15ab39bfd..d78144f10 100644 --- a/server/.env.example +++ b/server/.env.example @@ -82,7 +82,7 @@ HMA_SERVICE_URL=http://localhost:9876 # empty (strike counts read as 0) and writes are dropped. When "false" (or # "0"/"no"), the SCYLLA_* connection settings below are not required. # Defaults to enabled. -ITEM_INVESTIGATION_AND_STRIKES_ENABLED=true +SCYLLA_ENABLED=true SCYLLA_USERNAME=cassandra SCYLLA_PASSWORD=cassandra SCYLLA_HOSTS='127.0.0.1:9042' diff --git a/server/iocContainer/index.ts b/server/iocContainer/index.ts index 9c231a42f..829aac175 100644 --- a/server/iocContainer/index.ts +++ b/server/iocContainer/index.ts @@ -783,9 +783,7 @@ export default async function getBottle( executionContext, ); }, - itemInvestigationAndStrikesEnabled( - process.env.ITEM_INVESTIGATION_AND_STRIKES_ENABLED, - ), + itemInvestigationAndStrikesEnabled(process.env.SCYLLA_ENABLED), ), ); @@ -799,18 +797,12 @@ export default async function getBottle( bottle.factory('Scylla', () => { // Scylla backs the item-investigation and user-strike features. Operators // who don't need those (and don't want to run a Scylla cluster) can set - // `ITEM_INVESTIGATION_AND_STRIKES_ENABLED=false` to swap in a no-op that + // `SCYLLA_ENABLED=false` to swap in a no-op that // drops writes and returns empty reads, so no `SCYLLA_*` connection env // vars are required. Defaults to enabled to preserve existing behaviour. - if ( - !itemInvestigationAndStrikesEnabled( - process.env.ITEM_INVESTIGATION_AND_STRIKES_ENABLED, - ) - ) { + if (!itemInvestigationAndStrikesEnabled(process.env.SCYLLA_ENABLED)) { // eslint-disable-next-line no-restricted-syntax - logJson( - 'scylla.disabled ITEM_INVESTIGATION_AND_STRIKES_ENABLED=false; using no-op Scylla', - ); + logJson('scylla.disabled SCYLLA_ENABLED=false; using no-op Scylla'); return new NoOpScylla(); } diff --git a/server/scylla/noOpScylla.test.ts b/server/scylla/noOpScylla.test.ts index bbf1c4049..c220d2fad 100644 --- a/server/scylla/noOpScylla.test.ts +++ b/server/scylla/noOpScylla.test.ts @@ -5,7 +5,7 @@ import Scylla from './scylla.js'; /** * Tests for the Scylla-disabled path used when - * `ITEM_INVESTIGATION_AND_STRIKES_ENABLED=false`. + * `SCYLLA_ENABLED=false`. * * Two things are covered: * 1. The behavioural contract of {@link NoOpScylla} (drops writes, empty reads, @@ -16,7 +16,7 @@ import Scylla from './scylla.js'; * default-enabled (upstream-preserving) behaviour is guarded by a test. */ -describe('ITEM_INVESTIGATION_AND_STRIKES_ENABLED gate predicate', () => { +describe('SCYLLA_ENABLED gate predicate', () => { test('defaults to enabled when unset (preserves upstream behaviour)', () => { expect(itemInvestigationAndStrikesEnabled(undefined)).toBe(true); expect(itemInvestigationAndStrikesEnabled('')).toBe(true); diff --git a/server/scylla/noOpScylla.ts b/server/scylla/noOpScylla.ts index 99ab71fa7..b5348c2bd 100644 --- a/server/scylla/noOpScylla.ts +++ b/server/scylla/noOpScylla.ts @@ -2,8 +2,8 @@ import { type CqlSelectOptions, type DBDefinition } from './cqlUtils.js'; import Scylla from './scylla.js'; /** - * Parses the `ITEM_INVESTIGATION_AND_STRIKES_ENABLED` feature flag from its raw - * string value (i.e. `process.env.ITEM_INVESTIGATION_AND_STRIKES_ENABLED`). + * Parses the `SCYLLA_ENABLED` feature flag from its raw + * string value (i.e. `process.env.SCYLLA_ENABLED`). * * Shared by the `Scylla` DI factory in `iocContainer` (to decide whether to * return a real Scylla or a {@link NoOpScylla}) and by the unit tests. Defaults @@ -24,7 +24,7 @@ export function itemInvestigationAndStrikesEnabled( /** * A no-op implementation of {@link Scylla} used when the Scylla-backed features * (item investigation and user strikes) are disabled via - * `ITEM_INVESTIGATION_AND_STRIKES_ENABLED=false`. + * `SCYLLA_ENABLED=false`. * * Scylla has no managed offering on some deployment platforms, and some * operators do not need the features that depend on it. Rather than gate the