Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dsw-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- `sentry.environment` (`SENTRY_ENVIRONMENT`) defaults to `development` instead of `production`, as in the backend, so a deployment that does not set it no longer reports as production
- `SentryReporter.initialize` takes `component` (the `component` tag) instead of `prog_name`
- Multi-tenant mode is read from `multiTenancy.enabled` (`MULTI_TENANCY_ENABLED`), the backend's new name for the section; `cloud.enabled` (`CLOUD_ENABLED`) is still read when `multiTenancy.enabled` is not set

## [4.34.0]

Expand Down
10 changes: 10 additions & 0 deletions packages/dsw-config/dsw/config/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ class _CloudKeys(ConfigKeysContainer):
)


class _MultiTenancyKeys(ConfigKeysContainer):
enabled = ConfigKey(
yaml_path=['multiTenancy', 'enabled'],
var_names=['MULTI_TENANCY_ENABLED'],
default=False,
cast=cast_bool,
)


class _SentryKeys(ConfigKeysContainer):
enabled = ConfigKey(
yaml_path=['sentry', 'enabled'],
Expand Down Expand Up @@ -286,5 +295,6 @@ class ConfigKeys(ConfigKeysContainer):
database = _DatabaseKeys
general = _GeneralKeys
logging = _LoggingKeys
multi_tenancy = _MultiTenancyKeys
s3 = _S3Keys
sentry = _SentryKeys
6 changes: 5 additions & 1 deletion packages/dsw-config/dsw/config/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ def logging(self) -> model.LoggingConfig:

@property
def cloud(self) -> model.CloudConfig:
key = self.keys.multi_tenancy.enabled
if not self.has_value_for_key(key):
# the section's name before the backend renamed it
key = self.keys.cloud.enabled
return model.CloudConfig(
multi_tenant=self.get(self.keys.cloud.enabled),
multi_tenant=self.get(key),
)

@property
Expand Down
11 changes: 11 additions & 0 deletions packages/dsw-config/tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ def test_yaml_boolean():
assert make_parser().cloud.multi_tenant is False


def test_multi_tenancy():
assert make_parser('multiTenancy:\n enabled: true\n').cloud.multi_tenant is True
parser = make_parser('multiTenancy:\n enabled: false\ncloud:\n enabled: true\n')
assert parser.cloud.multi_tenant is False


def test_multi_tenancy_env_var_wins_over_cloud(monkeypatch):
monkeypatch.setenv('DSW_MULTI_TENANCY_ENABLED', 'true')
assert make_parser('cloud:\n enabled: false\n').cloud.multi_tenant is True


def test_sentry_numeric_options():
parser = make_parser('sentry:\n maxBreadcrumbs: 100\n tracesSampleRate: 0.5\n')
sentry = parser.sentry
Expand Down
2 changes: 1 addition & 1 deletion packages/dsw-data-seeder/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ logging:
level: INFO
globalLevel: WARNING

cloud:
multiTenancy:
enabled: True

extraDatabases:
Expand Down
3 changes: 2 additions & 1 deletion packages/dsw-mailer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- Sentry events carry the same tags as the backend's: `component` is the persistent command component (`mailer`), and a command sets `function`, `tenantUuid`, `traceUuid` (the command UUID, the `traceId` of the logs), the user who created it, and its trace; `command_uuid` / `tenant_uuid` are gone

- Mails are translated with the tenant's mail template locales (Wizard 5.0): one mail is sent per recipient, in the mail template locale whose code matches the recipient's UI locale (exact code, then the base language), otherwise the tenant's default one, otherwise `en`, otherwise built-in English; disabled locales are skipped and a recipient who is not a user gets the default
- A command with `sendAsOne` sends a single mail to all its recipients in English (the analytics mails); a command without the field, queued before the upgrade, is sent per recipient
- A command with `sendAsOne` sends a single mail to all its recipients in English; a command without the field, queued before the upgrade, is sent per recipient
- The compiled `mail.mo` of a mail template locale is stored back to S3 next to its `mail.po` and cached locally until the locale's `updated_at` changes, instead of compiling the PO for every mail
- A mail template locale that cannot be loaded is reported and the mail is sent in English
- The `registry` mode is unchanged: English, without locales
Expand All @@ -26,6 +26,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Removed

- The `registrationCreatedAnalytics` templates of the Wizard and the registry, which the backend no longer sends
- The three POT files (`default`, `wizard` and `registry`, built with `pybabel` and `make-header.sh`): `make pot` builds the one `mail.pot`
- The illustrations color (`style.illustrations_color` in templates, `illustrationsColor` and `styleIllustrationsColor` in the input, the `DEFAULT_ILLUSTRATIONS_COLOR` variable): Wizard 5.0 removed it

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading