Skip to content

Commit

Permalink
frontend/cocalc.com: add "Ubuntu 24.04 (Testing)" option
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldschilly committed Dec 2, 2024
1 parent 783327a commit 403e586
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/packages/util/compute-images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FALLBACK_SOFTWARE_ENV } from "./compute-images";

test("fallback name exists", () => {
expect(
FALLBACK_SOFTWARE_ENV.environments[FALLBACK_SOFTWARE_ENV.default]
FALLBACK_SOFTWARE_ENV.environments[FALLBACK_SOFTWARE_ENV.default],
).toBeDefined();
});

Expand All @@ -21,7 +21,7 @@ test("consistent naming", () => {
switch (group) {
case "Main":
expect(
["default", "ubuntu2004", "ubuntu2204", "ubuntu1804"].includes(base)
["default", "ubuntu2004", "ubuntu2204", "ubuntu1804"].includes(base),
).toBe(true);
break;

Expand Down Expand Up @@ -56,9 +56,18 @@ test("consistent naming", () => {
}
break;

case "Ubuntu 24.04":
expect(["ubuntu2404", "exp"].includes(base)).toBe(true);
expect(title?.indexOf(ts) ?? 0 > 0);
if (ts === "dev" || ts === "previous") {
} else if (base === "ubuntu2404") {
expect(ts.startsWith(short ?? "")).toBe(true);
}
break;

default:
expect(
["stable", "old", "exp", "previous", "default", ""].includes(base)
["stable", "old", "exp", "previous", "default", ""].includes(base),
).toBe(true);
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/packages/util/compute-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const DEFAULT_COMPUTE_IMAGE = schema.DEFAULT_COMPUTE_IMAGE;
// this array defines their ordering
const GROUPS = [
"Main",
"Ubuntu 24.04",
"Ubuntu 22.04",
"Ubuntu 20.04",
"Ubuntu 18.04",
Expand All @@ -33,6 +34,8 @@ export const DISMISS_IMG_2004 = "ubuntu2004-eol";
export const UBUNTU2004_DEPRECATED = "ubuntu2004";
export const UBUNTU2004_DEV = "ubuntu2004-dev";
export const UBUNTU2204_DEV = "ubuntu2204-dev";
// new Ubuntu 24.04 image, for development
export const UBUNTU2404_DEV = "ubuntu2404-dev";

export interface ComputeImage {
id: string; // the key under which it is stored in the database
Expand Down Expand Up @@ -64,6 +67,12 @@ const COMPUTE_IMAGES: { [key: string]: ComputeImageProd } = {
descr: "Ubuntu 22.04 based software stack, regularly updated",
group: "Main",
},
[UBUNTU2404_DEV]: {
title: "Ubuntu 24.04 (Testing)",
short: "Ubuntu 24.04 (Testing)",
descr: "Upcoming Ubuntu 24.04 based software stack",
group: "Ubuntu 24.04",
},
[UBUNTU2204_DEV]: {
title: "Ubuntu 22.04 (Testing)",
short: "Ubuntu 22.04 (Testing)",
Expand Down

0 comments on commit 403e586

Please sign in to comment.