next-issue 0.12.2 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.mjs +6 -7
- package/dist/pipeline.mjs +0 -1
- package/dist/state.mjs +1 -3
- package/package.json +1 -1
package/dist/config.mjs
CHANGED
|
@@ -26,6 +26,9 @@ const DEFAULTS = {
|
|
|
26
26
|
skip: "status:blocked",
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
|
+
function defaults() {
|
|
30
|
+
return { ...DEFAULTS, models: { ...DEFAULTS.models }, labels: { ...DEFAULTS.labels } };
|
|
31
|
+
}
|
|
29
32
|
const FIELDS = [...Object.keys(DEFAULTS), "setupCommand"];
|
|
30
33
|
const WHOLE_FIELDS = [
|
|
31
34
|
["issueLimit", 1],
|
|
@@ -44,7 +47,7 @@ const WHOLE_FIELDS = [
|
|
|
44
47
|
const MODEL_ROLES = ["implementer", "reviewer", "fixer"];
|
|
45
48
|
const LABEL_NAMES = ["ready", "inProgress", "inReview", "done", "needsHuman", "skip"];
|
|
46
49
|
const FILE_DEFAULTS = {
|
|
47
|
-
...
|
|
50
|
+
...defaults(),
|
|
48
51
|
models: Object.fromEntries(MODEL_ROLES.map((role) => [role, null])),
|
|
49
52
|
};
|
|
50
53
|
export const CONFIG_FILE = "next-issue.config.json";
|
|
@@ -69,7 +72,7 @@ export async function loadConfig(root) {
|
|
|
69
72
|
raw = await readFile(join(root, CONFIG_FILE), "utf8");
|
|
70
73
|
}
|
|
71
74
|
catch {
|
|
72
|
-
return
|
|
75
|
+
return defaults();
|
|
73
76
|
}
|
|
74
77
|
let parsed;
|
|
75
78
|
try {
|
|
@@ -87,11 +90,7 @@ export function parseConfig(value) {
|
|
|
87
90
|
throw new Error(`${CONFIG_FILE} holds an unknown field: ${key}`);
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
|
-
const config =
|
|
91
|
-
...DEFAULTS,
|
|
92
|
-
models: { ...DEFAULTS.models },
|
|
93
|
-
labels: { ...DEFAULTS.labels },
|
|
94
|
-
};
|
|
93
|
+
const config = defaults();
|
|
95
94
|
if (file.remote !== undefined) {
|
|
96
95
|
config.remote = text(file.remote, "remote", false);
|
|
97
96
|
}
|
package/dist/pipeline.mjs
CHANGED
|
@@ -328,7 +328,6 @@ async function cleanUp(context, log, issue) {
|
|
|
328
328
|
}
|
|
329
329
|
async function handOver(context, log, issue, state, reason) {
|
|
330
330
|
log.event("hand-over", { reason }, "quiet");
|
|
331
|
-
state.handedOver = true;
|
|
332
331
|
await writeState(context.repo, state);
|
|
333
332
|
await setStatus(context, issue, state.pr, context.config.labels.needsHuman);
|
|
334
333
|
if (state.pr !== undefined) {
|
package/dist/state.mjs
CHANGED
|
@@ -16,9 +16,7 @@ export async function readState(repo, issue) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
export function resetState(state) {
|
|
19
|
-
|
|
20
|
-
delete next.handedOver;
|
|
21
|
-
return next;
|
|
19
|
+
return { ...state, ciFixes: 0, reviewRounds: 0, reviewLog: [] };
|
|
22
20
|
}
|
|
23
21
|
export async function writeState(repo, state) {
|
|
24
22
|
await mkdir(dir(repo), { recursive: true });
|