Create event when order with external samples is submitted - #5292
Merged
Conversation
Member
|
Double check that the auth info for NATS is gathered from the environment rather than cg.yaml since the ordering service is running on the VM |
islean
marked this pull request as ready for review
September 9, 2026 12:29
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Added
Changed
Fixed
How to prepare for test
uspaxaHow to test
Expected test outcome
Review
Thanks for filling in who performed the code review and the test!
This version is a
Implementation Plan