Skip to content

fix(aigen): align schema collation default and guard misconfigured boot#8

Merged
beyondwin merged 3 commits into
mainfrom
fix/aigen-collation-and-startup-guard
May 17, 2026
Merged

fix(aigen): align schema collation default and guard misconfigured boot#8
beyondwin merged 3 commits into
mainfrom
fix/aigen-collation-and-startup-guard

Conversation

@beyondwin
Copy link
Copy Markdown
Owner

Summary

Closes the loop on the v1.10.0/v1.10.1 incident chain with three changes:

  • V33 schema-default collation alignment — `ALTER DATABASE DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci`. Future FK columns that omit COLLATE inherit the right default. No rewrite of existing tables.
  • `AiGenerationConfigValidator` — `@PostConstruct` check that fails fast when AIGEN_ENABLED=true but no `AiGenerationJobQueue` bean is wired. Replaces the v1.10.1 opaque missing-bean boot crash with an actionable message. Checks bean existence (not flag) so `@MockitoBean` integration tests still pass.
  • FK-collation regression test — `MySqlFlywayMigrationTest` programmatically forces the schema-default vs `clubs.id` mismatch and proves only-explicit-COLLATE survives.

No functional changes. Tag v1.10.2 to deploy.

Test plan

  • `unitTest --tests 'com.readmates.aigen.config.AiGenerationConfigValidatorTest'` (3/3 pass)
  • `integrationTest --tests 'com.readmates.support.MySqlFlywayMigrationTest'` (7/7 pass)
  • `integrationTest --tests RedisAiGenerationJobStoreTest, RedisGenerationCostCountersTest` (17/17 pass — validator coexists with `@MockitoBean AiGenerationJobQueue`)
  • `ktlintMainSourceSetCheck` + `ktlintTestSourceSetCheck` pass

🤖 Generated with Claude Code

beyondwin and others added 3 commits May 17, 2026 20:22
Source audit revealed that the route initialized selectedClubId from
clubs.items[0], silently violating the spec's "first queue item" rule;
the `none` SelectedClubAction variant was dead code; filter chips were
in the spec but unwired in the plan; AccessDeniedException handling was
already in place via SharedApplicationErrorHandler; and Task 3 broke the
TypeScript build until Task 4 landed. Fix the docs so each issue is
addressed at the level (spec or plan) where it belongs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Capture the source-verified notification source-of-truth analysis,
the FeedbackDocumentService.kt:126 call-site removal, the AI commit
single-fire check, and the E2E impact on aigen-jsonupload-coexistence.
Also flag the rename ordering trap in Task 2 and pin the required E2E
update list so the plan stops describing it as optional.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Three changes that close the loop on the v1.10.0/v1.10.1 incident chain:

1. V33 schema-default collation alignment. Production database default
   was utf8mb4_unicode_ci while existing tables (clubs.id, users.id, ...)
   are utf8mb4_0900_ai_ci, which is what caused V31's FK to fail with
   errno 3780. V33 runs ALTER DATABASE DEFAULT CHARACTER SET utf8mb4
   COLLATE utf8mb4_0900_ai_ci — affects only new tables/columns that
   omit an explicit COLLATE, no rewrite of existing data.

2. AiGenerationConfigValidator. @PostConstruct check that fails fast
   with an actionable message when readmates.aigen.enabled=true but no
   AiGenerationJobQueue bean is wired. Replaces the cryptic
   "No qualifying bean of type AiGenerationJobQueue" boot failure that
   surfaced in v1.10.1. Checks bean existence (not just kafka.enabled
   flag) so narrow integration tests using @MockitoBean still boot.

3. FK-collation regression test in MySqlFlywayMigrationTest. Forces a
   schema-default vs clubs.id collation mismatch and verifies that
   implicit-COLLATE FK creation fails while explicit-COLLATE succeeds.
   Cleanup in finally to preserve Testcontainers withReuse(true).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@beyondwin beyondwin merged commit 507ba2b into main May 17, 2026
9 checks passed
@beyondwin beyondwin deleted the fix/aigen-collation-and-startup-guard branch May 17, 2026 11:39
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