Skip to content

test: verify Collection uploads through Server analysis and Dashboard - #124

Merged
jackshim415 merged 5 commits into
mainfrom
jackshim415/lvt-272-cross-app-contract-tests
Nov 13, 2026
Merged

jackshim415 merged 5 commits into
mainfrom
jackshim415/lvt-272-cross-app-contract-tests

Conversation

@jackshim415

@jackshim415 jackshim415 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Collection, Server and Dashboard previously tested separate fixtures, so incompatible serializers or analysis responses could pass independently. This adds one fictional corpus with independently specified scores, legacy/malformed reports, two source teams and private-note expectations. CI passes Collection's actual serialized payloads through the real Server and disposable PostgreSQL/Redis, then decodes the actual analysis response in Dashboard.

Shared fixture/backend changes select consumer contracts. The aggregate requires every applicable suite to succeed, including Railway config, and fails on missing/skipped/cancelled results. Diagnostic contract reports upload after failure and join GitHub Pages at /lovat/contracts/ after a successful main run. The index only links to declared coverage reports. Align SDK 58 patch packages required by Expo's newly updated compatibility gate; the same alignment is included in Collection PR #125.

Validation: the real cross-app GitHub job passed in run 43247779577. Local bash scripts/check-contracts.sh passed twice against the same verified loopback-only databases (2 Collection + 3 Server + 2 Dashboard tests each run), confirming cascade cleanup/reruns. Server build/typecheck/lint and 1,462 unit tests passed; Collection test typecheck/lint and Dashboard analysis passed; 15 selection/gate/report tests, actionlint, structure and diff checks passed. After SDK alignment, Collection compatibility, all 141 existing tests, lint/format/types pass locally. Latest full CI pending. Expected arithmetic/provenance is documented for reviewer inspection.

Physical devices, real Auth0, branch protection and provider promotion remain separately tracked release work; no production deployment is performed.

Refs: LVT-272, LVT-273.

Serialize fictional current and legacy reports in Collection, persist and analyze them through real Server handlers with two private source teams, and decode the actual response in Dashboard. Keep independent expected scores and malformed-payload outcomes.

Refs: LVT-272
Run the retained upload-to-analysis journey with disposable services and fail the aggregate when any applicable job is skipped, missing, cancelled or unsuccessful.

Refs: LVT-272, LVT-273
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T15:28:25.008348Z 1c79535 PR opened
🔒 Security Review ✅ Completed 2026-11-12T15:30:00.490464Z 1c79535 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@railway-app

railway-app Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the lovat-pr-124 environment in lovat

Service Status Web Updated
worker ⏭️ Skipped (View Logs) Nov 13, 2026 at 12:25 am UTC
dashboard 😴 Sleeping (View Logs) Web Nov 12, 2026 at 3:36 pm UTC
website 😴 Sleeping (View Logs) Web Nov 12, 2026 at 3:35 pm UTC
learn 😴 Sleeping (View Logs) Web Nov 12, 2026 at 3:34 pm UTC
api ✅ Success (View Logs) Web Nov 12, 2026 at 3:31 pm UTC
2 services not affected by this PR
  • support
  • worker

