@bakers-build/addon-remote-drupal 0.8.1-next.1 → 0.8.1-next.2
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/src/index.d.ts +2 -0
- package/dist/src/index.js +18 -1
- package/package.json +5 -5
package/dist/src/index.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export declare class DrupalBbRemote implements BbRemote {
|
|
|
39
39
|
siteTools?: SiteToolClient;
|
|
40
40
|
constructor(api: JsonApiClient, selection?: BbProjectSelection | undefined, resolvedProjectId?: string | undefined, fetchRunLog?: RunLogFetcher);
|
|
41
41
|
fetchActiveRuns(id: string): Promise<ActiveRun[]>;
|
|
42
|
+
/** Through the site's `bakers_comment_publish`, which throws on a tool error. */
|
|
43
|
+
publishTicketComment(ticketUuid: string, body: string): Promise<void>;
|
|
42
44
|
activeRunCount(id: string): Promise<number>;
|
|
43
45
|
machineCapacity(hostKey: string): Promise<{
|
|
44
46
|
maxParallel: number;
|
package/dist/src/index.js
CHANGED
|
@@ -76,11 +76,18 @@ export class DrupalBbRemote {
|
|
|
76
76
|
.collection('bb_run')
|
|
77
77
|
.where('conductor_id.conductor_id', '=', id)
|
|
78
78
|
.whereIn('state', ACTIVE)
|
|
79
|
-
.fields([
|
|
79
|
+
.fields([
|
|
80
|
+
'state',
|
|
81
|
+
'state_at_start',
|
|
82
|
+
'worktree_path',
|
|
83
|
+
'drupal_internal__id',
|
|
84
|
+
'agent',
|
|
85
|
+
])
|
|
80
86
|
.page(100)
|
|
81
87
|
.list();
|
|
82
88
|
return Promise.all(rows.map(async (r) => ({
|
|
83
89
|
runUuid: r.id,
|
|
90
|
+
runId: Number(r.attr('drupal_internal__id')),
|
|
84
91
|
ticketUuid: r.rel('ticket_id') ?? '',
|
|
85
92
|
ticketIdentifier: await this.getRunTicketIdentifier(r.id),
|
|
86
93
|
branchName: await this.getRunTicketBranchName(r.id),
|
|
@@ -90,6 +97,16 @@ export class DrupalBbRemote {
|
|
|
90
97
|
agent: r.attr('agent') ?? '',
|
|
91
98
|
})));
|
|
92
99
|
}
|
|
100
|
+
/** Through the site's `bakers_comment_publish`, which throws on a tool error. */
|
|
101
|
+
async publishTicketComment(ticketUuid, body) {
|
|
102
|
+
if (!this.siteTools)
|
|
103
|
+
throw new Error('no site tools to publish a comment');
|
|
104
|
+
await this.siteTools.call('bakers_comment_publish', {
|
|
105
|
+
ticket: ticketUuid,
|
|
106
|
+
type: 'comment',
|
|
107
|
+
body,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
93
110
|
async activeRunCount(id) {
|
|
94
111
|
// Filter on the related conductor's registration string field.
|
|
95
112
|
return this.api
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-remote-drupal",
|
|
3
|
-
"version": "0.8.1-next.
|
|
3
|
+
"version": "0.8.1-next.2",
|
|
4
4
|
"description": "bakers.build conductor remote addon: the Drupal/JSON:API control-plane remote.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"dropsh": "^0.8.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@bakers-build/conductor": "^0.8.1-next.
|
|
28
|
-
"@bakers-build/core": "^0.8.1-next.
|
|
29
|
-
"@bakers-build/message": "^0.8.1-next.
|
|
27
|
+
"@bakers-build/conductor": "^0.8.1-next.2",
|
|
28
|
+
"@bakers-build/core": "^0.8.1-next.2",
|
|
29
|
+
"@bakers-build/message": "^0.8.1-next.2"
|
|
30
30
|
},
|
|
31
31
|
"bakersBuild": {
|
|
32
|
-
"commit": "
|
|
32
|
+
"commit": "0177880667693d1c36c65ffced82d2f3a17cbf2a",
|
|
33
33
|
"channel": "next"
|
|
34
34
|
}
|
|
35
35
|
}
|