Add Beat Saber plugin update audit skill
This commit is contained in:
@@ -1703,6 +1703,129 @@ instance = "1.40.8"
|
||||
self.assertEqual(result["plugins"][0]["status"], "update")
|
||||
self.assertEqual(result["plugins"][0]["latestAssetSha256"], "new")
|
||||
|
||||
def test_update_check_reports_beatmods_update(self) -> None:
|
||||
registry = Registry(
|
||||
{
|
||||
"songcore": RegistryPlugin(
|
||||
id="songcore",
|
||||
name="SongCore",
|
||||
repo="Kylemc1413/SongCore",
|
||||
asset_patterns=("SongCore-*.zip",),
|
||||
install_strategy="bsipa-zip",
|
||||
)
|
||||
}
|
||||
)
|
||||
lockfile = Lockfile(
|
||||
beat_saber_version="1.44.1",
|
||||
instance="1.44.1",
|
||||
plugins=(
|
||||
LockedPlugin(
|
||||
id="songcore",
|
||||
repo="Kylemc1413/SongCore",
|
||||
tag="beatmods-3.16.0",
|
||||
asset="SongCore-3.16.0.zip",
|
||||
sha256="old",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
result = check_updates(
|
||||
registry=registry,
|
||||
lockfile=lockfile,
|
||||
fetch_releases=lambda repo: [],
|
||||
fetch_beatmods=lambda game_version: [
|
||||
{
|
||||
"mod": {"id": 1, "name": "SongCore", "gitUrl": "https://github.com/Kylemc1413/SongCore"},
|
||||
"latest": {"id": 2600, "modVersion": "3.17.0", "zipHash": "abc"},
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
self.assertEqual(result["summary"]["updates"], 1)
|
||||
self.assertEqual(result["plugins"][0]["status"], "update")
|
||||
self.assertEqual(result["plugins"][0]["latestTag"], "beatmods-3.17.0")
|
||||
self.assertEqual(result["plugins"][0]["latestBeatModsZipHash"], "abc")
|
||||
|
||||
def test_update_check_skips_private_sources(self) -> None:
|
||||
registry = Registry(
|
||||
{
|
||||
"naluluna": RegistryPlugin(
|
||||
id="naluluna",
|
||||
name="Naluluna",
|
||||
repo="patreon/NalulunaModAssistant",
|
||||
install_strategy="root-zip",
|
||||
)
|
||||
}
|
||||
)
|
||||
lockfile = Lockfile(
|
||||
beat_saber_version="1.44.1",
|
||||
instance="1.44.1",
|
||||
plugins=(
|
||||
LockedPlugin(
|
||||
id="naluluna",
|
||||
repo="patreon/NalulunaModAssistant",
|
||||
tag="installed-1.44.1",
|
||||
asset="Naluluna-1.44.1-installed-bundle.zip",
|
||||
sha256="hash",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
result = check_updates(
|
||||
registry=registry,
|
||||
lockfile=lockfile,
|
||||
fetch_releases=lambda repo: self.fail("private sources should not query GitHub"),
|
||||
fetch_beatmods=lambda game_version: self.fail("private sources should not query BeatMods"),
|
||||
)
|
||||
|
||||
self.assertEqual(result["summary"]["skipped"], 1)
|
||||
self.assertEqual(result["plugins"][0]["status"], "skipped")
|
||||
self.assertIn("paid/private", result["plugins"][0]["messages"][0])
|
||||
|
||||
def test_update_check_marks_local_pr_build_for_review(self) -> None:
|
||||
registry = Registry(
|
||||
{
|
||||
"jdfixer": RegistryPlugin(
|
||||
id="jdfixer",
|
||||
name="JDFixer",
|
||||
repo="zeph-yr/JDFixer",
|
||||
asset_patterns=("JDFixer.dll",),
|
||||
install_strategy="dll-to-plugins",
|
||||
)
|
||||
}
|
||||
)
|
||||
lockfile = Lockfile(
|
||||
beat_saber_version="1.44.1",
|
||||
instance="1.44.1",
|
||||
plugins=(
|
||||
LockedPlugin(
|
||||
id="jdfixer",
|
||||
repo="zeph-yr/JDFixer",
|
||||
tag="pr-26-3fce6ce",
|
||||
asset="JDFixer.dll",
|
||||
sha256="hash",
|
||||
reason=(
|
||||
"Local build from GitHub PR https://github.com/zeph-yr/JDFixer/pull/26. "
|
||||
"Use this PR build instead of the failed upstream release asset."
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
result = check_updates(
|
||||
registry=registry,
|
||||
lockfile=lockfile,
|
||||
fetch_releases=lambda repo: self.fail("review builds should not be treated as routine GitHub checks"),
|
||||
)
|
||||
|
||||
self.assertEqual(result["summary"]["reviews"], 1)
|
||||
self.assertEqual(result["plugins"][0]["status"], "review")
|
||||
self.assertEqual(result["plugins"][0]["reviewReasons"], [
|
||||
"local build",
|
||||
"pull request build",
|
||||
"compatibility failure history",
|
||||
])
|
||||
|
||||
|
||||
def _make_tui_fixture(
|
||||
root: Path,
|
||||
|
||||
Reference in New Issue
Block a user