compat(preboarded): stop mapping the column phase2 renames to SOURCE_METADATA - #1683
Open
ppavlidis wants to merge 1 commit into
Open
compat(preboarded): stop mapping the column phase2 renames to SOURCE_METADATA#1683ppavlidis wants to merge 1 commit into
ppavlidis wants to merge 1 commit into
Conversation
phase2 renames INVESTIGATION.PREBOARDED_IDENTIFYING_METADATA to SOURCE_METADATA, generalizing the payload so it can carry upstream metadata for imported experiments and not only preboarded ones. INVESTIGATION is single-table inheritance, so the subclass property here puts the old column name into the SQL generated for any polymorphic Investigation query: once that migration runs against the database both versions share, this build fails on an unknown column. The failure is at mapping resolution rather than row read, so the table being empty does not save us. Unmap identifyingMetadata rather than repointing it at the new name. Repointing would couple the two: this build would be broken until the migration ran, and the currently deployed one broken the moment it did. Unmapped, 1.32.x is indifferent to what the column is called and the migration and any redeploy can happen in either order. Nothing in 1.32.x reads the value — it is a JSON payload only phase2 consumes — so mapping it was always beyond the 'minimum metadata to avoid the explosion' this compat port exists to provide. The subclass declaration, accession and source all stay, so the WrongClassException protection is unaffected. The accessors are kept so existing call sites compile. The round-trip assertion in PreboardedExperimentMappingTest becomes an assertion that the value does NOT survive persistence, so re-adding the mapping fails the test and points at the explanation.
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.
phase2 renames
INVESTIGATION.PREBOARDED_IDENTIFYING_METADATAtoSOURCE_METADATA(mysqlV24/ h2V25, onphase2-acl-migrate), generalizing the payload so it can carry upstream metadata for imported experiments and not only preboarded ones.INVESTIGATIONis single-table inheritance, so theidentifyingMetadataproperty inInvestigation.hbm.xmlputs the old column name into the SQL generated for any polymorphicInvestigationquery. Once that migration runs against the database both versions share, this build fails with an unknown-columnSQLGrammarException. The failure is at mapping resolution, not row read, so the table currently holding zero preboarded rows does not save us.Why unmap rather than repoint
Repointing the mapping at
SOURCE_METADATAwould couple the two changes: this build would be broken until the migration ran, and the currently deployed build broken the moment it did. There is no ordering that avoids a window.Unmapped, 1.32.x is indifferent to what the column is called, and the migration and any redeploy can happen in either order.
Nothing in 1.32.x reads the value — it is a JSON payload only phase2 consumes; the only reference was the round-trip assertion in the compat test. Mapping it was always beyond the "minimum metadata to avoid the explosion" that #1659 set out to provide.
What is unchanged
The
<subclass>declaration,accessionandsourceall stay, so theWrongClassExceptionprotection #1659 added still works — a phase2-written preboarded row still materializes correctly under a polymorphic load. The Java accessors are kept so existing call sites compile; they now always readnullon a reloaded instance, which is documented on the field.Test
PreboardedExperimentMappingTest.preboardedRoundTripsThroughHibernatestill asserts the polymorphic load and theaccession/sourceround trip. ItsidentifyingMetadataassertion is inverted: it now asserts the value does not survive persistence, so re-adding the mapping fails the test and the message points at the explanation inInvestigation.hbm.xmlrather than inviting someone to "fix" it.Verified green against gemdtest. The other failures in a full run on that branch are the pre-existing environmental set on this machine (POSIX file locks, missing
cellrangerbinary, h5ad transform) and are unrelated.Note on sequencing
This does not need to land before the migration, which is the point of it. But it should land before anyone runs
V24against a sharedgemd, since that is the moment an unpatched 1.32.x starts throwing.