mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Add release channels as instance version targets
An instance's factorio.version can now target a release channel such as "stable" or "experimental" (any key from factorio.com/api/latest-releases) in addition to "latest" and specific X.Y / X.Y.Z versions. The controller proxies the latest-releases API through a ValueCache and persists the last successful response to latest-releases.json, serving that copy when the API is unreachable. On instance start the host resolves a channel to the concrete version it points to and feeds it into the existing checkForUpdates/findVersion path, so a channel auto-installs and runs like a pinned version. The version selector in the web UI lists the available channels alongside "latest". Also clarifies the host log/error when a newer version cannot be downloaded automatically because the host uses a direct (single-version) Factorio install rather than a versioned directory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a274fe74e1
commit
9da48d5387
15 files changed
+226
-13
No files matched your search
+6
-2
@@ -62,7 +62,11 @@ describe("host/server", function() {
|
||||
let installDir = path.join("test", "file", "factorio", "0.1.1");
|
||||
await assert.rejects(
|
||||
hostServer._findVersion(installDir, "0.1.2"),
|
||||
new Error("Unable to find Factorio version 0.1.2")
|
||||
new Error(
|
||||
`Unable to find Factorio version 0.1.2: ${installDir} is a direct (single-version) ` +
|
||||
`install of 0.1.1. Use a versioned layout, where ${installDir} contains a subdirectory ` +
|
||||
"per version, to run other versions or download them automatically."
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -433,7 +437,7 @@ describe("host/server", function() {
|
||||
|
||||
assert.equal(fetchCalledWith, null);
|
||||
assert.ok(logLine !== null);
|
||||
assert.ok(logLine.endsWith("but must be manually downloaded"));
|
||||
assert.ok(logLine.endsWith("(automatic downloads are only supported on Linux)."));
|
||||
});
|
||||
it("should do attempt to download on linux", async function() {
|
||||
let logLine = null;
|
||||
|
||||
@@ -203,7 +203,7 @@ describe("lib/config/definitions/validators", function() {
|
||||
// invalid case
|
||||
assert.throws(
|
||||
() => config.set("factorio.version", "invalidValue"),
|
||||
/Value must be be 'latest', or match X.Y, or match X.Y.Z/
|
||||
/Value must be 'latest', a release channel, or match X.Y or X.Y.Z/
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user