Repository navigation
feat(gateway): forward /api/games to the games service - #188
Merged
Merged
Conversation
The app reaches the games I played lately at GET /api/games/recent, behind both of the gateway's locks, as it reaches the other services. games is one of the gateway's peers, which BAKHYARD_PEERS must name, and mise run up starts the gateway once games is ready. The laptop's gateway gets its games peer from codedogapp/homelab#44, which must merge first: a gateway without it would not start.
This was referenced Oct 30, 2026
# Conflicts: # docs/plan.md # docs/setup.md
There's no Twitch app yet, and the user chose to run the games list on the laptop now (decision 309). homelab-games-covers adds the covers once the app exists.
# Conflicts: # docs/plan.md
This was referenced Oct 30, 2026
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.
Brief
Goal: the app reaches the games list through the gateway, at
GET /api/games/recent, behind both of the gateway's locks. The ninth ofgames-exophase's eleven steps (decision 300).Scope:
gamespeer, as it does every other, and forwards/api/gamesand every path under it to games, as/games…, behind the Tailscale and session locks, with the session cookie hidden from games (session.Hide).mise run up: the gateway'sBAKHYARD_PEERSnames games on 8090, and the gateway starts once games is healthy.homelab-gamesandhomelab-games-covers: the laptop runs games without covers until there's a Twitch app, as you chose when you couldn't log in to Twitch. codedogapp/homelab#44 was reworked to match.Out of scope: the Games page (
games-page); the Home asking games, which answers no attention contract; the laptop, which codedogapp/homelab#44 sets up.Order: this PR merges only after codedogapp/homelab#44 (merged and applied: the laptop's gateway runs with its games peer), so that the laptop's gateway has its games peer before it requires one; a gateway without it would exit 1 and take the whole app down. Since #190 and #193 have merged, it's also the feature's last PR, so it sets
games-exophase's §0 row to Done, noting that the laptop's covers wait for a Twitch app.Acceptance criteria
GET /api/games/recentreaches games asGET /games/recent; any method and path under/api/gamesgets to games, which answers for its own paths and methods./api/games/recentgets 401; without the Tailscale identity, the gateway refuses it as it refuses the other paths.gamespeer inBAKHYARD_PEERS, the gateway exits 1 withBAKHYARD_PEERS has no peer "games", beside any other peer it lacks./api/games/recentgets a 503 withgames is unavailable.mise run upstarts the gateway once games is healthy, and the gateway forwards to it on 8090.mise run checkis green.QA
BAKHYARD_E2E_PORT=8380 mise run checkis green on 1a3cad5, withmainat 7f6919e merged in: golangci-lint 0 issues, govulncheck clean, Go coverage 97.1%, Vitest 1341 passed, the end-to-end tests 438 passed and 8 skipped, with the Playwright gateway naming games. On the previous head, 269341e, the first run failed only in the planner'sTestStopEndsTheQuestions, a 10 s timeout while another session ran its checks; the rerun AGENTS.md allows was green. Itsprocess-compose up --dry-runtakes the new gateway block./api/games/recentandPOST /api/gamesreach games as/games/recentand/games;theme=darkand never the session cookie, and the session is renewed;gameswhenBAKHYARD_PEERSlacks it, alone or withweb;/api/games/recenttoo.bin/games(no Exophase setting) behindbin/e2e/gateway:GET /api/games/recentgot games' own404 Exophase is not set up, HEAD a 404, and POST games' 405;/games, the page's path, still went to web.503 {"code":"unavailable","message":"games is unavailable"}, and the gateway loggedupstream unavailable upstream=games.gamesinBAKHYARD_PEERS, the gateway exited 1 withBAKHYARD_PEERS has no peer "games".game; games behind the Tailscale lock alone, without a session; the games peer optional; the peer namedgame.Review
No blocking findings. The change follows
time-gateway(#151) andgithub-gateway(#179) line for line: a peer, a route behind both locks, process-compose's wait, the Playwright peer, and the tests' peer lists.Non-blocking:
BAKHYARD_PEERS; a helper that builds it from the peers' names, aswithPeersdoes, would shrink that. That's a refactor for a step of its own.games, github, home, ….