@goodandready/dsh-kanban 0.2.19 → 0.2.21
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/lib/board-tool.js +18 -48
- package/lib/client.js +85 -176
- package/lib/commands.js +21 -38
- package/lib/config.js +30 -55
- package/lib/cron.js +13 -13
- package/lib/events.js +17 -5
- package/lib/filters.js +58 -82
- package/lib/git-provider.js +23 -23
- package/lib/gitea.js +59 -110
- package/lib/github.js +39 -37
- package/lib/import.js +46 -67
- package/lib/index.js +131 -140
- package/lib/intake.js +18 -26
- package/lib/launcher.js +107 -170
- package/lib/lifecycle.js +11 -17
- package/lib/markdown.js +16 -23
- package/lib/metrics.js +23 -25
- package/lib/order.js +25 -28
- package/lib/outbound.js +28 -28
- package/lib/plan.js +23 -45
- package/lib/power.js +2 -2
- package/lib/progress-dump.js +17 -17
- package/lib/routes.js +92 -145
- package/lib/store.js +68 -77
- package/lib/sync.js +56 -98
- package/lib/time.js +8 -17
- package/lib/transitions.js +44 -61
- package/lib/webhook.js +16 -23
- package/lib/workflow-bridge.js +72 -68
- package/lib/worktree.js +103 -60
- package/package.json +1 -1
package/lib/intake.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Archival of completed tasks and ingestion of new tasks from Gitea.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// рядом дешевле, чем искать по разным углам, почему карточка появилась или
|
|
6
|
-
// пропала.
|
|
3
|
+
// Two complementary concerns in one module: one clears finished tasks from board,
|
|
4
|
+
// the other ingests new ones. Both govern WHAT belongs on the board.
|
|
7
5
|
|
|
8
|
-
/**
|
|
6
|
+
/** Parse repository list from config: comma-separated, ignoring whitespace. */
|
|
9
7
|
export function parseWatchList(value) {
|
|
10
8
|
return String(value ?? '')
|
|
11
9
|
.split(',')
|
|
@@ -14,11 +12,9 @@ export function parseWatchList(value) {
|
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
15
|
+
* Repositories watched explicitly when named.
|
|
18
16
|
*
|
|
19
|
-
*
|
|
20
|
-
* подхвата: там есть Gitea, у которого можно спросить, какие репозитории вообще
|
|
21
|
-
* существуют.
|
|
17
|
+
* Empty list means 'all', handled in intake pass where Gitea query lists all repos.
|
|
22
18
|
*
|
|
23
19
|
* @returns {Array<{owner: string, repo: string}>}
|
|
24
20
|
*/
|
|
@@ -26,8 +22,7 @@ export function watchedRepos({ config, owner }) {
|
|
|
26
22
|
const out = []
|
|
27
23
|
const seen = new Set()
|
|
28
24
|
for (const name of parseWatchList(config?.watchRepos)) {
|
|
29
|
-
//
|
|
30
|
-
// `репо` — тогда владелец берётся общий.
|
|
25
|
+
// Name can be full or short: `owner/repo` or just `repo` using default owner.
|
|
31
26
|
const at = name.indexOf('/')
|
|
32
27
|
const pair = at > 0
|
|
33
28
|
? { owner: name.slice(0, at), repo: name.slice(at + 1) }
|
|
@@ -42,16 +37,15 @@ export function watchedRepos({ config, owner }) {
|
|
|
42
37
|
}
|
|
43
38
|
|
|
44
39
|
/**
|
|
45
|
-
*
|
|
40
|
+
* Whether to create a card for this issue.
|
|
46
41
|
*
|
|
47
|
-
* @returns {{take: boolean, why: string}} `why`
|
|
48
|
-
* иначе «почему этой задачи нет на доске» превращается в гадание.
|
|
42
|
+
* @returns {{take: boolean, why: string}} `why` states reason on rejection.
|
|
49
43
|
*/
|
|
50
44
|
export function shouldTake({ store, owner, repo, issue }) {
|
|
51
45
|
const number = issue?.number
|
|
52
46
|
if (typeof number !== 'number') return { take: false, why: 'missing-number' }
|
|
53
|
-
// Pull request
|
|
54
|
-
//
|
|
47
|
+
// Pull request in Gitea is also an issue, but not a standalone board card:
|
|
48
|
+
// it reflects execution progress, not the task definition.
|
|
55
49
|
if (issue?.pull_request !== undefined && issue?.pull_request !== null) {
|
|
56
50
|
return { take: false, why: 'pull-request-ignored' }
|
|
57
51
|
}
|
|
@@ -66,13 +60,12 @@ export function shouldTake({ store, owner, repo, issue }) {
|
|
|
66
60
|
}
|
|
67
61
|
|
|
68
62
|
/**
|
|
69
|
-
*
|
|
63
|
+
* Whether task is ready for archival.
|
|
70
64
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
65
|
+
* Archived ONLY from `done`. A task stuck in review for a month is an alert,
|
|
66
|
+
* not clutter, and must not be hidden.
|
|
73
67
|
*
|
|
74
|
-
*
|
|
75
|
-
* а не пропущенное значение.
|
|
68
|
+
* Zero in settings disables auto-archival.
|
|
76
69
|
*/
|
|
77
70
|
export function archiveBefore({ now, afterDays }) {
|
|
78
71
|
const days = Number(afterDays)
|
|
@@ -81,11 +74,10 @@ export function archiveBefore({ now, afterDays }) {
|
|
|
81
74
|
}
|
|
82
75
|
|
|
83
76
|
/**
|
|
84
|
-
*
|
|
77
|
+
* Whether given repository is watched.
|
|
85
78
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* что-либо решать.
|
|
79
|
+
* Events outside watched list are ignored: timer does not poll them,
|
|
80
|
+
* so webhooks should not process them either.
|
|
89
81
|
*/
|
|
90
82
|
export function isWatched({ config, owner, defaultOwner, repo }) {
|
|
91
83
|
return watchedRepos({ config, owner: defaultOwner }).some(
|