Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AB#41699] Localizations integration #164

Merged
merged 32 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f68f8f3
chore: include feature branch to pr checks
AxTrusov Jul 31, 2023
72a238f
chore: disable PR checks for localization feature branch
AxTrusov Aug 1, 2023
9319a69
[AB#39600] [AB#39414] [AB#39279] [AB#39062] Movies and movie genres d…
AxTrusov Aug 1, 2023
c73c153
[AB#39602] channel localizations added (#115)
AxTrusov Aug 1, 2023
8afc2ec
[AB#39601] movie and movie genre localizations can now be published (…
AxTrusov Aug 3, 2023
e4fea13
[AB#40831] added a workaround to jest memory leak issue for CI PR bui…
AxTrusov Aug 29, 2023
1d25c41
[AB#40804] make logical replication slot name empty in .env.template …
AxTrusov Aug 29, 2023
7f36c60
[AB#40026] Localizations integrated for TV Shows, Seasons, Episodes, …
AxTrusov Sep 5, 2023
e36b842
feat: ensureReplicationSlotAndPublicationExist helper used (#153)
AxTrusov Sep 14, 2023
0f473e4
fix: prepareEntityLocalizationsForPublishing changed from mutation to…
AxTrusov Oct 4, 2023
2af7785
chore: localizations review (#178)
AxTrusov Oct 17, 2023
713c255
[AB#41785] separate replication connection string for deployment scen…
AxTrusov Oct 18, 2023
b27bd9e
chore: remove feature branch pr build indication
AxTrusov Oct 18, 2023
c211b93
fix: entity field definition title no longer includes field word (#186)
AxTrusov Oct 23, 2023
459b38d
chore: bump integration lib and apply renaming
BenjaminSchwendner Oct 23, 2023
8d72bb9
chore: bump libs and renamed registerLocalizationEntryPoints
axisuru Oct 25, 2023
690d55a
feat: localizable properties are embedded into the root entity using …
AxTrusov Nov 9, 2023
4bce31b
[AB#42059] channel localizations dropped (#195)
AxTrusov Nov 13, 2023
1f5aede
chore: post-rebase adjustments
AxTrusov Nov 13, 2023
eafff30
chore: increase catalog tests timeout
AxTrusov Nov 14, 2023
1a72ba1
chore: increase jest workers count
AxTrusov Nov 14, 2023
99f4dc9
chore: set jest workers to 5
AxTrusov Nov 14, 2023
cf893d9
chore: set jest workers to 3 and timeout to 120s
AxTrusov Nov 14, 2023
3725197
fix: add memory leak fix to root level jest config
AxTrusov Nov 15, 2023
492fd8a
feat: catalog service whitelists custom locale header (#206)
AxTrusov Nov 21, 2023
82e0c07
[AB#40605] Ingest of localizations is now supported (#211)
AxTrusov Dec 11, 2023
255f62e
[AB#42388] inactive field source values are now synced (#216)
AxTrusov Dec 18, 2023
b102912
chore: re-create localization migrations after rebase
AxTrusov Feb 7, 2024
fd1e40b
[AB#42975] logical replication approach dropped in favor of db trigge…
AxTrusov Mar 6, 2024
a391408
chore: feature-branch review adjustments (#254)
AxTrusov Mar 6, 2024
06103e2
chore: post-rebase catalog grants adjustments
AxTrusov Mar 11, 2024
385d5cc
chore: update mosaic packages
AxTrusov Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .adops/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ stages:
echo -e "\nPOSTGRESQL_HOST=$(DATABASE_HOST)" >> .env
echo "POSTGRESQL_ROOT=$(DATABASE_USERNAME)" >> .env
echo "POSTGRESQL_ROOT_PASSWORD=$(DATABASE_PASSWORD)" >> .env
displayName: Add fake values to .env to keep config loader happy
displayName:
Add fake values to .env to keep config loader happy

- script: cat .env
displayName: Show .env
Expand Down
66 changes: 17 additions & 49 deletions .vscode/mosaic-sql-migrations.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@
},
"Create Messaging Counter Table (Ax Define)": {
"prefix": "ax-create-messaging-counter-table",
"body": [
"SELECT ax_define.create_messaging_counter_table();"
],
"body": ["SELECT ax_define.create_messaging_counter_table();"],
"description": [
"Creates a table that will count how often a message was already processed via Mosaic-based messaging e.g. multiple retries due to server crashes."
],
Expand Down Expand Up @@ -439,9 +437,7 @@
},
"Pgmemento Delete Old Logs (Ax Define)": {
"prefix": "ax-pgmemento-delete-old-logs",
"body": [
"SELECT ax_define.pgmemento_delete_old_logs(${age:'30 days'})"
],
"body": ["SELECT ax_define.pgmemento_delete_old_logs(${age:'30 days'})"],
"description": [
"Deletes all audit logs (for all registered tables) older than specified age.\n",
"Returns number of table events deleted.\n",
Expand Down Expand Up @@ -471,9 +467,7 @@
},
"Validate Identifier Length (Ax Utils)": {
"prefix": "ax-validate-identifier-length",
"body": [
"PERFORM ax_utils.validate_identifier_length('${1:identifier}');"
],
"body": ["PERFORM ax_utils.validate_identifier_length('${1:identifier}');"],
"description": [
"Raises an exception if the provided identifer exceeds the PostgreSQL max length (63 bytes).",
"This can be useful to prevent name truncation, identifier collisions and silently dropped constraints.",
Expand Down Expand Up @@ -683,39 +677,31 @@
},
"Validation Not Empty (Ax Utils)": {
"prefix": "ax-validation-not-empty",
"body": [
"ax_utils.validation_not_empty(${1:column_or_variable})"
],
"body": ["ax_utils.validation_not_empty(${1:column_or_variable})"],
"description": [
"Returns true if the value is not null, not an empty string, and not a whitespace string. Returns false otherwise."
],
"scope": "sql"
},
"Validation Is Trimmed (Ax Utils)": {
"prefix": "ax-validation-is-trimmed",
"body": [
"ax_utils.validation_is_trimmed(${1:column_or_variable})"
],
"body": ["ax_utils.validation_is_trimmed(${1:column_or_variable})"],
"description": [
"Returns false if the value starts or ends with a whitespace character. Returns true otherwise."
],
"scope": "sql"
},
"Validation Is Base64 (Ax Utils)": {
"prefix": "ax-validation-is-base64",
"body": [
"ax_utils.validation_is_base64(${1:column_or_variable})"
],
"body": ["ax_utils.validation_is_base64(${1:column_or_variable})"],
"description": [
"Returns true if the value is a base64 encoded string. Returns false otherwise."
],
"scope": "sql"
},
"Validation Is Identifier Key (Ax Utils)": {
"prefix": "ax-validation-is-identifier-key",
"body": [
"ax_utils.validation_is_identifier_key(${1:column_or_variable})"
],
"body": ["ax_utils.validation_is_identifier_key(${1:column_or_variable})"],
"description": [
"Returns true if the value only contains letters, numbers, underscores, and dashes.",
"Returns false otherwise."
Expand All @@ -724,19 +710,15 @@
},
"Validation Is Url (Ax Utils)": {
"prefix": "ax-validation-is-url",
"body": [
"ax_utils.validation_is_url(${1:column_or_variable})"
],
"body": ["ax_utils.validation_is_url(${1:column_or_variable})"],
"description": [
"Returns true if the value is a valid URL. Returns false otherwise, including in cases when value is an empty string."
],
"scope": "sql"
},
"Validation Is Optional Url (Ax Utils)": {
"prefix": "ax-validation-is-optional-url",
"body": [
"ax_utils.validation_is_optional_url(${1:column_or_variable})"
],
"body": ["ax_utils.validation_is_optional_url(${1:column_or_variable})"],
"description": [
"Returns true if the value is a valid URL or an empty string. Returns false otherwise."
],
Expand All @@ -754,19 +736,15 @@
},
"Validation Not Empty Array (Ax Utils)": {
"prefix": "ax-validation-not-empty-array",
"body": [
"ax_utils.validation_not_empty_array(${1:column_or_variable})"
],
"body": ["ax_utils.validation_not_empty_array(${1:column_or_variable})"],
"description": [
"Returns false if the value is an empty array or an array containing empty elements. Returns true otherwise."
],
"scope": "sql"
},
"Validation Valid Url Array (Ax Utils)": {
"prefix": "ax-validation-valid-url-array",
"body": [
"ax_utils.validation_valid_url_array(${1:column_or_variable})"
],
"body": ["ax_utils.validation_valid_url_array(${1:column_or_variable})"],
"description": [
"Returns false if at least one element of an array is not a valid URL or an empty string. Returns true otherwise."
],
Expand Down Expand Up @@ -798,9 +776,7 @@
},
"User Has Tag (Ax Utils)": {
"prefix": "ax-user-has-tag",
"body": [
"SELECT ax_utils.user_has_tag(${1:'tag1,tag2'});"
],
"body": ["SELECT ax_utils.user_has_tag(${1:'tag1,tag2'});"],
"description": [
"Checks if a user has one of the specified tags.\n",
"Returns true if the user has at least one of the tags from provided comma-separated string. Returns false otherwise."
Expand All @@ -822,9 +798,7 @@
},
"Current Tenant Id (Ax Utils)": {
"prefix": "ax-current-tenant-id",
"body": [
"SELECT ax_utils.current_tenant_id();"
],
"body": ["SELECT ax_utils.current_tenant_id();"],
"description": [
"Gets the tenant ID from the context of the current user.",
"This is needed for multitenancy systems."
Expand All @@ -833,9 +807,7 @@
},
"Current Environment Id (Ax Utils)": {
"prefix": "ax-current-environment-id",
"body": [
"SELECT ax_utils.current_environment_id();"
],
"body": ["SELECT ax_utils.current_environment_id();"],
"description": [
"Gets the environment ID from the context of the current user.",
"This is needed for multitenancy systems."
Expand All @@ -844,9 +816,7 @@
},
"Current User Id (Ax Utils)": {
"prefix": "ax-current-user-id",
"body": [
"SELECT ax_utils.current_user_id();"
],
"body": ["SELECT ax_utils.current_user_id();"],
"description": [
"Gets the User ID from the context of the current user.",
"This is needed when end-user RLS is needed."
Expand Down Expand Up @@ -1060,9 +1030,7 @@
"Drop Table (Ax Custom)": {
"scope": "sql",
"prefix": "ax-drop-table",
"body": [
"DROP TABLE IF EXISTS ${8:app_public}.${1:table_name} CASCADE;"
],
"body": ["DROP TABLE IF EXISTS ${8:app_public}.${1:table_name} CASCADE;"],
"description": "Drops a table."
},
"Add Enum and Column (Ax Custom)": {
Expand Down Expand Up @@ -1108,4 +1076,4 @@
"This snippet has a simplified migration sample that might require adjustments."
]
}
}
}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"fairplay",
"geolocation",
"Inflector",
"localizable",
"loglevel",
"pilet",
"pilets",
Expand All @@ -31,6 +32,7 @@
"RABBITMQ",
"SMIL",
"SPEKE",
"TEXTBOX",
"unassignment",
"uncommit",
"unpublish",
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ Note that the following pre-requisites are assumed:
- i.e.
`yarn util:load-vars mosaic hosting service deploy -i media-service -t 20230927.1 -p media-workflows@1.0.1 -m media-service-manifest-20230927 -n media-service-deployment-20230927.1`
- Ensure you provide a unique value for the `<deployment-name>`
7. (Optional) In case Localizations are enabled - `media-service` service
account shall be adjusted to include the `INGESTS_EDIT` permission for
the`media-service` itself in the Admin Portal.

#### Deploy Catalog Service

Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { JestConfigWithTsJest } from 'ts-jest';

const jestConfig: JestConfigWithTsJest = {
preset: 'ts-jest',
testTimeout: 60000,
modulePathIgnorePatterns: ['./dist/'],
setupFilesAfterEnv: ['jest-expect-message', 'jest-extended/all'],
projects: [
Expand All @@ -18,6 +17,7 @@ const jestConfig: JestConfigWithTsJest = {
'!**/dist/**',
'!**/vendor/**',
],
workerIdleMemoryLimit: '1GB',
};

export default jestConfig;
4 changes: 2 additions & 2 deletions libs/media-messages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"build:compile": "tsc"
},
"devDependencies": {
"@axinom/mosaic-cli": "0.30.0-rc.0",
"@axinom/mosaic-message-bus-abstractions": "0.11.0-rc.0",
"@axinom/mosaic-cli": "0.31.0-rc.0",
"@axinom/mosaic-message-bus-abstractions": "0.12.0-rc.0",
"@types/glob": "^7.2.0",
"concurrently": "^5.3.0",
"rimraf": "^3.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
"content_id": {
"$ref": "./common.json#/definitions/collection_id"
},
"title": {
"description": "Title of the collection.",
"$ref": "../common.json#/definitions/non_empty_string"
},
"synopsis": {
"description": "Short description.",
"type": "string"
},
"description": {
"description": "Longer description.",
"type": "string"
},
"tags": {
"$ref": "./common.json#/definitions/tags"
},
Expand Down Expand Up @@ -60,8 +48,41 @@
"required": ["order_no", "relation_type"],
"additionalProperties": false
}
},
"localizations": {
"description": "Localizations for every defined locale.",
"type": "array",
"additionalItems": false,
"items": {
"type": "object",
"additionalProperties": false,
"title": "collection_localization",
"required": ["is_default_locale", "language_tag", "title"],
"properties": {
"is_default_locale": {
"type": "boolean",
"description": "Boolean flag to indicate if locale is default or not."
},
"language_tag": {
"type": "string",
"description": "The locale for which the values are localized."
},
"title": {
"type": "string",
"description": "The localized title of this collection."
},
"description": {
"type": ["string", "null"],
"description": "The localized description of this collection."
},
"synopsis": {
"type": ["string", "null"],
"description": "The localized synopsis of this collection."
}
}
}
}
},
"required": ["content_id", "title", "related_items"],
"required": ["content_id", "related_items", "localizations"],
"additionalProperties": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,10 @@
"type": "integer",
"minimum": 1
},
"title": {
"description": "Title of the episode.",
"$ref": "../common.json#/definitions/non_empty_string"
},
"original_title": {
"description": "Original title of the episode.",
"type": "string"
},
"synopsis": {
"description": "Short description of the main plot elements.",
"$ref": "../common.json#/definitions/non_empty_string"
},
"description": {
"description": "Extended synopsis.",
"type": "string"
},
"studio": {
"description": "Name of the producing studio.",
"type": "string"
Expand Down Expand Up @@ -69,16 +57,49 @@
},
"videos": {
"$ref": "./common.json#/definitions/videos"
},
"localizations": {
"description": "Localizations for every defined locale.",
"type": "array",
"additionalItems": false,
"items": {
"type": "object",
"additionalProperties": false,
"title": "episode_localization",
"required": ["is_default_locale", "language_tag", "title"],
"properties": {
"is_default_locale": {
"type": "boolean",
"description": "Boolean flag to indicate if locale is default or not."
},
"language_tag": {
"type": "string",
"description": "The locale for which the values are localized."
},
"title": {
"type": "string",
"description": "The localized title of this episode."
},
"description": {
"type": ["string", "null"],
"description": "The localized description of this episode."
},
"synopsis": {
"type": ["string", "null"],
"description": "The localized synopsis of this episode."
}
}
}
}
},
"required": [
"content_id",
"index",
"title",
"licenses",
"genre_ids",
"images",
"videos"
"videos",
"localizations"
],
"additionalProperties": false
}
Loading
Loading