feat(modtool): mod init --test writes a starter test; players' mods page covers sources #2868
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2868
Loadingβ¦
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:docs/mods-sources-leftovers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The players' mods page,
docs/user/using-mods.md, still said "Nothing downloads or unpacks mods for you", and itonly described emulator-style folders put in
mods/by hand. Players can now add sources (a git repository, a signedlongshot-repo.json, an.lsmodURL) in the launcher or withLongshot.exe mod source add, and install, update, pinand remove mods from them. The page now covers both ways to get mods:
mod source add,search,install,update,pin,remove. It also covers repo keys, the store andmod gc;.lsmodor.zip, a Longshot mod's folder or an emulator mod, put in the profile'smods/or copied in withmod add/mod import.What it said about file mods (romfs/exefs, the Mods tab, the order, the size table, the log) is kept.
The README that
mod initwrites ended with "mod packmakes its.lsmod". It now says how to share the mod, asgetting-started.md's step 9 does: push to git and tag each version,
mod publishfor a repo,mod packfor onefile. Its test checks this text.
docs/modding/template/AGENTS.md,CLAUDE.mdandREADME.mdwere stale and read by nothing (mod initwrites itsown README; the builder only hashes the folder). They are removed. api-schema.md's list of the template's files now
includes
.gitignore.Read first:
docs/user/using-mods.md, thengame/crates/modtool/src/cmd/init.rs.mod init --test(second commit).mod initstill writes no test;--testalso writestest/main.test.ts, fromdocs/modding/template/test/main.test.ts(kept), whichmod testpasses as written. Help, tools.md, agents.md, testing.md, getting-started.md step 6 and api-schema.md say so.Testing
Tested: Linux. No game run: docs, plus a string the builder's
mod initwrites.cargo test -p modtool --lib cmd::init(through the job queue): 2 passedpython3 -I tests/run_all.py --exact tests/test_doc_anchors.py tests/test_check_pr_description.py tests/test_dev_check.py: 3 passedpre-commit run --fileson the changed files: passedA fresh reviewer checked every claim against modtool (USAGE, service.rs, sources.rs), mod-store and the launcher's
labels. Its three wording fixes are in.
Review fixes (
a0b07a96): the source example adds with--yesbefore searching;pinsays it installs the version.tests/run_all.py, the whole suite, once through the job queue ona0b07a96: 734 passed, 1 failed, 114 skipped: the only failure,tests/test_lifter.py(build-core'scontrol::tests::the_socket_is_made_private_and_a_client_handed_over, control.rs:428), fails the same way on mod-api @12f42db5.Still to test:
None
cargo test -p modtool --lib cmd::init(through the job queue) on the second commit: 3 passed, including the newinit_test_writes_a_starter_test_that_mod_test_passes(runsinit --testthenmod test: 2 passed) and plain init writing notest/.Measurements
Nothing to measure: docs and an opt-in
mod initflag; nothing the game runs changed.Risks
Nothing a player notices except the new README text in a mod made with
mod init. If the launcher's Mods page labelschange, the page's names for them (Mods, Repositories, Discover, Add mods) will need updating.
Checklist
Ready for review
mod-api; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (tests/test_lifter.py: build-core's socket hand-over test, failing on mod-api @12f42db5too.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened (init's test checks the README).Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.π€ Generated with Claude Code
https://claude.ai/code/session_016o1k1SQVyAWsujjFVd8Wuc
Possibly related, for context:
mod init --testwrites a starter test thatmod testpassesAdded a second commit:
mod init --testwrites the template's starter test (plainmod initwrites none). init's tests pass (3).@review
Recommendation: Approve. The PR adds a modtool feature but its
docstitle would classify the release as documentation-only and select the wrong version bump. The new player guide also contains command sequences that can lead to an unsuccessful install or an unintended version change. Nothing blocking is left. Recommend approval; not approved on the forge.The change documents mod sources and sharing, removes unused template files, and adds an optional starter test to
mod init. The initializer test exercises the new option, while several player-facing instructions need correction.Should fix (3): not blocking, but worth doing before merging.
docseven though this change adds themod init --testfeature. The repository uses the squash title to choose the release type and minimum version. When: When merged under this title, the new modtool option is released as a documentation change with a patch minimum instead of the minor minimum required for a new modder feature. Do: Change the title to afeatConventional Commit that describes the new initializer option and documentation.docs/user/using-mods.md:36: The command example searches immediately after a preview-only source add. (more on the line) Do: Show the secondsource addwith--yesafter the preview and key check, before search.docs/user/using-mods.md:48: The description of pinning omits that the command can change the installed version. (more on the line) Do: Say that pin installs the specified version if necessary and then keeps it pinned.@fixcan do L1, L2 and L3.Checks: Failing on this head, which is behind its base, where it passes:
PR description / Title and description (pull_request_target).@rebase(or@fix) brings it up to date and runs it again; not held against it.More: does it help, other systems, switches, what was read
Does it help: Yes: the reported Linux run says all three initializer tests passed, including creating and running the two starter tests. This is not a performance change.
Other systems: The new flag affects mod authors using the builder on Windows and Linux; the implementation uses the existing argument parser and file writer. No game runtime, renderer, save, audio, or input code changes.
Switches:
mod init --testis a new opt-in command option, default off; that default preserves existing initializer behavior.Reviewed:
350b157225againstcb37f5ab8a: Read the diff, initializer, argument parser, starter template, player guide, changed documentation passages, source command and relevant source and pin handling. Skimmed the remaining long documentation files and modtool help, repository references to the deleted templates, and commit history. No recorded game runs or translations were supplied.; nothing run (a code review).Checked and fine:
--test, and the new test invokesmod teston the generated mod.Testing: Read-only review; no commands from the project or tests were run. The author reports three initializer tests passing on Linux. The full
mise run testremains unreported, and CI's description check is listed as behind the base.Overlaps and merge order: Not checked; network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -39,0 +33,4 @@**From the command line**, the same with `Longshot.exe mod` (add `--profile DIR` to pick the profile):```textLongshot.exe mod source add https://git.example.org/mooki/heart-trackerL2 (should fix): The command example searches immediately after a preview-only source add.
When: A player follows the three commands in order:
source addwithout--yesdoes not save the source, so search and install cannot find that source's mod.Do: Show the second
source addwith--yesafter the preview and key check, before search.@ -39,0 +45,4 @@`source add <url> --accept-key KEY --yes` again.- `install <id>` (the id `search` shows, from the mod's `mod.toml`) brings the newest version, with any other modsit needs, checks its files against what the source listed, and switches it on. `--version V` installs another version.- `update` brings every installed mod's newest version (`update <id>`: one mod's). `pin <id> <version>` keeps a modL3 (should fix): The description of pinning omits that the command can change the installed version.
When: A player on version 2 runs
pin <id> 1expecting the mod to stay where it is; the pin operation installs version 1 before pinning it.Do: Say that pin installs the specified version if necessary and then keeps it pinned.
docs(modding): players' mods page covers sources and installs; init's README says how to shareto feat(modtool):mod init --testwrites a starter test; players' mods page covers sourcesThanks. L2 and L3 fixed in
a0b07a96: the example now adds the source with--yesbefore searching, andpinsays it installs the version when the mod is on another one (service.rspin). L1: agreed, the title should be afeat(modtool)one sincemod init --testis new; retitled. Measurements now says why there is nothing to measure.