feat: beta channels for core and plugins with one stable/beta release workflow

This commit is contained in:
LukeGus committed 2026-10-07 16:25:58 -05:00
1 parent 6a855c0fa8
commit f73c4b5ad6
55 files changed
+16200 -460

No files matched your search

+24 -2
View File
@@ -3,6 +3,7 @@ import {
buildIssueUrl,
describeEnvironment,
normalizeGitHubRepo,
reportBetaFeedbackUrl,
reportCoreIssueUrl,
} from "@/lib/issue-url";
@@ -87,10 +88,31 @@ describe("describeEnvironment", () => {
describe("reportCoreIssueUrl", () => {
it("points at the core repo with the version filled in", () => {
const url = new URL(reportCoreIssueUrl("26.10.0", "beta_feedback.yml"));
const url = new URL(reportCoreIssueUrl("26.10.0"));
expect(url.pathname).toBe("/Termix-SSH/Termix/issues/new");
expect(url.searchParams.get("template")).toBe("beta_feedback.yml");
expect(url.searchParams.get("template")).toBe("bug_report.yml");
expect(url.searchParams.get("termix-version")).toBe("26.10.0");
expect(url.searchParams.get("environment")).toBeTruthy();
});
});
describe("reportBetaFeedbackUrl", () => {
it("uses the beta form and lists plugins on a beta", () => {
const url = new URL(
reportBetaFeedbackUrl("26.11.0-beta.2", [
{ id: "docker", version: "1.2.0-beta.1" },
{ id: "tunnels", version: "1.1.0-beta.3" },
]),
);
expect(url.searchParams.get("template")).toBe("beta_feedback.yml");
expect(url.searchParams.get("termix-version")).toBe("26.11.0-beta.2");
expect(url.searchParams.get("beta-plugins")).toBe(
"docker 1.2.0-beta.1\ntunnels 1.1.0-beta.3",
);
});
it("leaves the plugin list out when none are on a beta", () => {
const url = new URL(reportBetaFeedbackUrl("26.11.0-beta.2"));
expect(url.searchParams.has("beta-plugins")).toBe(false);
});
});
+50
View File
@@ -1,6 +1,9 @@
import { describe, expect, it } from "vitest";
import type { PluginSummary, RegistryPluginEntry } from "@/api/plugins-api";
import {
betaFeedbackUrl,
betaToTry,
isPrerelease,
categoriesOf,
describeContributions,
formatBytes,
@@ -416,3 +419,50 @@ describe("youtubeEmbedUrl", () => {
}
});
});
describe("betas", () => {
it("knows a prerelease", () => {
expect(isPrerelease("1.2.0-beta.1")).toBe(true);
expect(isPrerelease("1.2.0")).toBe(false);
expect(isPrerelease(null)).toBe(false);
});
it("offers a beta only when newer than what is installed on stable", () => {
const base = {
installed: true,
version: "1.1.0",
latestBeta: "1.2.0-beta.1",
channel: "stable" as const,
};
expect(betaToTry(base)).toBe("1.2.0-beta.1");
expect(betaToTry({ ...base, channel: "beta" })).toBeNull();
expect(betaToTry({ ...base, version: "1.2.0-beta.1" })).toBeNull();
expect(betaToTry({ ...base, installed: false })).toBeNull();
expect(betaToTry({ ...base, latestBeta: null })).toBeNull();
});
it("sends beta feedback to the plugin's repo", () => {
const url = new URL(
betaFeedbackUrl(
{
id: "docker",
repository: "https://github.com/Termix-SSH/Plugin-Docker",
version: "1.2.0-beta.1",
lastError: null,
},
"26.11.0",
)!,
);
expect(url.pathname).toBe("/Termix-SSH/Plugin-Docker/issues/new");
expect(url.searchParams.get("template")).toBe("beta_feedback.yml");
expect(url.searchParams.get("plugin-version")).toBe("1.2.0-beta.1");
expect(
betaFeedbackUrl({
id: "x",
repository: "https://gitlab.com/a/b",
version: "1.0.0",
lastError: null,
}),
).toBeNull();
});
});