Skip to content

Map Gemma 2.0 audit event types for shared-trail read compatibility#1667

Open
ppavlidis wants to merge 1 commit into
hotfix-1.32.8from
port-audit-event-types
Open

Map Gemma 2.0 audit event types for shared-trail read compatibility#1667
ppavlidis wants to merge 1 commit into
hotfix-1.32.8from
port-audit-event-types

Conversation

@ppavlidis

@ppavlidis ppavlidis commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

Gemma 2.0 (frink) and the 1.x line share one audit trail in the production database. 2.0 emits 21 AuditEventType subclasses whose discriminators the 1.x Hibernate mapping doesn't know, so 1.x throws org.hibernate.WrongClassException when it loads a dataset whose trail contains one.

Live example: DesignChangeEvent (from the composite curation commit) broke the experiment page for GSE16035 (id 25717):

org.hibernate.WrongClassException: Object with id: 1048541 was not of the specified subclass:
ubic.gemma.model.common.auditAndSecurity.eventType.AuditEventType (Discriminator: DesignChangeEvent)

Fix

Add read-compatibility marker classes plus AuditEventType.hbm.xml <subclass> entries for the 21 discriminators, so the 1.x line resolves them on read.

  • 1.x never writes these; they carry no data — they exist only so the read succeeds.
  • Each is flattened onto an existing mapped parent (2.0's real hierarchy has extra abstract intermediates that aren't needed just to read a row).
  • AggregatedSingleDataAddedEvent already existed unmapped — it only needed the hbm entry (the class file is untouched).

Scope is exactly {discriminator values 2.0 writes} − {values the 1.x hbm already maps} (the Preferred*Changed types were already covered because 1.x maps their older Change-spelled discriminator values).

Discriminators mapped (21)

DesignChangeEvent, TagAddedEvent, TagRemovedEvent, AnnotationSetEvent, AggregatedSingleDataAddedEvent, DatasetPublishedEvent, DatasetShortNameChangedEvent, PipelineRunEvent, FailedPipelineRunEvent, PipelineBatchCancelledEvent, PipelineBatchClosedEvent, PipelineBatchSubmittedEvent, PreboardedCreatedEvent, PreboardedPromotedEvent, TicketOpenedEvent, TicketAssignedEvent, TicketStateChangedEvent, TicketMetadataChangedEvent, TicketTargetStatusChangedEvent, VectorsReorderedEvent, WorkflowStateChangedEvent.

Validation

  • XML well-formed (xmllint); every new discriminator has a matching class file; all parents resolve.
  • Separately, orphaned AgentProposalEvent rows in prod (from the retired skeleton/agent branch — mapped by neither 1.x nor 2.0) were cleaned up directly; those are deliberately not ported.

Base branch

Targets hotfix-1.32.8 (unreleased next patch), not the released hotfix-1.32.7.

…patibility

Gemma 2.0 (frink) and the 1.x line share one audit trail in the production database.
2.0 emits 21 AuditEventType subclasses whose discriminators the 1.x Hibernate mapping
doesn't know, so 1.x throws org.hibernate.WrongClassException when it loads a dataset
whose trail contains one — e.g. DesignChangeEvent from the composite curation commit
broke the experiment page for GSE16035 (id 25717).

Add read-compatibility marker classes + AuditEventType.hbm.xml <subclass> entries for
those 21 discriminators so the 1.x line resolves them on read. The 1.x code never writes
them and they carry no data; each is flattened onto an existing mapped parent (2.0's real
hierarchy has extra abstract intermediates that aren't needed just to read).
AggregatedSingleDataAddedEvent already existed unmapped — it only needed the hbm entry.

Discriminators: DesignChangeEvent, TagAddedEvent, TagRemovedEvent, AnnotationSetEvent,
AggregatedSingleDataAddedEvent, DatasetPublishedEvent, DatasetShortNameChangedEvent,
PipelineRunEvent, FailedPipelineRunEvent, PipelineBatchCancelledEvent,
PipelineBatchClosedEvent, PipelineBatchSubmittedEvent, PreboardedCreatedEvent,
PreboardedPromotedEvent, TicketOpenedEvent, TicketAssignedEvent, TicketStateChangedEvent,
TicketMetadataChangedEvent, TicketTargetStatusChangedEvent, VectorsReorderedEvent,
WorkflowStateChangedEvent.
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.

1 participant