Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A Paper plugin that runs smoke tests when the server boots, before players can join. Other plugins can add their own tests.

**Status:** early, version 0.3.0. It needs Minecraft 26.1 or newer and Java 25; 1.21 isn't supported. It has passed clean runs, lockdown, plugin disable, shutdown and broken-plugin report tests on throwaway Paper 26.1.2, 26.2 and 26.3 servers, using a protocol bot for logins. It's Paper-only, so it won't load on Spigot. The upgrade tool passed live checks, apply and restore on made-up servers on the same three versions. A real plugin stack hasn't been tested.
**Status:** early, version 0.3.1. It needs Minecraft 26.1 or newer and Java 25; 1.21 isn't supported. It has passed clean runs, lockdown, plugin disable, shutdown and broken-plugin report tests on throwaway Paper 26.1.2, 26.2 and 26.3 servers, using a protocol bot for logins. It's Paper-only, so it won't load on Spigot. The upgrade tool passed live checks, apply and restore on made-up servers on the same three versions. A real plugin stack hasn't been tested.

## What it does

Expand All @@ -16,7 +16,7 @@ Built-in tests check that every installed plugin enabled and that every plugin j

## Install

Download `Preflight-0.3.0.jar` from [Releases](https://github.com/ExtantApe/Preflight/releases), put it in your server's `plugins/` folder and restart. Paper 26.1 or newer and Java 25 are required.
Download `Preflight-0.3.1.jar` from [Releases](https://github.com/ExtantApe/Preflight/releases), put it in your server's `plugins/` folder and restart. Paper 26.1 or newer and Java 25 are required.

## Build

Expand Down Expand Up @@ -101,10 +101,10 @@ The report also lists every plugin with its state, jar file, dependencies, faile

## Upgrade to a new Minecraft version

`preflight-upgrade-0.3.0.jar`, on the same release page, is a command-line tool for a version upgrade. It boots a throwaway copy of your server on the new Paper jar with Preflight, then lists the plugins that won't start there and everything that needs them. With your yes, it switches them off on the real server, which must be stopped, after a restore point. It can switch each one back on later. It never deletes a jar: it renames it to `.jar.disabled`.
`preflight-upgrade-0.3.1.jar`, on the same release page, is a command-line tool for a version upgrade. It boots a throwaway copy of your server on the new Paper jar with Preflight, then lists the plugins that won't start there and everything that needs them. With your yes, it switches them off on the real server, which must be stopped, after a restore point. It can switch each one back on later. It never deletes a jar: it renames it to `.jar.disabled`.

```bash
java -jar preflight-upgrade-0.3.0.jar check --server /path/to/server --paper paper-26.3-244.jar
java -jar preflight-upgrade-0.3.1.jar check --server /path/to/server --paper paper-26.3-244.jar
```

You don't need Preflight installed on the server to use it. Some details:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subprojects {
apply(plugin = "java")

group = "com.extantape"
version = "0.3.0"
version = "0.3.1"

repositories {
mavenCentral()
Expand Down
5 changes: 5 additions & 0 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Kept by this repo's owning session (Minecraft: Plugins Lead), per `~/Code/CLAUDE.md`, "Test self-audits". Newest first.

## 2026-11-23: the server app's new folder name (0.3.1)
- Promises: a check's copy leaves out the server app's own folder, so the copy never carries the app's state or claims its backups. The app is being renamed, so both folder names are skipped.
- Covered: FlowTest's copy test now creates `.leafjuice/` and `.gilamonster/` with a file in each and checks neither is copied, next to the existing logs, session.lock, restore-point and exclude checks.
- Gaps skipped (and why): no live rerun; the change is one entry in a fixed skip list, and the copy test runs the same code path as a live check.

## 2026-11-11: preflight-upgrade's live checks, in the repo

The first upgrade live checks ran from a scratch folder that's gone, so nobody could rerun them. `test/live/upgrade.mjs` replaces them. It runs the released CLI jar against a made-up server folder that a real Paper jar booted once to make its worlds, and lets the tool boot its own copies. Everything lives in a fresh temp folder, which an exit handler deletes, pass or fail. Four test-only plugins, built from `test/live/upgrade-fixtures`, fail in different ways: `PfBadApi` (api-version 99.0), `PfNoMain` (a main class the jar lacks), `PfNeedsBad` (`depend` on PfBadApi) and `PfChainEnd` (`paper-plugin.yml`, requires PfNeedsBad). `test/live/HoldLock.java` holds a world's `session.lock` the way a running server does.
Expand Down
16 changes: 8 additions & 8 deletions docs/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Preflight pass means a plugin starts, not that it works. Try the important one
## Check

```bash
java -jar preflight-upgrade-0.3.0.jar check --server /path/to/server --paper /path/to/paper-26.3-244.jar
java -jar preflight-upgrade-0.3.1.jar check --server /path/to/server --paper /path/to/paper-26.3-244.jar
```

1. Copies the server to a folder next to it, named `<server>.preflight-check-<time>`. A different place can be set with `--work-dir`. Logs, old-version caches and this tool's own files are left out. Links are copied as real files, so the copy can never open the real worlds.
Expand Down Expand Up @@ -58,8 +58,8 @@ It stops without a plan, and says why, when:
## Apply

```bash
java -jar preflight-upgrade-0.3.0.jar check --server /path/to/server --paper paper.jar --json > plan.json
java -jar preflight-upgrade-0.3.0.jar apply --server /path/to/server --plan plan.json
java -jar preflight-upgrade-0.3.1.jar check --server /path/to/server --paper paper.jar --json > plan.json
java -jar preflight-upgrade-0.3.1.jar apply --server /path/to/server --plan plan.json
```

It shows what it will switch off and asks you to type `yes`. `--yes` skips the question, for a tool that has already asked a person. Without a terminal and without `--yes`, it refuses. It refuses, with nothing changed, when:
Expand All @@ -77,16 +77,16 @@ The restore point covers only plugin jars. **Worlds aren't backed up by this too
## Restore

```bash
java -jar preflight-upgrade-0.3.0.jar restore --server /path/to/server --plugin Name
java -jar preflight-upgrade-0.3.0.jar restore --server /path/to/server --all
java -jar preflight-upgrade-0.3.1.jar restore --server /path/to/server --plugin Name
java -jar preflight-upgrade-0.3.1.jar restore --server /path/to/server --all
```

Switches plugins this tool switched off back on, one at a time, only while the server is stopped. Names match ignoring case. If a jar with the same name is already back in `plugins/`, for example a newer version you installed, that plugin is left as it is and says so. Nothing is overwritten.

## Status

```bash
java -jar preflight-upgrade-0.3.0.jar status --server /path/to/server [--json]
java -jar preflight-upgrade-0.3.1.jar status --server /path/to/server [--json]
```

Shows whether the server is running, what this tool has switched off and why, and the restore points.
Expand Down Expand Up @@ -123,7 +123,7 @@ Everything the tool keeps is plain text or a plain zip, under `<server>/plugins/
```json
{
"format": 1,
"tool": "0.3.0",
"tool": "0.3.1",
"server": "/absolute/path/to/server",
"checkedAt": "2026-11-08T16:00:00Z",
"target": {"file": "paper-26.3-244.jar", "brand": "Paper", "minecraft": "26.3", "build": 244, "version": "26.3-244-35a2d15 (MC: 26.3)"},
Expand All @@ -133,7 +133,7 @@ Everything the tool keeps is plain text or a plain zip, under `<server>/plugins/
"notChecked": [{"name": "DiscordSRV", "why": "Off in the test copy, so it can't reach anything outside. It wasn't checked."}],
"warnings": ["…"],
"recheck": [{"plugin": "…", "note": "…"}],
"preflight": {"version": "0.3.0", "onFailure": "WARN", "serverChecks": "passed"}
"preflight": {"version": "0.3.1", "onFailure": "WARN", "serverChecks": "passed"}
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
* be running. The copy is deleted afterwards, unless the caller made it.
*/
final class Check {
/** Paths left out of the copy: logs, caches for the old version, and this tool's own state. */
/** Paths left out of the copy: logs, caches for the old version, the server app's folder under its old and new names, and this tool's own state. */
static final List<String> SKIPPED = List.of(
"logs", "crash-reports", "cache", "versions", ".leafjuice", "plugins/.paper-remapped",
"logs", "crash-reports", "cache", "versions", ".leafjuice", ".gilamonster", "plugins/.paper-remapped",
"plugins/Preflight/upgrade", "plugins/Preflight/report.xml", "plugins/Preflight/report.xml.partial");
static final String MARKER = ".preflight-upgrade-copy";
private static final long SPARE_BYTES = 2L * 1024 * 1024 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ void madeUpServer() throws IOException {
Files.writeString(server.resolve("world/session.lock"), "");
Files.createDirectories(server.resolve("logs"));
Files.writeString(server.resolve("logs/latest.log"), "old log");
for (String app : List.of(".leafjuice", ".gilamonster")) {
Files.createDirectories(server.resolve(app));
Files.writeString(server.resolve(app + "/server.json"), "{}");
}
for (String jar : List.of("MadeUpCore.jar", "BrokenThing-2.jar", "NeedsBroken.jar", "NeedsNeeds.jar",
"FailsSmoke.jar", "WarnsOnly.jar", "SoftOnBroken.jar")) {
pluginJar(plugins.resolve(jar), "plugin.yml", "name: " + jar.replace(".jar", "").replace("-2", "") + "\nversion: 1\n");
Expand Down Expand Up @@ -127,6 +131,8 @@ void ownCopyLeavesOutLogsLocksAndState() throws Exception {
assertTrue(Files.exists(copy.resolve(Check.MARKER)));
assertFalse(Files.exists(copy.resolve("logs")), "no old logs, so Preflight reads only this boot's");
assertFalse(Files.exists(copy.resolve("world/session.lock")));
assertFalse(Files.exists(copy.resolve(".leafjuice")), "not the server app's folder (old name)");
assertFalse(Files.exists(copy.resolve(".gilamonster")), "not the server app's folder (new name)");
assertFalse(Files.exists(copy.resolve(Switcher.STATE_DIR)), "not this tool's own restore points");
assertFalse(Files.exists(copy.resolve("backups")), "nor anything excluded");
assertEquals(copy.getParent().toRealPath(), work.toRealPath());
Expand Down
Loading