Repository navigation
Revive the first-run seeder behind a seed profile - #37
Merged
Merged
Conversation
The seeder was commented out in October 2024, three weeks before the Date to LocalDate migration, so it no longer compiled. Restoring it gives a fresh database its first admin user, which the application has no sign-up page to create by design: HR adds people to the system. - Gate it with @Profile("seed"); it never runs in tests or in a normal start - Six hire dates: java.util.Date to LocalDateTime - Pay periods are now generated relative to today, six two-week periods ending with the current one. They were fixed 2024 dates, so no pay period covered today and the seed failed on clock-in - Replace javafaker with fixed sample values, so the data is the same on every run and a dead dependency can go - Seed the first 12 VINs rather than all 136; each one is decoded through the live NHTSA API Verified against in-memory H2: the seed completes, the seeded admin logs in, and the vehicle, customer and admin pages render the seeded records. [Ticket: #19] Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The seeded accounts used their own usernames as passwords, below the eight-character minimum the Passay policy enforces. Nothing rejected them, because the seeder calls the service directly rather than going through a validated form, but the seed should not contradict the application's own rule. Each account now uses <username>-demo-pass. [Ticket: #19] Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Closes #19
Brings back the first-run seeder so a fresh database has an administrator to sign in with. The
application has no sign-up page by design — HR adds people to the system — so without this, a new
installation has no way in.
SeedDatawas commented out in October 2024, three weeks before theDate→LocalDatemigration, and no longer compiled. Uncommenting it produced 12 errors, all the same one.
Changes to the seeder
@Profile("seed"), so it runs only on request and never during tests or a normalstart.
java.util.DatetoLocalDateTime, which is whatEmployeetakesnow.
one. They were fixed 2024 dates, so no period covered today and the seed failed part way through,
on the first clock-in.
and the dependency could go (removed in Remove dead weight and scaffold debris #36).
full list made startup slow;
SEEDED_VEHICLESraises it.<username>-demo-pass. The accounts previously used their ownusernames, below the eight-character minimum the Passay policy enforces. Nothing rejected them,
because the seeder calls the service directly rather than through a validated form, but the seed
should not contradict the application's own rule.
The
ManufacturerandModelreferences in it were already commented out before the file was, sothey needed no attention; those lookup tables were folded into
Vehicleas flat fields inSeptember 2024.
Verification
Run against in-memory H2, not just compiled:
customers with decoded vehicles;
hefty/hefty-demo-passsucceeds over HTTP;/vehicles,/customersand/admin/render the seeded records.Repeated after rebasing onto
mainwith #35 and #36 merged.Usage
🤖 Generated with Claude Code