Skip to content

Commit

Permalink
Use standardized event config
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Feb 28, 2025
1 parent 6ac988e commit 94408a4
Show file tree
Hide file tree
Showing 13 changed files with 657 additions and 649 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/.dev_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ searchable_classes:
- key: title
name: Title

resource_change_event_topic: searchable_resources
resource_deletion_event_type: searchable_resource_deleted
resource_upsertion_event_type: searchable_resource_upserted
resource_change_topic: searchable_resources
resource_deletion_type: searchable_resource_deleted
resource_upsertion_type: searchable_resource_upserted
service_instance_id: "001"
kafka_servers: ["kafka:9092"]
kafka_enable_dlq: True
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
args: [--check]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -48,7 +48,7 @@ repos:
- id: no-commit-to-branch
args: [--branch, dev, --branch, int, --branch, main]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.9.8
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Metadata Artifact Search Service - A service for searching metada
dependencies = [
"typer>=0.12",
"ghga-service-commons[api]>=3.3.0",
"ghga-event-schemas>=3.1.1",
"ghga-event-schemas>=4.1",
"hexkit[mongodb,akafka]>=4.0.0",
]

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ The service requires the following configuration parameters:

- **Additional properties**: Refer to *[#/$defs/SearchableClass](#%24defs/SearchableClass)*.

- **`resource_change_event_topic`** *(string, required)*: Name of the event topic used to track resource deletion and upsertion events.
- **`resource_change_topic`** *(string, required)*: Name of the topic used for events informing other services about resource changes, i.e. deletion or insertion.


Examples:

```json
"searchable_resource"
"searchable_resources"
```


- **`resource_deletion_event_type`** *(string, required)*: The type to use for events with deletion instructions.
- **`resource_deletion_type`** *(string, required)*: Type used for events indicating the deletion of a previously existing resource.


Examples:
Expand All @@ -129,7 +129,7 @@ The service requires the following configuration parameters:
```


- **`resource_upsertion_event_type`** *(string, required)*: The type to use for events with upsert instructions.
- **`resource_upsertion_type`** *(string, required)*: Type used for events indicating the upsert of a resource.


Examples:
Expand Down
26 changes: 13 additions & 13 deletions config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,28 @@
"title": "Searchable Classes",
"type": "object"
},
"resource_change_event_topic": {
"description": "Name of the event topic used to track resource deletion and upsertion events",
"resource_change_topic": {
"description": "Name of the topic used for events informing other services about resource changes, i.e. deletion or insertion.",
"examples": [
"searchable_resource"
"searchable_resources"
],
"title": "Resource Change Event Topic",
"title": "Resource Change Topic",
"type": "string"
},
"resource_deletion_event_type": {
"description": "The type to use for events with deletion instructions",
"resource_deletion_type": {
"description": "Type used for events indicating the deletion of a previously existing resource.",
"examples": [
"searchable_resource_deleted"
],
"title": "Resource Deletion Event Type",
"title": "Resource Deletion Type",
"type": "string"
},
"resource_upsertion_event_type": {
"description": "The type to use for events with upsert instructions",
"resource_upsertion_type": {
"description": "Type used for events indicating the upsert of a resource.",
"examples": [
"searchable_resource_upserted"
],
"title": "Resource Upsertion Event Type",
"title": "Resource Upsertion Type",
"type": "string"
},
"kafka_servers": {
Expand Down Expand Up @@ -421,9 +421,9 @@
"required": [
"service_instance_id",
"searchable_classes",
"resource_change_event_topic",
"resource_deletion_event_type",
"resource_upsertion_event_type",
"resource_change_topic",
"resource_deletion_type",
"resource_upsertion_type",
"kafka_servers",
"mongo_dsn",
"db_name"
Expand Down
6 changes: 3 additions & 3 deletions example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ mongo_dsn: '**********'
mongo_timeout: null
openapi_url: /openapi.json
port: 8080
resource_change_event_topic: searchable_resources
resource_deletion_event_type: searchable_resource_deleted
resource_upsertion_event_type: searchable_resource_upserted
resource_change_topic: searchable_resources
resource_deletion_type: searchable_resource_deleted
resource_upsertion_type: searchable_resource_upserted
searchable_classes:
Dataset:
description: Dataset grouping files under controlled access.
Expand Down
Loading

0 comments on commit 94408a4

Please sign in to comment.