@boxxy/train 0.2.12 → 0.3.0
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/README.md +3 -4
- package/package.json +2 -2
- package/src/decide-merge.ts +2 -6
package/README.md
CHANGED
|
@@ -20,10 +20,9 @@ that is ready to merge. The server reads the pull request and calls `decideMerge
|
|
|
20
20
|
- wait, and read the pull request again later;
|
|
21
21
|
- merge the pull request at the head commit the server read.
|
|
22
22
|
|
|
23
|
-
The server merges only when boxxy's review passed, every required check
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
soon.
|
|
23
|
+
The server merges only when boxxy's review passed, every required check of the base branch passed,
|
|
24
|
+
all at that head commit. The package does no I/O: the server passes in what it read, the merge
|
|
25
|
+
rules, the time, and the last merge it asked for, so that `decideMerge` does not ask again too soon.
|
|
27
26
|
|
|
28
27
|
The package is named for the merge train, a later rule that would merge several pull requests at
|
|
29
28
|
once. Its [design](../../docs/design/boxxy/merge-train.md) is not built.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boxxy/train",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "boxxy's merge rule: decides each read of a merge from the pull request, its checks, its review and its verify reading",
|
|
5
5
|
"homepage": "https://github.com/zgeoff/boxxy/tree/main/modules/train#readme",
|
|
6
6
|
"bugs": "https://github.com/zgeoff/boxxy/issues",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"typecheck": "tsrs --noEmit"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@boxxy/model": "0.
|
|
33
|
+
"@boxxy/model": "0.3.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@faker-js/faker": "10.6.0"
|
package/src/decide-merge.ts
CHANGED
|
@@ -13,7 +13,8 @@ import type { DecideMergeInput } from './types.ts';
|
|
|
13
13
|
const minuteMs = 60_000;
|
|
14
14
|
|
|
15
15
|
// The merge rule: one step for each read of a merge attempt. It checks the rows of the merge
|
|
16
|
-
// table from the top, and the first match wins.
|
|
16
|
+
// table from the top, and the first match wins. A merge needs a passed review at the head and
|
|
17
|
+
// every required check green; the base branch's own rules say which checks those are.
|
|
17
18
|
export function decideMerge(input: DecideMergeInput): JobStep {
|
|
18
19
|
const observed = input.observed;
|
|
19
20
|
|
|
@@ -67,11 +68,6 @@ export function decideMerge(input: DecideMergeInput): JobStep {
|
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
// a rules file without the verify gate in its checks must still never merge an unverified head
|
|
71
|
-
if (observed.verify.status !== 'verified') {
|
|
72
|
-
return finish('unverified');
|
|
73
|
-
}
|
|
74
|
-
|
|
75
71
|
const sent = input.acted?.head === observed.head ? input.acted : null;
|
|
76
72
|
|
|
77
73
|
if (sent?.answer?.kind === 'not-mergeable') {
|