Repository navigation
DayTrader on Go + PostgreSQL: parity 13/13 with the Liberty baseline (for review, do not auto-merge) - #9
DayTrader on Go + PostgreSQL: parity 13/13 with the Liberty baseline (for review, do not auto-merge)#9devin-ai-integration[bot] wants to merge 21 commits into
Conversation
- tools/ws_inventory.py: REPLACEMENT_RULES fills all 146 replacement cells (Go / AWS target) - docs/MIGRATION_PLAN.md - daytrader-go/: net/http front controller + handler registry, pgx store, PostgreSQL migrations, TradeConfig from env, seed command, /daytrader/health, shared layout, compose
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Browser check: Liberty (:9083) and the Go container (:8080), same story in ChromeStory in both apps: log in as
Seen on both: same labels and form fields on every step, the bought holding appears in the portfolio and is gone after the sell, the profile name is kept when the account page is reopened, Walkthrough (annotated recording, 1:54, shown here at 2 frames per second; the recording tool condenses idle time, so it is shorter than the 4-6 minutes asked for; the full video is in the Devin session) Findings and limits
|
Summary
Replaces the DayTrader 3 runtime (Java EE 6 on WebSphere Liberty, Derby) with a Go service on PostgreSQL in
daytrader-go/, plus Terraform for ECS Fargate ininfra/terraform/. The legacy modules are untouched and stay runnable for comparison. This PR is for human review; do not auto-merge.Result: parity 13/13 against the recorded Liberty transcripts, for both the Go binary and the Go container on PostgreSQL.
parity/transcriptsandparity/rules.yamlare unchanged.docs/evidence/parity-report-binary.mddocs/evidence/parity-report-container.mdgo vet ./... && go test ./...(with database)terraform fmt -check,init -backend=false,validateSuccess! The configuration is valid.docs/TERRAFORM_VALIDATE.txtdocs/WEBSPHERE_INVENTORY.mdTerraform was only validated: never planned against an account, never applied, no AWS credentials.
How it is built
net/http+html/template,pgxpool,shopspring/decimalfor money. Context path/daytrader, health at/daytrader/health./daytrader/app?action=..., dispatches to a handler registry (internal/web). Each area (internal/features/{auth,market,trading,account,rest}) registers its own actions and hands over withapp.Forward, the way the servlet chained register -> login -> home.daytrader seed(and/config?action=buildDBTables|buildDB) reproduces the legacy seeding: 15,000 users, 10,000 quotes, in about 1 s.pgx.Txinstore.InTx.KEYGENEJBid blocks useSELECT ... FOR UPDATE.ORDER_PROCESSING_MODE=async. It is off by default (sync, as the recorded baseline) and was tested only with an in-memory queue, never against AWS.docs/MIGRATION_PLAN.mdhas the full mapping and risks.Recorded quirks kept
Invalid login answers HTTP 500, the account page shows
Total Orders: 0, andGET /rest/addresses/{entryName}answers 415.Deliberate behaviour changes
None of these is covered by a parity scenario; each needs a reviewer's yes or no.
nulls.symbolas a tie-break in its ordering.DTStreamer3MDBis not ported).Content-Length: 0is not sent on 204 responses.Known gaps
config.FromEnvdoes not trim whitespace;javafmt.Doubledoes not switch to1.0E7notation at 10,000,000 and above; the store cannot read NULL in nullable legacy columns (the seeder never writes one).Child PRs (all open, none merged; this branch combines them locally)
#2 auth, #3 infra, #4 account, #5 market, #6 rest, #7 tests, #8 trading. They target
migration/daytrader-goand can be closed by a human once this PR is decided.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/94c6036d1f034639a8f1cc7f4dfc5bb7
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/94c6036d1f034639a8f1cc7f4dfc5bb7?variant=devin
Requested by: @sumitshatwara