Skip to content

Standardise event and field names - #5303

Merged
diitaz93 merged 7 commits into
dev-external-natsfrom
fix-external-data-fields-naming
Sep 9, 2026
Merged

Standardise event and field names#5303
diitaz93 merged 7 commits into
dev-external-natsfrom
fix-external-data-fields-naming

Conversation

@islean

@islean islean commented Sep 8, 2026

Copy link
Copy Markdown
Member

Description

Added

Changed

Fixed

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b [THIS-BRANCH-NAME] -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@diitaz93
diitaz93 marked this pull request as ready for review September 9, 2026 13:04
@diitaz93
diitaz93 requested a review from a team as a code owner September 9, 2026 13:04
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

@diitaz93
diitaz93 merged commit d9a7e28 into dev-external-nats Sep 9, 2026
7 checks passed
@diitaz93
diitaz93 deleted the fix-external-data-fields-naming branch September 9, 2026 13:12
@@ -0,0 +1,11 @@
# Event names
EXTERNAL_SAMPLES_ORDERED_SUBJECT = "external.samples_ordered"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are sort of not calling this the subject anymore since they do not contain the stream name. But maybe it is too much of a hassle to call them event names here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we can change them to event names

mogmi added a commit that referenced this pull request Sep 10, 2026
…) (minor)

## Description
Provide support to message publishing using nats-py. Currently used in the new `external_sample_transferred_handler` and in the order storing service.

### Added

- New methods to the event publisher that establish a connection to the NATS server, publish a message and drain the connection asynchronously.
- `external_sample_transferred_handler` that adds the transferred files to HK and publishes an event using the new event_publisher method to start an analysis
- New HK API method that adds bundle and version to the DB transaction but does not commit.
- New HK method that hard-links files to the bundle dirs and commits

### Changed

- The OrderSubmitter now recieved a NatsConfig object and a store as parameters
- NATS env variables can now be parsed by the app_config obj
- 

### Fixed

- Unifies all event names and payload fields in constants in `cg/services/events/constants.py`
- rename directory `tests/services/orders/validation_service` to `tests/services/orders/validation`


---------

Co-authored-by: Rasmus Burge <80392398+RasmusBurge-CG@users.noreply.github.com>
Co-authored-by: Sebastian Diaz <juan.sebastian.diaz.boada@scilifelab.se>
Co-authored-by: Linnéa Löfdahl <linnea.lofdahl@scilifelab.se>
Co-authored-by: Moe Darrah <41540288+moedarrah@users.noreply.github.com>
Co-authored-by: kedhammar <alfred.kedhammar@scilifelab.se>
Co-authored-by: Alfred Kedhammar <89784800+kedhammar@users.noreply.github.com>

* Create event when order with external samples is submitted (#5292)

* WIP

* fix type hints

* Add TODOs

* WIP

* TODO

* add statusdb to order

* add passing function

* Work on submitter

* WIP

* implement tests for submit with new functionality

* WIP

* add tests

* Fix typehint for Order external_samples (#5296)

* wip red

* add app_config settings for NATS

* Work on adding NatsConfig in the app_config

* wip red

* rename nats env variables

* update renaming

* Change order of publishing of events

* red wip

* Fix failing tests

* Change logging

---------

Co-authored-by: Moe Darrah <41540288+moedarrah@users.noreply.github.com>
Co-authored-by: kedhammar <alfred.kedhammar@scilifelab.se>
Co-authored-by: islean <isak.ohlsson.angnell@gmail.com>
Co-authored-by: Linnéa Löfdahl <linnea.lofdahl@scilifelab.se>
Co-authored-by: Isak Ohlsson Ångnell <40887124+islean@users.noreply.github.com>

* Standardise event and field names (#5303)

* Start standardising names

* Rework the field names

* Start on event names

* WIP

* Green tests

* return hint

---------

Co-authored-by: Linnéa Löfdahl <linnea.lofdahl@scilifelab.se>
Co-authored-by: Moe Darrah <41540288+moedarrah@users.noreply.github.com>
Co-authored-by: Sebastian Diaz <juan.sebastian.diaz.boada@scilifelab.se>

* rename constants from subject to events

* rename constants from subject to events

* Clarify event publisher function names (#5306)

* Rename publish_command to get_publish_command

* Rename publish to publish_event

* Address comments

* Send in event_name to publish_command

---------

Co-authored-by: Isak Ohlsson Ångnell <40887124+islean@users.noreply.github.com>
Co-authored-by: Rasmus Burge <80392398+RasmusBurge-CG@users.noreply.github.com>
Co-authored-by: Linnéa Löfdahl <linnea.lofdahl@scilifelab.se>
Co-authored-by: Moe Darrah <41540288+moedarrah@users.noreply.github.com>
Co-authored-by: kedhammar <alfred.kedhammar@scilifelab.se>
Co-authored-by: Alfred Kedhammar <89784800+kedhammar@users.noreply.github.com>
Co-authored-by: islean <isak.ohlsson.angnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants