Skip to content

Commit

Permalink
Notification for file upload completion (GSI-682) (#2)
Browse files Browse the repository at this point in the history
* Remove local definition of AccessRequestDetails

* Get new version of ghga-event-schemas

* Add file_registered notification

* Use datetime string in test

* Fix docstrings

* Upgrade to uv

---------

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>
  • Loading branch information
TheByronHimes and TheByronHimes authored Mar 18, 2024
1 parent 65bb393 commit 9e24b23
Show file tree
Hide file tree
Showing 17 changed files with 403 additions and 406 deletions.
14 changes: 8 additions & 6 deletions .devcontainer/.dev_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ central_data_stewardship_email: "test@test.abc"
db_connection_str: mongodb://localhost:27017
db_name: users
kafka_servers: ["kafka:9092"]
access_request_events_topic: "access_request_events"
access_request_created_type: "access_request_created"
access_request_allowed_type: "access_request_allowed"
access_request_denied_type: "access_request_denied"
notification_event_type: "notification"
notification_event_topic: "notification_events"
access_request_events_topic: access_request_events
access_request_created_type: access_request_created
access_request_allowed_type: access_request_allowed
access_request_denied_type: access_request_denied
notification_event_type: notification
notification_event_topic: notification_events
file_registered_event_topic: internal_file_registry
file_registered_event_type: file_registered
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ repos:
- id: no-commit-to-branch
args: [--branch, dev, --branch, int, --branch, main]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.1
rev: v0.3.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
args: [--no-warn-unused-ignores]
3 changes: 1 addition & 2 deletions .pyproject_generation/pyproject_custom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ description = "The Notification Orchestration Service controls the creation of n
dependencies = [
"typer >= 0.9.0",
"ghga-service-commons[api] >= 3.0.0",
"ghga-event-schemas >= 3.0.0",
"ghga-event-schemas >= 3.1.0",
"hexkit[akafka,s3,mongodb] >= 2.1.0"
]

[project.urls]
Repository = "https://github.com/ghga-de/notification-orchestration-service"

[project.scripts]
# please adapt to package name
nos = "nos.__main__:run"
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,26 @@ The service requires the following configuration parameters:
```


- **`file_registered_event_topic`** *(string)*: The name of the topic containing internal file registration events.


Examples:

```json
"internal_file_registry"
```


- **`file_registered_event_type`** *(string)*: The type used for events detailing internally file registrations.


Examples:

```json
"file_registered"
```


- **`service_name`** *(string)*: The Notification Orchestration Service controls the creation of notification events. Default: `"nos"`.

- **`service_instance_id`** *(string)*: A string that uniquely identifies this instance across all instances of this service. This is included in log messages.
Expand Down
18 changes: 18 additions & 0 deletions config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@
"title": "Access Request Denied Type",
"type": "string"
},
"file_registered_event_topic": {
"description": "The name of the topic containing internal file registration events.",
"examples": [
"internal_file_registry"
],
"title": "File Registered Event Topic",
"type": "string"
},
"file_registered_event_type": {
"description": "The type used for events detailing internally file registrations.",
"examples": [
"file_registered"
],
"title": "File Registered Event Type",
"type": "string"
},
"service_name": {
"default": "nos",
"description": "The Notification Orchestration Service controls the creation of notification events.",
Expand Down Expand Up @@ -185,6 +201,8 @@
"access_request_created_type",
"access_request_allowed_type",
"access_request_denied_type",
"file_registered_event_topic",
"file_registered_event_type",
"service_instance_id",
"kafka_servers",
"central_data_stewardship_email"
Expand Down
2 changes: 2 additions & 0 deletions example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ access_request_events_topic: access_request_events
central_data_stewardship_email: test@test.abc
db_connection_str: '**********'
db_name: users
file_registered_event_topic: internal_file_registry
file_registered_event_type: file_registered
generate_correlation_id: true
kafka_security_protocol: PLAINTEXT
kafka_servers:
Expand Down
3 changes: 2 additions & 1 deletion lock/requirements-dev-template.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jsonschema2md>=1.0.0
setuptools>=69.1.0

# required since switch to pyproject.toml and pip-tools
pip-tools>=7.4.0
tomli>=2.0.1
tomli_w>=1.0.0

uv>=0.1.21
372 changes: 161 additions & 211 deletions lock/requirements-dev.txt

Large diffs are not rendered by default.

Loading

0 comments on commit 9e24b23

Please sign in to comment.