Repository navigation
Game database: build the index with the weekly download; CLI e2e tests download nothing - #74
Open
ChakraFusion wants to merge 2 commits into
Open
ChakraFusion wants to merge 2 commits into
ChakraFusion wants to merge 2 commits into
Conversation
After every weekly download of the Ludusavi manifest, the next caller that wanted the game database found the manifest newer than its index and built the index itself, parsing the 17.7 MB YAML in the foreground. That caller is a scan (the background scan, or "Scan saves"), or tracking any game: TrackGame looks up the game's registry keys in the database first (setUpRegistryCapture -> RegistryKeysFor). Measured with the real manifest, `opensave scan` takes 32.2 s in that state and 3.2 s with the index in place. The background download now builds the index before the manifest takes its place, and dates the manifest a second before it (the clock can give both files the same time), so no caller rebuilds it in the foreground. TestDownloadedManifestArrivesWithItsIndex fails without the change (no index after the download). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The e2e tests run the CLI as a separate program, out of reach of the Scanner settings the in-process test daemons get (testutil.NewTestDaemon sets ManifestURL empty). With a fresh home there is no manifest, so each run started fetching the 17.7 MB Ludusavi manifest from GitHub, and a CLI daemon finished the download: CI depending on the network for nothing. OPENSAVE_MANIFEST_URL, when set, now replaces the manifest's address, and set empty turns the download off; the CLI harness sets it empty. TestManifestURLFromTheEnvironment fails without the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Two small changes around the Ludusavi manifest (the game database), one commit each.
1. A ~30 s pause after every weekly manifest download
The manifest is downloaded in the background once a week. Its compact index (
ludusavi-index-v2.json) was not built at that point. It was built by whichever caller next found the manifest newer than its index, which parsed the 17.7 MB YAML in the foreground. That caller is a scan, either the background scan or "Scan saves", or tracking a game:TrackGamelooks up every game's registry keys in the database first (setUpRegistryCapture→RegistryKeysFor), so tracking any game waited too.Measured on today's
dev-publicwith the real manifest,opensave scanwith an empty home:The download now builds the index before the new manifest takes its place. It also dates the manifest a second before the index, because the clock can give both files the same time. So after a download nothing is parsed in the foreground. If building the index fails, the manifest still replaces the old one and the next caller builds the index as before.
TestDownloadedManifestArrivesWithItsIndexfails without the change: there is no index after the download.2. CLI e2e tests no longer fetch the manifest from GitHub
The e2e tests run the CLI as a separate program, so the empty
ManifestURLthe in-process test daemons get (testutil.NewTestDaemon) doesn't reach it. Each run has a fresh home without a manifest, so it started downloading the 17.7 MB manifest fromraw.githubusercontent.com, and a CLI daemon finished that download. So CI was depending on the network for nothing.OPENSAVE_MANIFEST_URL, when set, now replaces the manifest's address, and set empty turns the download off. The CLI harness sets it empty.TestManifestURLFromTheEnvironmentfails without the change. Nothing changes for users, who don't set the variable.I haven't traced a red CI run to this download, so it's a network dependency removed rather than a failure explained.
Background: the cloud session that ported today's fixes to my fork found both. On the fork the pause hit the first snapshot after a download, because a fork-only feature reads the index there. Upstream it's the scan and tracking a game, measured above.
Checks: the full unit and e2e suites pass locally. Fork CI: green.
🤖 Generated with Claude Code