Skip to content

Pool delivered at - #5222

Merged
islean merged 16 commits into
masterfrom
pool-delivered-at
Jul 30, 2026
Merged

Pool delivered at#5222
islean merged 16 commits into
masterfrom
pool-delivered-at

Conversation

@islean

@islean islean commented Jul 28, 2026

Copy link
Copy Markdown
Member

Description

Closes #5200.

Added

  • Column order_id on the Pool table with associated relationship to the Order table

Changed

  • Removed ticket column from the Pool table and exchanged it for a property using the now linked order table

Fixed

  • The delivered_at in the Pool table is now set when the associated order's samples all have a delivered_at
  • The Ordering service now populated the order_id column instead of the ticket column on the Pool table
  • The Admin view displays the ticket as a link to the order table.

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 pool-delivered-at -a

How to test

  • Submit an RML order and make sure it gets persisted correctly.
  • Submit a Fluffy order and make sure it gets persisted correctly.
  • Make sure the formatting of the Pool table in the admin view is correct (ticket should link to Freshdesk?)
  • Make sure that delivering an order delivers the pools.

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 ...

Comment thread alembic/versions/2026_07_28_eb2e90a251c5_add_order_fk_to_pool.py
Comment thread alembic/versions/2026_07_28_eb2e90a251c5_add_order_fk_to_pool.py
Comment thread cg/services/mark_as_delivered_service.py
Comment thread cg/store/models.py Outdated
@clingen-sthlm
clingen-sthlm temporarily deployed to stage July 29, 2026 12:15 Inactive
@islean

islean commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Test submitting a Fluffy order with two pools in:

image

Test submitting an RML order with one pool:

image

@islean

islean commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Test delivering an order delivers the pool:

[isak.ohlsson@hasta:~] [S_base] $ cg deliver order -t **** -s IO
Running CG deliver
Delivering 1 analyses of ticket ****.
Marking samples as delivered for case ****
Setting analyses [****] as delivered in Trailblazer
Order **** is now closed.
Setting pool **** as delivered.
[isak.ohlsson@hasta:~] [S_base] $ 

And the change is persisted:

image

@islean

islean commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

Upgrade and downgrade successful ✅

@islean
islean marked this pull request as ready for review July 29, 2026 12:46
@islean
islean requested a review from a team as a code owner July 29, 2026 12:46
Comment thread cg/server/admin.py
Comment thread alembic/versions/2026_07_28_eb2e90a251c5_add_order_fk_to_pool.py Outdated
Comment thread cg/services/orders/storing/implementations/pool_order_service.py
Comment thread cg/services/mark_as_delivered_service.py
Comment thread cg/server/admin.py Outdated
Comment thread cg/store/crud/create.py

@diitaz93 diitaz93 left a comment

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.

We can discuss in detail the coments tomorrow if you want

@islean

islean commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

New column is not nullable:

image

@sonarqubecloud

Copy link
Copy Markdown

Comment thread alembic/versions/2026_07_28_eb2e90a251c5_add_order_fk_to_pool.py

@diitaz93 diitaz93 left a comment

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.

Looks great 💯

@islean
islean merged commit 9460352 into master Jul 30, 2026
8 checks passed
@islean
islean deleted the pool-delivered-at branch July 30, 2026 13:23
@islean

islean commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Deployed to Hasta:

INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade 7e84083f6cb0 -> eb2e90a251c5, Add order fk to pool
repository is clean
Logging deploy ...
Getting deployer... done.
Getting last commit message and SHA... done.
Getting version of deploy scripts... done.
Log deploy... done.
cg, version 87.10.2
[isak.ohlsson@hasta:~] [P_base] $ 

And to the VMs

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.

Automatic deliveries are not working for pools

3 participants