@clipboard-health/groundcrew 4.3.2 → 4.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeback.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/writeback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,wBAAwB;IAChC,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE;IACzD,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"writeback.d.ts","sourceRoot":"","sources":["../../../../src/lib/adapters/linear/writeback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,UAAU,oBAAoB;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,wBAAwB;IAChC,cAAc,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,wBAAgB,8BAA8B,CAAC,UAAU,EAAE;IACzD,MAAM,EAAE,YAAY,CAAC;CACtB,GAAG,wBAAwB,CAuD3B"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { log } from "../../util.js";
|
|
2
2
|
export function createLinearIssueStatusUpdater(arguments_) {
|
|
3
3
|
const { client } = arguments_;
|
|
4
|
-
// Positive cache only. Keyed by teamId because the
|
|
5
|
-
//
|
|
4
|
+
// Positive cache only. Keyed by teamId because the in-progress-state
|
|
5
|
+
// resolution yields a single stateId per team — independent of which
|
|
6
6
|
// project the ticket belongs to. State ids don't change for misconfig
|
|
7
7
|
// reasons, so caching successful resolutions is safe across the process.
|
|
8
8
|
//
|
|
@@ -23,10 +23,16 @@ export function createLinearIssueStatusUpdater(arguments_) {
|
|
|
23
23
|
}
|
|
24
24
|
const team = await client.team(teamId);
|
|
25
25
|
const states = await team.states();
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
|
|
26
|
+
// Linear's default workflow has MULTIPLE `started`-type states — both
|
|
27
|
+
// "In Progress" and "In Review" are `started`. `team.states()` orders by
|
|
28
|
+
// updatedAt (the connection has no position ordering), so array order
|
|
29
|
+
// can't disambiguate them. Prefer the state literally named "In Progress";
|
|
30
|
+
// otherwise fall back to the lowest-position (leftmost) `started` column,
|
|
31
|
+
// which by Linear convention is the in-progress one. This survives teams
|
|
32
|
+
// that rename the column ("Doing", "WIP", ...).
|
|
33
|
+
const startedStates = states.nodes.filter((state) => state.type === "started");
|
|
34
|
+
const inProgress = startedStates.find((state) => state.name.trim().toLowerCase() === "in progress") ??
|
|
35
|
+
startedStates.toSorted((a, b) => a.position - b.position).at(0);
|
|
30
36
|
if (inProgress?.id === undefined) {
|
|
31
37
|
return undefined;
|
|
32
38
|
}
|
package/package.json
CHANGED