@gonovus-ai/spec-flow-cli 2.2.0 → 2.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 +2 -2
- package/dist/cli.js +69 -13
- package/dist/cli.js.map +1 -1
- package/dist/generated/work-item-subtask-cascade.d.ts +163 -0
- package/dist/generated/work-item-subtask-cascade.js +204 -0
- package/dist/generated/work-item-subtask-cascade.js.map +1 -0
- package/dist/work-item-subtask-cascade.d.ts +54 -0
- package/dist/work-item-subtask-cascade.js +184 -0
- package/dist/work-item-subtask-cascade.js.map +1 -0
- package/guides/work-items.md +32 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ seven-day Better Auth CLI Session. It supports the Node.js 24 runtime line;
|
|
|
39
39
|
Node.js 22 and unverified future major versions are intentionally unsupported.
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npm install --global @gonovus-ai/spec-flow-cli@2.
|
|
42
|
+
npm install --global @gonovus-ai/spec-flow-cli@2.3.0
|
|
43
43
|
specflow auth login
|
|
44
44
|
specflow auth status
|
|
45
45
|
specflow auth logout
|
|
@@ -98,7 +98,7 @@ review in the Web application, and publishing waits until then (`REVIEW_PENDING`
|
|
|
98
98
|
|
|
99
99
|
## Versions
|
|
100
100
|
|
|
101
|
-
CLI 2.
|
|
101
|
+
CLI 2.3.0 plans deliveries as Workspace Versions (ADR 0177). `specflow version` alone
|
|
102
102
|
still checks compatibility; its subcommands manage Versions (`specflow guide versions`):
|
|
103
103
|
|
|
104
104
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -32,6 +32,7 @@ import { registerWorkItemDeliveryCommands } from "./work-item-delivery-commands.
|
|
|
32
32
|
import { readWorkItemImportFile } from "./work-item-exchange-file.js";
|
|
33
33
|
import { registerWorkItemQueryCommands } from "./work-item-query-commands.js";
|
|
34
34
|
import { registerWorkItemResourceLinkCommands } from "./work-item-resource-link-commands.js";
|
|
35
|
+
import { moveWithSubtasks, subtaskCascadeHint } from "./work-item-subtask-cascade.js";
|
|
35
36
|
import { registerWorkItemThreadCommands } from "./work-item-thread-commands.js";
|
|
36
37
|
import { registerWorkItemWatcherCommands } from "./work-item-watcher-commands.js";
|
|
37
38
|
export function formatResourceDiagnostic(message) {
|
|
@@ -2709,28 +2710,63 @@ export async function runCli(arguments_, originalDependencies) {
|
|
|
2709
2710
|
.requiredOption("--expected-version <expectedVersion>", "Opaque version returned by SpecFlow", parseOpaqueVersion)
|
|
2710
2711
|
.requiredOption("--status <status>", "Destination Workflow Column slug or virtual status")
|
|
2711
2712
|
.option("--position <position>", "Board index inside the destination column", parseBoardPosition)
|
|
2713
|
+
.option("--with-subtasks", "When the destination is completed or canceled, also move every unfinished subtask (any depth) you may update into its own Project's matching status, in one atomic command")
|
|
2712
2714
|
.action(async (options) => {
|
|
2713
2715
|
if (hasWorkspaceReadToken(dependencies.environment)) {
|
|
2714
2716
|
exitCode = rejectTokenWrite(dependencies);
|
|
2715
2717
|
return;
|
|
2716
2718
|
}
|
|
2719
|
+
if (options.withSubtasks === true && options.position !== undefined) {
|
|
2720
|
+
writeSkillError(dependencies, {
|
|
2721
|
+
message: "--position cannot be combined with --with-subtasks",
|
|
2722
|
+
reason: "Invalid Operation",
|
|
2723
|
+
retryable: false,
|
|
2724
|
+
});
|
|
2725
|
+
exitCode = 1;
|
|
2726
|
+
return;
|
|
2727
|
+
}
|
|
2717
2728
|
const idempotencyKey = randomUUID();
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2729
|
+
if (options.withSubtasks === true) {
|
|
2730
|
+
exitCode = await run((client) => moveWithSubtasks(client, {
|
|
2731
|
+
expectedVersion: options.expectedVersion,
|
|
2732
|
+
idempotencyKey,
|
|
2733
|
+
projectId: options.projectId,
|
|
2721
2734
|
status: options.status,
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2735
|
+
workItemId: options.workItemId,
|
|
2736
|
+
}), {
|
|
2737
|
+
ambiguousOutcomeMessage: "Work Item move outcome is unknown; read the Work Item and its subtasks before retrying",
|
|
2738
|
+
retryTransportOnce: true,
|
|
2739
|
+
});
|
|
2740
|
+
return;
|
|
2741
|
+
}
|
|
2742
|
+
exitCode = await run(async (client) => {
|
|
2743
|
+
const moved = await client.POST("/v1/projects/{projectId}/work-items/{workItemId}/move", {
|
|
2744
|
+
body: {
|
|
2745
|
+
...(options.position === undefined ? {} : { position: options.position }),
|
|
2746
|
+
status: options.status,
|
|
2727
2747
|
},
|
|
2728
|
-
|
|
2748
|
+
params: {
|
|
2749
|
+
header: {
|
|
2750
|
+
"idempotency-key": idempotencyKey,
|
|
2751
|
+
"if-match": options.expectedVersion,
|
|
2752
|
+
},
|
|
2753
|
+
path: {
|
|
2754
|
+
projectId: options.projectId,
|
|
2755
|
+
workItemId: options.workItemId,
|
|
2756
|
+
},
|
|
2757
|
+
},
|
|
2758
|
+
});
|
|
2759
|
+
if (moved.data !== undefined) {
|
|
2760
|
+
const hint = await subtaskCascadeHint(client, {
|
|
2729
2761
|
projectId: options.projectId,
|
|
2762
|
+
status: options.status,
|
|
2730
2763
|
workItemId: options.workItemId,
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
|
-
|
|
2764
|
+
});
|
|
2765
|
+
if (hint !== null)
|
|
2766
|
+
dependencies.stderr(formatResourceDiagnostic(hint));
|
|
2767
|
+
}
|
|
2768
|
+
return moved;
|
|
2769
|
+
}, {
|
|
2734
2770
|
ambiguousOutcomeMessage: "Work Item move outcome is unknown; read the Work Item board before retrying",
|
|
2735
2771
|
retryTransportOnce: true,
|
|
2736
2772
|
});
|
|
@@ -2769,6 +2805,7 @@ export async function runCli(arguments_, originalDependencies) {
|
|
|
2769
2805
|
.requiredOption("--work-item-id <workItemId>")
|
|
2770
2806
|
.requiredOption("--expected-version <expectedVersion>", "Opaque version returned by SpecFlow", parseOpaqueVersion)
|
|
2771
2807
|
.description("Move a Work Item into the Project's first final Workflow Column")
|
|
2808
|
+
.option("--with-subtasks", "Also complete every unfinished subtask (any depth) you may update, in one atomic command")
|
|
2772
2809
|
.action(async (options) => {
|
|
2773
2810
|
if (hasWorkspaceReadToken(dependencies.environment)) {
|
|
2774
2811
|
exitCode = rejectTokenWrite(dependencies);
|
|
@@ -2792,7 +2829,15 @@ export async function runCli(arguments_, originalDependencies) {
|
|
|
2792
2829
|
response: new Response(null, { status: 422 }),
|
|
2793
2830
|
};
|
|
2794
2831
|
}
|
|
2795
|
-
|
|
2832
|
+
if (options.withSubtasks === true)
|
|
2833
|
+
return await moveWithSubtasks(client, {
|
|
2834
|
+
expectedVersion: options.expectedVersion,
|
|
2835
|
+
idempotencyKey,
|
|
2836
|
+
projectId: options.projectId,
|
|
2837
|
+
status: finalColumn.slug,
|
|
2838
|
+
workItemId: options.workItemId,
|
|
2839
|
+
});
|
|
2840
|
+
const moved = await client.POST("/v1/projects/{projectId}/work-items/{workItemId}/move", {
|
|
2796
2841
|
body: { status: finalColumn.slug },
|
|
2797
2842
|
params: {
|
|
2798
2843
|
header: {
|
|
@@ -2805,6 +2850,17 @@ export async function runCli(arguments_, originalDependencies) {
|
|
|
2805
2850
|
},
|
|
2806
2851
|
},
|
|
2807
2852
|
});
|
|
2853
|
+
if (moved.data !== undefined) {
|
|
2854
|
+
const hint = await subtaskCascadeHint(client, {
|
|
2855
|
+
columns: board.data?.workflowColumns,
|
|
2856
|
+
projectId: options.projectId,
|
|
2857
|
+
status: finalColumn.slug,
|
|
2858
|
+
workItemId: options.workItemId,
|
|
2859
|
+
});
|
|
2860
|
+
if (hint !== null)
|
|
2861
|
+
dependencies.stderr(formatResourceDiagnostic(hint));
|
|
2862
|
+
}
|
|
2863
|
+
return moved;
|
|
2808
2864
|
}, {
|
|
2809
2865
|
ambiguousOutcomeMessage: "Work Item completion outcome is unknown; read the Work Item board before retrying",
|
|
2810
2866
|
retryTransportOnce: true,
|