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(robot-server): Add a comment to note a mistaken type in migration #12126

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

SyntaxColoring
Copy link
Contributor

Overview

This PR adds a comment to call out some tech debt in our migration code.

(This comment was originally part of #11561. I'm pulling it out here because we won't have a chance to merge that PR for a bit.)

Test Plan

None needed.

Review requests

Does this make sense to you?

Risk assessment

No risk. Comment only.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner February 9, 2023 22:52
@SyntaxColoring SyntaxColoring changed the title refactor(robot-server): Note mistaken type in migration refactor(robot-server): Add a comment to note a mistaken type in migration Feb 9, 2023
@SyntaxColoring SyntaxColoring requested review from shlokamin and a team February 9, 2023 22:52
Comment on lines +126 to +130
# NOTE: The column type of `STRING` here is mistaken. SQLite won't recognize it,
# so this column's type affinity will mistakenly default to `NUMERIC`.
# It should be `VARCHAR`, to match what SQLAlchemy uses when creating a new
# database from scratch. Fortunately, for this particular column, this inconsistency
# is harmless in practice because of SQLite's weak typing.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a signal that we need to either:

  • Test that the "migrate from older database" path creates the exact same schema as the "create database from scratch" path.
  • Completely remove the "create database from scratch path" in favor of a chain of migrations, so a mismatch is structurally impossible. Maybe Alembic can help with this.

Alembic would have helped with other things here, too. For example, it would have been proper to change the migrated columns' types from BLOB to VARCHAR, but I couldn't because the column type because SQLite makes that ridiculously difficult to do manually. Alembic, meanwhile, has specific support for this.

Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

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

Thanks

@SyntaxColoring SyntaxColoring merged commit 2242c48 into edge Feb 10, 2023
@SyntaxColoring SyntaxColoring deleted the note_engine_status_sql_type branch February 10, 2023 19:54
y3rsh added a commit that referenced this pull request Feb 13, 2023
* origin/edge: (31 commits)
  refactor(hardware): Update appropriate revision (#12130)
  fix(api): Fix accidental error on any PAPIv2.14 protocol (#12141)
  refactor(api): Allow homing after drop tip in engine core (#12124)
  fix(shared-data): remove newLocation and strategy from schemav6 (#12133)
  refactor(api): load pipette with useVirtualPipettes config option (#12117)
  chore(api): further speed up ot3controller tests and add profiling (#12132)
  docs(api): Settle in to leave Labware.default_magdeck_engage_height alone, for now (#12122)
  refactor(api): Improve error messages for JSONv6 and PAPIv2.14 protocols (#12131)
  refactor(robot-server): Note mistaken type in migration (#12126)
  chore(hardware): Remove docstring content checks (#12128)
  feat(hardware_control): Added firmware update mechanism for submodules (#12076)
  feat(app): remove feature flag for calibration dashboard and wizard updates (#12125)
  feat(app):  Calibration dashboard wizard data invalidation (#12097)
  feat(hardware): support new revision values (#12111)
  feat(app): add Chip component (#12090)
  docs(api): Officially remove the `height` parameter of `MagneticModuleContext.engage()` (#12114)
  feat(system-server): add persistent UUID generation (#12123)
  feat(odd): add manual connection for a hidden network (#12033)
  feat(hardware): add progress output to subsystem firmware update process (#12059)
  refactor(api): Improve OT3 instrument calibration process (#11807)
  ...
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.

None yet

2 participants