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

Add internal_id column to RunDevice model #3221

Merged
merged 5 commits into from
May 15, 2024
Merged

Conversation

diitaz93
Copy link
Contributor

@diitaz93 diitaz93 commented May 13, 2024

Description

Closes https://github.com/Clinical-Genomics/add-new-tech/issues/19

Added

  • intenal_id column to RunDevice model
  • New alembic migration with the changes

How to prepare for test

  • Stablish an SSH connection to cg stage

How to test

  • Verify that the current alembic version is e5c6bf847e25
  • Do alembic -c $ALEMBIC_CG_STAGE upgrade fa7a3d066872 and verify that the tables are changed
  • Do alembic -c $ALEMBIC_CG_STAGE downgrade e5c6bf847e25 and verify that the tables return to their original state.

Expected test outcome

  • Check that after the upgrade the run_device table has a column named internal_id
  • Check that after the downgrade that the changes are reverted

Review

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

This version is a

  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Deployed to stage:
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade e5c6bf847e25 -> fa7a3d066872, add_device_internal_id
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
repository is clean
Logging deploy ...
Getting deployer... done.
Getting last commit message and SHA... done.
Getting version of deploy scripts... /home/js.diazboada
done.
Log deploy... done.
cg, version 60.7.14
[js.diazboada@hasta:~] [S_base] $ up
  • Deployed to production:
Fast-forward
 .bumpversion.cfg                                                   |  2 +-
 alembic/versions/2024-05-14_fa7a3d066872_add_device_internal_id.py | 32 ++++++++++++++++++++++++++++++++
 cg/__init__.py                                                     |  2 +-
 cg/store/models.py                                                 |  2 ++
 pyproject.toml                                                     |  2 +-
 5 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 alembic/versions/2024-05-14_fa7a3d066872_add_device_internal_id.py
/home/js.diazboada
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade e5c6bf847e25 -> fa7a3d066872, add_device_internal_id
[js.diazboada@hasta:~] [P_base] $ 

@diitaz93 diitaz93 self-assigned this May 14, 2024
@diitaz93 diitaz93 added the Project Task Part of a quarterly project label May 14, 2024
@diitaz93 diitaz93 added the alembic migration Perform a change in database label May 14, 2024
@diitaz93 diitaz93 marked this pull request as ready for review May 14, 2024 14:59
@diitaz93 diitaz93 requested a review from a team as a code owner May 14, 2024 14:59
Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@seallard seallard left a comment

Choose a reason for hiding this comment

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

Nice 👍 Maybe you want to consider other names? I feel like internal_id might be unnecessarily arcane and CG-like 😅

Copy link
Contributor

@Vince-janv Vince-janv left a comment

Choose a reason for hiding this comment

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

Looks great ⭐

cg/store/models.py Show resolved Hide resolved
@diitaz93 diitaz93 merged commit 3f2a686 into master May 15, 2024
9 checks passed
@diitaz93 diitaz93 deleted the add_internal_id_device branch May 15, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alembic migration Perform a change in database Project Task Part of a quarterly project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants