Public: anyone can read this; the crew can change it.

Games: a new pin for the forge's proxy plugin replaces the old jar, in PLUGINS and on disk, and the page says which one loaded #18111

opened this in answer to

Merged 5h 59m ago, live in production

This covers point 1 only: committing a pin now replaces the same plugin's entry in PLUGINS. The jar cleanup on apply, the named stray jars and the loaded-version line from the issue are not built, so the issue isn't done.

Notes

opened this

This covers point 1 only: committing a pin now replaces the same plugin's entry in PLUGINS. The jar cleanup on apply, the named stray jars and the loaded-version line from the issue are not built, so the issue isn't done.

Tests: test/game-proxy-jars.test.ts passes (20), including a new test for the replacement, and tsc is clean. A wider run of test/game-*.test.ts hit the sandbox's network block on api.modrinth.com and timed out, so I don't have a result for it. The forge's check runs the full suite on the push.

What changed

  • Replacement in withJar (src/games/proxy_jars.ts): a pin for a /forge-jars/ jar now drops any other /forge-jars/ entry of the same plugin, told by the name before the version or hash. Entries for other plugins, and uploaded-jar URLs like https://…/a.jar, are kept. The plan shows the old entry under "gone".
  • AutoStopper check: the "give the proxy forge-velocity first" check now ignores the entry being replaced. Without that, replacing the only AutoStopper entry would have passed the check wrongly.
  • Prune in src/games/agent.sh: jars_ready now deletes any regular file in the box's own jars/ directory that the forge's jar list doesn't name. That directory is the forge's copy folder beside the compose file, not /server/plugins.

What I left out

  • Removal from /server/plugins: no helper-container step that removes forge-placed jars that PLUGINS no longer names, and no naming of hand-placed jars on the page. Per the correction, the image already removes the old jar when PLUGINS names something. The existing AutoStopper helper in agent.sh is the pattern to extend.
  • Loaded version on the page: no "Loaded plugin forge …" read from the proxy log, and no words when it isn't the pinned one. This is the biggest gap, since it would have settled the incident at a glance.
  • Doors: the commit line says No door because the form already exists and only what it writes changed. If review wants the terminal and how-to side for the loaded-version line, it comes with that work.
  • Test box: no end-to-end test with an old jar on disk; the new test covers the PLUGINS edit only.

To try it, upload the new forge-velocity jar on the proxy's page while PLUGINS names an older /forge-jars/forge-velocity-… entry. The plan should show the old entry under "gone" and a single forge-velocity entry added.

Closes #18110

4 earlier comments · 1 event
commented

This covers point 1 only: committing a pin now replaces the same plugin's entry in PLUGINS. The jar cleanup on apply, the named stray jars and the loaded-version line from the issue are not built, so the issue isn't done.

Tests: test/game-proxy-jars.test.ts passes (20), including a new test for the replacement, and tsc is clean. A wider run of test/game-*.test.ts hit the sandbox's network block on api.modrinth.com and timed out, so I don't have a result for it. The forge's check runs the full suite on the push.

What changed

  • Replacement in withJar (src/games/proxy_jars.ts): a pin for a /forge-jars/ jar now drops any other /forge-jars/ entry of the same plugin, told by the name before the version or hash. Entries for other plugins, and uploaded-jar URLs like https://…/a.jar, are kept. The plan shows the old entry under "gone".
  • AutoStopper check: the "give the proxy forge-velocity first" check now ignores the entry being replaced. Without that, replacing the only AutoStopper entry would have passed the check wrongly.
  • Prune in src/games/agent.sh: jars_ready now deletes any regular file in the box's own jars/ directory that the forge's jar list doesn't name. That directory is the forge's copy folder beside the compose file, not /server/plugins.

What I left out

  • Removal from /server/plugins: no helper-container step that removes forge-placed jars that PLUGINS no longer names, and no naming of hand-placed jars on the page. Per the correction, the image already removes the old jar when PLUGINS names something. The existing AutoStopper helper in agent.sh is the pattern to extend.
  • Loaded version on the page: no "Loaded plugin forge …" read from the proxy log, and no words when it isn't the pinned one. This is the biggest gap, since it would have settled the incident at a glance.
  • Doors: the commit line says No door because the form already exists and only what it writes changed. If review wants the terminal and how-to side for the loaded-version line, it comes with that work.
  • Test box: no end-to-end test with an old jar on disk; the new test covers the PLUGINS edit only.

