Skip to content

Commit fe89bd4

Browse files
committed
feat: private modifications
1 parent 6826f31 commit fe89bd4

2 files changed

Lines changed: 57 additions & 7 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: check
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, private]
66
pull_request:
77

88
permissions:

shortcut.user.js

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,72 @@ const user = document.querySelector("header.GlobalNav button[data-login]")?.getA
88

99
const repo = user ? `${user}/nixpkgs-review-gha` : null;
1010

11-
const reviewDefaults = ({ title, commits, labels, author, authoredByMe, hasLinuxRebuilds, hasDarwinRebuilds }) => {
12-
const darwinSandbox = "relaxed";
11+
const reviewDefaults = ({
12+
title,
13+
commits,
14+
labels,
15+
author,
16+
authoredByMe,
17+
hasLinuxRebuilds,
18+
hasDarwinRebuilds,
19+
state,
20+
}) => {
21+
const darwinSandboxFalseList = ["miniserve"];
22+
23+
const testMap = [
24+
[["radicle-ci-broker", "radicle-native-ci", "radicle-job", "radicle-node"], "nixosTests.radicle-ci-broker"],
25+
];
26+
const testPackages = [
27+
"alertmanager-ntfy",
28+
"anubis",
29+
"chhoto-url",
30+
"echoip",
31+
"glitchtip",
32+
"go-httpbin",
33+
"olivetin",
34+
"privatebin",
35+
"radicle-httpd",
36+
"radicle-node",
37+
"radicle-node-unstable",
38+
"taplo",
39+
"uiua",
40+
"uiua-unstable",
41+
"whoami",
42+
"zipline",
43+
];
44+
45+
const skipMap = [[["taplo"], "servo"]];
46+
47+
const pkgsChanged = pkgs => pkgs.some(p => commits.some(({ subject }) => subject.startsWith(`${p}:`)));
48+
49+
const extraPkgs = new Set(
50+
testMap
51+
.filter(([pkgs]) => pkgsChanged(pkgs))
52+
.map(([, test]) => test)
53+
.concat(testPackages.filter(pkg => pkgsChanged([pkg])).map(pkg => `${pkg}.tests`)),
54+
);
55+
56+
const skipPkgs = new Set(
57+
skipMap.filter(([pkgs, skip]) => pkgsChanged(pkgs) && !pkgsChanged([skip])).map(([, skip]) => skip),
58+
);
1359

60+
const darwinSandbox = pkgsChanged(darwinSandboxFalseList) ? "false" : "relaxed";
1461
const hasRebuilds = hasLinuxRebuilds || hasDarwinRebuilds;
1562

1663
return {
17-
// "branch": "main",
64+
branch: "private",
1865
"x86_64-linux": !hasRebuilds || hasLinuxRebuilds,
1966
"aarch64-linux": !hasRebuilds || hasLinuxRebuilds,
20-
"x86_64-darwin": !hasRebuilds || hasDarwinRebuilds ? `yes_sandbox_${darwinSandbox}` : "no",
67+
"x86_64-darwin": "no",
2168
"aarch64-darwin": !hasRebuilds || hasDarwinRebuilds ? `yes_sandbox_${darwinSandbox}` : "no",
22-
// "extra-args": "",
69+
"extra-args": [...extraPkgs]
70+
.map(pkg => `-a ${pkg}`)
71+
.concat([...skipPkgs].map(pkg => `--skip-package ${pkg}`))
72+
.join(" "),
2373
// "push-to-cache": true,
2474
// "upterm": false,
2575
// "post-result": true,
26-
// "on-success": "nothing",
76+
"on-success": state === "DRAFT" ? "mark_as_ready" : "nothing",
2777
};
2878
};
2979

0 commit comments

Comments
 (0)