Add plugin update and install reporting

This commit is contained in:
pleb
2026-06-28 12:12:57 -07:00
parent 5a9e873de4
commit 931c1d4f73
9 changed files with 618 additions and 42 deletions
@@ -54,19 +54,7 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
PYTHONPATH=src python -m plugin_helper instances
```
4. Snapshot first when requested.
If the user asks for a one-time or pre-helper snapshot, archive the instance's `Plugins/` directory before any install:
```bash
mkdir -p "$HOME/archive/beatsaber"
tar -C "<instance-root>/<instance>" -czf "$HOME/archive/beatsaber/<instance>-Plugins-pre-helper-<timestamp>.tar.gz" Plugins
sha256sum "$HOME/archive/beatsaber/<instance>-Plugins-pre-helper-<timestamp>.tar.gz"
```
Report the archive path and hash.
5. Resolve the release from the user-provided URL only.
4. Resolve the release from the user-provided URL only.
For GitHub URLs, derive `<owner>/<repo>` and optional `<tag>` from the URL. Query the GitHub API directly for metadata:
@@ -77,20 +65,20 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
Pick the asset that matches the Beat Saber instance/version. Prefer an exact versioned asset such as `1.40.8.zip` over broad or source archives. If multiple plausible assets remain, ask the user.
6. Inspect the asset before selecting an install strategy.
5. Inspect the asset before selecting an install strategy.
Download to the helper state directory:
```bash
mkdir -p .state/instances/<instance>/downloads
curl -L --fail -o .state/instances/<instance>/downloads/<asset-name> "<browser_download_url>"
sha256sum .state/instances/<instance>/downloads/<asset-name>
mkdir -p .state/instances/<instance>/downloads/<plugin-id>
curl -L --fail -o .state/instances/<instance>/downloads/<plugin-id>/<asset-name> "<browser_download_url>"
sha256sum .state/instances/<instance>/downloads/<plugin-id>/<asset-name>
```
Match the checksum against GitHub's `digest` when available. Inspect zip contents:
```bash
unzip -l .state/instances/<instance>/downloads/<asset-name>
unzip -l .state/instances/<instance>/downloads/<plugin-id>/<asset-name>
```
Strategy guide:
@@ -101,7 +89,7 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
- `zip-to-pending`: only when the release is intended for `IPA/Pending/`.
- `manual`: do not use for installable releases.
7. Update the registry and lockfile.
6. Update the registry and lockfile.
Add or update exactly one `[[plugins]]` entry in `registry/plugins.toml` with:
@@ -128,7 +116,7 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
Preserve unrelated registry and lockfile content. Do not invent dependency versions unless they are explicitly stated by the provided release notes or existing local metadata.
8. Use the helper to validate, plan, and apply.
7. Use the helper to validate, plan, and apply.
Always pass `--state-dir .state` so the helper uses the repo-local downloaded asset:
@@ -140,7 +128,7 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
Before applying, read or summarize the generated plan enough to confirm it changes only the intended plugin files.
9. Verify the result.
8. Verify the result.
Confirm the installed file hashes match the plan or archive members:
@@ -152,12 +140,11 @@ https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
Use `PYTHONPATH=src`; plain `python -m unittest` may fail in this source-layout repo.
10. Final response.
9. Final response.
Include:
- release URL/tag/asset used
- snapshot path and hash, if created
- files changed in the repo and helper state
- live instance files changed
- backup path created by the helper