@railway-app
railway-app Bot temporarily deployed to lovat / lovat-pr-124 November 12, 2026 15:26 Destroyed
github-actions[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Lovat AI review

Status: completed · Model: z-ai/glm-5.3-flash · Findings: 1

Reviewed commit: 538b863addd7d9d1bdba52ef2f7fd96d2b7dd7d5

Critical: 0 · High: 0 · Medium: 1 · Low: 0

Overall assessment

This PR is almost entirely test and CI infrastructure, and the contract journey itself is well constructed: fixtures are synthetic, authorization is exercised through real JWT middleware, and the gate logic fails closed. The main concrete defect is in the Server integration test's teardown, which deletes teams, users, and the tournament but leaves scout reports, team match data, registered teams, and scouters behind, so the suite is not idempotent against a persistent lovat_test database and will fail on a second local run with unique-constraint or foreign-key errors.

Findings

Medium (1)

  • apps/server/test/crossAppContract.integration.test.ts:196 — Integration test teardown leaves scoutReport, teamMatchData, registeredTeam, and scouter rows behind (DATABASE · confidence 0.75)
    beforeAll creates registeredTeam, scouter, teamMatchData, and uploads scout reports, but afterAll only deletes cachedAnalysis, users, teams, and the tournament. The uploaded scout reports (uuids 92720001-...-0001..0004) and the teamMatchData rows for the two robots are never removed, and registeredTeam/scouter rows referencing the source teams are deleted only indirectly (if at all, via team deletion). On any persistent lovat_test database (the documented local workflow reuses one), a second run fails: db.team.create violates the unique number constraint, db.registeredTeam/scouter creations collide, and the scout report upload for an existing uuid will not behave as a fresh insert. Leftover teamMatchData rows can also block or corrupt tournament deletion on reruns.

    Suggestion: Extend the afterAll cleanup to delete scoutReport rows by the fixture uuids, teamMatchData rows for the robots/tournament, scouter rows by scouterUuid, and registeredTeam rows by code, before deleting teams and the tournament.

Review details

  • Review batches: 1
  • Diff characters reviewed: 52,331
  • Tokens: 18,183 prompt + 2,232 completion
  • Estimated inference cost: $0.0029
  • Files excluded by configuration: 1

Limitations

  • The reviewer examined only changed lines and their diff context, not the whole repository.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c79535567

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1 @@
{"slug":"contracts","label":"Cross-app contracts","required":["index.html","outcomes.json","collection-payloads.json","analysis.actual.json"],"browser":false}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Suppress the nonexistent contracts coverage link

When a successful main build publishes the report site, registering this section makes preparePagesReports render a contracts/coverage/ link for it, but the contract job never creates or uploads that directory and this manifest does not require it. The new Cross-app contracts row therefore always sends users to a missing page; add an explicit coverage capability to report sections or otherwise render this entry without that link.

AGENTS.md reference: AGENTS.md:L54-L56

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

📱 Connect your app to this PR deployment

Scan a QR code to use this PR's Server API. Worker changes use the same API;
the Worker has no public app endpoint.

Server URL: https://api-lovat-pr-124.up.railway.app

Lovat Collection

QR code — Lovat Collection

lovat-collection://set-url?u=https%3A%2F%2Fapi-lovat-pr-124.up.railway.app

Lovat Dashboard

QR code — Lovat Dashboard

com.frc8033.lovatdashboard:///set-url?u=https%3A%2F%2Fapi-lovat-pr-124.up.railway.app

Keep the online SDK compatibility gate passing and render only coverage reports that are declared by their producer. Verify the contract chain reruns against the same disposable databases; Prisma cascades remove seeded descendants.

Refs: LVT-272, LVT-273
github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovat AI review: 1 new finding(s) at 538b863addd7d9d1bdba52ef2f7fd96d2b7dd7d5.

The persistent Lovat AI review comment contains the latest complete result.

  • apps/server/test/crossAppContract.integration.test.ts:196 — Integration test teardown leaves scoutReport, teamMatchData, registeredTeam, and scouter rows behind (DATABASE · confidence 0.75)

.set("X-Lovat-Error-Format", "json-v1");
}

describe.sequential(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MEDIUM · DATABASE — Integration test teardown leaves scoutReport, teamMatchData, registeredTeam, and scouter rows behind

beforeAll creates registeredTeam, scouter, teamMatchData, and uploads scout reports, but afterAll only deletes cachedAnalysis, users, teams, and the tournament. The uploaded scout reports (uuids 92720001-...-0001..0004) and the teamMatchData rows for the two robots are never removed, and registeredTeam/scouter rows referencing the source teams are deleted only indirectly (if at all, via team deletion). On any persistent lovat_test database (the documented local workflow reuses one), a second run fails: db.team.create violates the unique number constraint, db.registeredTeam/scouter creations collide, and the scout report upload for an existing uuid will not behave as a fresh insert. Leftover teamMatchData rows can also block or corrupt tournament deletion on reruns.

Suggested fix: Extend the afterAll cleanup to delete scoutReport rows by the fixture uuids, teamMatchData rows for the robots/tournament, scouter rows by scouterUuid, and registeredTeam rows by code, before deleting teams and the tournament.

Lovat AI review · confidence 0.75 · z-ai/glm-5.3-flash

@jackshim415
jackshim415 merged commit 023ff27 into main Nov 13, 2026
29 checks passed
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