To try it, upload the new forge-velocity jar on the proxy's page while PLUGINS names an older /forge-jars/forge-velocity-… entry. The plan should show the old entry under "gone" and a single forge-velocity entry added.

commented

All three boxes from the issue are built, and I pushed to #18111. tsc, design-lint, the gate, and the module-state, unused-exports and route-timing tests are clean. The agent, proxy-jars and terminal tests pass (41). I did not run the full suite or the other game-*.test.ts files. The agent's removal and log-reading run in the tests against a fake docker, not a real proxy.

What changed

  • Pin replaces the old entry (withJar): the kept list is computed once and used in both places (item 6).
  • Loaded version (box 3):
    • Agent report: agent.sh reads the proxy's log for "Loaded plugin <id> <version> by …", at most once a minute, and reports it in the sync's diag with the jar names the forge pinned.
    • Page and terminal: src/games/plugins_loaded.ts (pluginLines) turns that into words, and both the page's box block and the terminal's box screen print it. It says "The proxy loaded forge 0.1.0, the pinned version.", or "…forge 0.0.9, not the pinned forge-velocity 0.1.0.", or that the log doesn't show the plugin loaded yet.
    • Doc: the how-to is in docs/features/games.md. The No door line is gone.
  • On-disk removal (box 2): after a successful up, plugins_tidy runs a helper container over /server/plugins. It removes forge-velocity- or AutoStopper- jars that PLUGINS no longer names and whose bytes match the hash in their file name. Any other jar with a pinned plugin's name stays and is reported as stray, and the page names it. It does nothing when the jar list is empty or broken.
  • Copy-folder prune (item 3): it now deletes only when jq ran and answered false.

What I chose not to do

  • Stray scope: a jar counts as stray only when its name starts with one of the two pinned plugins. I can't tell a hand-placed jar from a Modrinth one, so an unrelated jar like WorldEdit is never touched or named.
  • Older agents: they send none of the new fields, so the page shows nothing new until the agent updates itself.
  • MCP and /games/<box>/<service> page: no new lines there.

Tests

  • test/game-agent-plugins.test.ts: on-disk removal, hand-placed jar kept and named, empty or broken list removes nothing, log report, and the copy-folder prune.
  • test/game-proxy-jars.test.ts: the replacement in PLUGINS, and the page's loaded-version and mismatch words.
  • test/tui-games.test.ts: the terminal's box screen shows the same words as the page.

To try it Open /games/mc as the box's owner. Under Box, the lines say which forge version the proxy loaded, what was taken out, and what was left.

[
  {"go": "/games/mc", "look": "the Box section, after the box has synced with an agent that reports plugins", "expect": "a line 'The proxy loaded forge <version>, the pinned version.' or '…not the pinned forge-velocity 0.1.0.'"},
  {"go": "/games/mc", "look": "the same section when a jar was removed or a hand-placed one left", "expect": "'Taken out of the proxy's plugins…' names the removed jars and 'Left in the proxy's plugins…' names the hand-placed ones"},
  {"go": "/games/mc/velocity", "look": "Forge plugins, pin forge-velocity while an older forge-velocity entry is in PLUGINS", "expect": "the plan's lines add the new entry and its 'gone' lines show the old one"}
]
commented

<!-- look-pages a7f2ec4d25f4 --> Look pages for a7f2ec4, from the gate:

  • look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

I found no defect in the pull, so I pushed nothing. No check of the head is recorded as failed. The forge cut the check or is re-running it, and it will check the head again by itself. If it comes back red on a named test, I'll fix that test's assertion.

commented

<!-- look-pages 5d975bd266d3 --> Look pages for 5d975bd, from the gate:

  • look pages (none): "Looks: /games/mc" is not a page of app.looks in forge.json; this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /admin/telemetry, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs