Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor and document formatters #4014

Merged
merged 11 commits into from
Dec 11, 2024

Conversation

ChrOertlin
Copy link
Contributor

@ChrOertlin ChrOertlin commented Dec 10, 2024

Description

Refactors the formatter logic of the delivery services.
Adds Documentation to the formatter logic

The formatting logic was a bit unstructured and difficult to deal with. I tried to add some more logic to it by introducing same name space boundaries, reducing the amount of logic and hopefully a clearer build structure.

The formatting happens on three levels.
individual path names
path names bundled for certain components (case, sample, mutant)
destination (where files should be delivered to, i.e. a generic base path or a customer inbox)

A siimilar logic was applied to the Filemover service, i.e. CustomerInboxFileMover and BaseFileMover inherit from DestinationFileMover

Added

Changed

  • Removed SampleFileNameFormatters - these are now generic PathNameFormatters for either a nested or flat structure to inform on what is being formatted
  • Moved Case, Sample and Mutant file formatters under an abstract class ComponentFormatters
  • Renamed DeliveryFileFormatter and UploadFileFormatter to CustomerInboxDeliveryFormatter and BaseDeliveryFormatter to inform on their destination

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

@ChrOertlin ChrOertlin requested a review from a team as a code owner December 10, 2024 10:37
@ChrOertlin ChrOertlin marked this pull request as draft December 10, 2024 11:46
@ChrOertlin ChrOertlin marked this pull request as ready for review December 10, 2024 12:40
@diitaz93 diitaz93 self-requested a review December 10, 2024 12:43
@@ -2,15 +2,15 @@
from pathlib import Path
Copy link
Contributor

Choose a reason for hiding this comment

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

unused import

delivery_path: The path to deliver the files to
"""
LOG.debug("[FORMAT SERVICE] Formatting case files")
"""Format the case files to deliver and return the formatted files."""
Copy link
Contributor

Choose a reason for hiding this comment

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

repeated line

Copy link
Contributor

@diitaz93 diitaz93 left a comment

Choose a reason for hiding this comment

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

👍

@ChrOertlin ChrOertlin merged commit bb2f560 into mutant-file-formatter Dec 11, 2024
8 checks passed
@ChrOertlin ChrOertlin deleted the streamline-file-name-formatters branch December 11, 2024 10:16
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.

2 participants