Skip to content

feat(api): include the parsed version tag in ROM responses - #5255

Draft
bercedev wants to merge 3 commits into
rommapp:masterfrom
bercedev:feat/rom-version-in-api
Draft

bercedev wants to merge 3 commits into
rommapp:masterfrom
bercedev:feat/rom-version-in-api

Conversation

@bercedev

@bercedev bercedev commented Oct 15, 2026 •

Copy link
Copy Markdown

Description

Closes #5243.

The filename parser already pulls a version tag such as (v2.00) or (version CN-07) into Rom.version and keeps it out of tags, but RomSchema never exposed it, so API clients couldn't tell two copies apart when they differ only by version. This adds version: str | None next to revision, so it shows up in both SimpleRomSchema and DetailedRomSchema.

The two changed files under frontend/src/__generated__/ are exactly what npm run generate (openapi-typescript-codegen 0.29.0, same flags) produces from the patched backend's tools.dump_openapi output, so the API types check should stay green. romFixture(), the list row fixture and RelatedGameCard build SimpleRom objects by hand, so they get version: null too (thanks to the review bot for catching that).

I left the docs mention the issue suggests for the docs repo.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Tests

test_rom_responses_include_the_parsed_version_tag renames a ROM to Helmet (version CN-07).nes and checks that version comes back as CN-07 from the update, the detailed and the simple endpoints, with tags empty. It fails on master with KeyError: 'version'.

pytest tests/endpoints/roms/test_rom.py tests/utils/test_openapi.py   130 passed (PostgreSQL 18, Valkey 9.0.6)
vue-tsc --build                                                     clean (3 errors without the fixture change)
vitest run src/v2/components/GameDetails src/v2/components/Gallery src/utils   216 passed

AI assistance

I used Claude Code to trace the parser and schema, write the change and the test, and run the checks above. I read the diff and the test results before opening this.

The filename parser stores a version tag such as `(v2.00)` or
`(version CN-07)` in `Rom.version` and keeps it out of `tags`, but the ROM
response schemas never exposed it, so a client had no way to read it.
Add `version` next to `revision` and regenerate the frontend types.

Closes rommapp#5243
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] Adds a parsed version field to ROM API responses.

Add the missing fixture default before merging so the frontend typecheck passes.

Fix All in Claude CodeFindings

  1. P1 Frontend typecheck fails ▶
Fix with agent prompt
### Issue 1
frontend/src/__generated__/models/SimpleRomSchema.ts:85
Adding required `version` breaks `romFixture()` in `frontend/src/utils/rom.fixtures.ts`. It returns `SimpleRom`, which aliases `SimpleRomSchema`, but never supplies `version`. The trailing `Partial<SimpleRom>` spread cannot guarantee that field, so `npm run typecheck` fails. Add `version: null` to the fixture defaults.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Exposes the parsed ROM version in API responses.

  • ROM responses include the version parsed from each filename.

Reviews (1) · Last reviewed commit: "feat(api): include the parsed version ta..." · Reviewed by Greptile

is_unidentified: boolean;
is_identified: boolean;
revision: (string | null);
version: (string | null);

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.

P1 Frontend typecheck fails

Adding required version breaks romFixture() in frontend/src/utils/rom.fixtures.ts. It returns SimpleRom, which aliases SimpleRomSchema, but never supplies version. The trailing Partial<SimpleRom> spread cannot guarantee that field, so npm run typecheck fails. Add version: null to the fixture defaults.

Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/__generated__/models/SimpleRomSchema.ts
Line: 85

Comment:
**Frontend typecheck fails**

Adding required `version` breaks `romFixture()` in `frontend/src/utils/rom.fixtures.ts`. It returns `SimpleRom`, which aliases `SimpleRomSchema`, but never supplies `version`. The trailing `Partial<SimpleRom>` spread cannot guarantee that field, so `npm run typecheck` fails. Add `version: null` to the fixture defaults.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in c1ea5ca: romFixture() in rom.fixtures.ts now supplies version: null, and so do the other two hand-built ROM objects (listRowFixture.ts and RelatedGameCard.vue).

romFixture(), the list row fixture and RelatedGameCard build SimpleRom
objects by hand, so vue-tsc rejected them once version became a required
schema field.
@gantoine
gantoine marked this pull request as draft October 27, 2026 20:10
@gantoine gantoine added the on-hold Pending further research or blocked by another issue label Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-hold Pending further research or blocked by another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Include the parsed version tag in the ROM API response

2 participants