@idea1/cli 1.8.1 → 1.8.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.
- package/README.md +93 -19
- package/dist/commands/approve-pr.js +5 -5
- package/dist/commands/approve-pr.js.map +1 -1
- package/dist/commands/attach-project-item.d.ts.map +1 -1
- package/dist/commands/attach-project-item.js +27 -7
- package/dist/commands/attach-project-item.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +8 -6
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +3 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/integrate.d.ts +13 -0
- package/dist/commands/integrate.d.ts.map +1 -0
- package/dist/commands/integrate.js +128 -0
- package/dist/commands/integrate.js.map +1 -0
- package/dist/commands/ready-for-approval.js +1 -1
- package/dist/commands/ready-for-approval.js.map +1 -1
- package/dist/commands/release.d.ts +4 -0
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +105 -20
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/ship-local-changes.d.ts +8 -0
- package/dist/commands/ship-local-changes.d.ts.map +1 -0
- package/dist/commands/ship-local-changes.js +33 -0
- package/dist/commands/ship-local-changes.js.map +1 -0
- package/dist/commands/start-agent-implementation.d.ts.map +1 -1
- package/dist/commands/start-agent-implementation.js +8 -3
- package/dist/commands/start-agent-implementation.js.map +1 -1
- package/dist/commands/start-project-item.d.ts +27 -0
- package/dist/commands/start-project-item.d.ts.map +1 -0
- package/dist/commands/start-project-item.js +325 -0
- package/dist/commands/start-project-item.js.map +1 -0
- package/dist/commands/start.d.ts +6 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +53 -18
- package/dist/commands/start.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/lib/claude-options.d.ts +3 -2
- package/dist/lib/claude-options.d.ts.map +1 -1
- package/dist/lib/claude-options.js +15 -4
- package/dist/lib/claude-options.js.map +1 -1
- package/dist/lib/settings.d.ts +13 -3
- package/dist/lib/settings.d.ts.map +1 -1
- package/dist/lib/settings.js +12 -3
- package/dist/lib/settings.js.map +1 -1
- package/dist/prompts/platform-prompts.d.ts +1 -0
- package/dist/prompts/platform-prompts.d.ts.map +1 -1
- package/dist/prompts/platform-prompts.js +7 -1
- package/dist/prompts/platform-prompts.js.map +1 -1
- package/dist/services/git.d.ts +34 -13
- package/dist/services/git.d.ts.map +1 -1
- package/dist/services/git.js +75 -39
- package/dist/services/git.js.map +1 -1
- package/dist/services/github.d.ts +15 -0
- package/dist/services/github.d.ts.map +1 -1
- package/dist/services/github.js +47 -0
- package/dist/services/github.js.map +1 -1
- package/dist/services/platform.d.ts +9 -4
- package/dist/services/platform.d.ts.map +1 -1
- package/dist/services/platform.js +10 -5
- package/dist/services/platform.js.map +1 -1
- package/dist/services/setup.d.ts.map +1 -1
- package/dist/services/setup.js +18 -24
- package/dist/services/setup.js.map +1 -1
- package/dist/services/workflow.d.ts +17 -0
- package/dist/services/workflow.d.ts.map +1 -0
- package/dist/services/workflow.js +39 -0
- package/dist/services/workflow.js.map +1 -0
- package/dist/types/index.d.ts +18 -24
- package/dist/types/index.d.ts.map +1 -1
- package/dist/version.d.ts +2 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +3 -2
- package/dist/version.js.map +1 -1
- package/dist/workflow/engine/approval-flow.d.ts +8 -1
- package/dist/workflow/engine/approval-flow.d.ts.map +1 -1
- package/dist/workflow/engine/approval-flow.js +23 -8
- package/dist/workflow/engine/approval-flow.js.map +1 -1
- package/dist/workflow/engine/handlers/agent-implementation.d.ts +2 -1
- package/dist/workflow/engine/handlers/agent-implementation.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/agent-implementation.js +12 -3
- package/dist/workflow/engine/handlers/agent-implementation.js.map +1 -1
- package/dist/workflow/engine/handlers/approve-pr.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/approve-pr.js +11 -5
- package/dist/workflow/engine/handlers/approve-pr.js.map +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.d.ts +2 -1
- package/dist/workflow/engine/handlers/dev-implementation.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.js +10 -2
- package/dist/workflow/engine/handlers/dev-implementation.js.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts +7 -1
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.js +21 -9
- package/dist/workflow/engine/handlers/ready-for-approval.js.map +1 -1
- package/dist/workflow/engine/{release-flow.d.ts → release-engine.d.ts} +77 -6
- package/dist/workflow/engine/release-engine.d.ts.map +1 -0
- package/dist/workflow/engine/{release-flow.js → release-engine.js} +279 -17
- package/dist/workflow/engine/release-engine.js.map +1 -0
- package/dist/workflow/engine/ship-flow.d.ts +87 -0
- package/dist/workflow/engine/ship-flow.d.ts.map +1 -0
- package/dist/workflow/engine/ship-flow.js +227 -0
- package/dist/workflow/engine/ship-flow.js.map +1 -0
- package/dist/workflow/engine/workflow-engine.d.ts +29 -5
- package/dist/workflow/engine/workflow-engine.d.ts.map +1 -1
- package/dist/workflow/engine/workflow-engine.js +87 -23
- package/dist/workflow/engine/workflow-engine.js.map +1 -1
- package/package.json +2 -2
- package/dist/workflow/engine/release-flow.d.ts.map +0 -1
- package/dist/workflow/engine/release-flow.js.map +0 -1
|
@@ -4,18 +4,24 @@ import { projectItemPromptModel, renderAgentImplementationPrompt } from '../../.
|
|
|
4
4
|
import * as git from '../../../services/git.js';
|
|
5
5
|
import * as worktree from '../../../services/worktree.js';
|
|
6
6
|
import { WorkflowStates } from '../../data/workflow-states.js';
|
|
7
|
-
import {
|
|
7
|
+
import { logger } from '../../../lib/logger.js';
|
|
8
|
+
import { isWorkMerged, requireLiveContext, requireWorkingPath } from '../workflow-engine.js';
|
|
8
9
|
/**
|
|
9
10
|
* Entering "Agent Implementation": make sure the branch is checked out locally
|
|
10
11
|
* (worktree or main repo, per the isolation mode), then — once the state is
|
|
11
12
|
* recorded — launch Claude to implement the item with the Agent Implementation
|
|
12
13
|
* prompt, rendered against the item's branch context. This is the only
|
|
13
|
-
* transition that starts code-writing automation.
|
|
14
|
+
* transition that starts code-writing automation. Work that is already merged
|
|
15
|
+
* has no branch to implement on, so re-entering the state then does nothing.
|
|
14
16
|
*/
|
|
15
17
|
export const agentImplementationHandler = {
|
|
16
18
|
state: WorkflowStates.AgentImplementation,
|
|
17
|
-
options: [isolationModeOption, ...claudeSessionOptions,
|
|
19
|
+
options: [isolationModeOption, claudeEntryPointOption, ...claudeSessionOptions, ...claudeEntryPointPromptOptions],
|
|
18
20
|
async prepare(transition) {
|
|
21
|
+
if (isWorkMerged(transition)) {
|
|
22
|
+
logger.dim('The item\'s work is already merged; nothing to do.');
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
19
25
|
const { branchName } = requireLiveContext(transition);
|
|
20
26
|
const isolationMode = resolveIsolationMode(transition.options);
|
|
21
27
|
const { workingPath } = await worktree.ensureBranchEnvironment(isolationMode, branchName);
|
|
@@ -25,6 +31,9 @@ export const agentImplementationHandler = {
|
|
|
25
31
|
}
|
|
26
32
|
},
|
|
27
33
|
async complete(transition) {
|
|
34
|
+
if (isWorkMerged(transition)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
28
37
|
const context = requireLiveContext(transition);
|
|
29
38
|
const workingPath = requireWorkingPath(transition, 'run the implementation session');
|
|
30
39
|
const { permissionMode, model, effort, claudeEntryPointMode, entryPointPrompt } = resolveClaudeSessionOptions(transition.options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-implementation.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/agent-implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,6B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1
|
-
{"version":3,"file":"approve-pr.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/approve-pr.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"approve-pr.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/approve-pr.ts"],"names":[],"mappings":"AAOA,OAAO,EAAoD,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEpH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,EAAE,oBAuD9B,CAAC"}
|
|
@@ -3,9 +3,9 @@ import * as git from '../../../services/git.js';
|
|
|
3
3
|
import * as github from '../../../services/github.js';
|
|
4
4
|
import { WorkflowBranchState } from '../../data/workflow-context.js';
|
|
5
5
|
import { WorkflowStates } from '../../data/workflow-states.js';
|
|
6
|
-
import { cleanUpMergedBranch, mergeAsApprover } from '../approval-flow.js';
|
|
7
|
-
import { confirmApproverIdentity } from '../release-
|
|
8
|
-
import { requireContext, requireLiveContext } from '../workflow-engine.js';
|
|
6
|
+
import { cleanUpMergedBranch, mergeAsApprover, mergeConfirmationOption } from '../approval-flow.js';
|
|
7
|
+
import { confirmApproverIdentity } from '../release-engine.js';
|
|
8
|
+
import { isWorkMerged, requireContext, requireLiveContext } from '../workflow-engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Entering "Approved and Merged": merge the PR. The merge IS the approval - it is performed by
|
|
11
11
|
* the PR's assignee, and GitHub records it as `merged_by` with a timestamp and merge commit
|
|
@@ -20,9 +20,10 @@ import { requireContext, requireLiveContext } from '../workflow-engine.js';
|
|
|
20
20
|
*/
|
|
21
21
|
export const approvePrHandler = {
|
|
22
22
|
state: WorkflowStates.ApprovedAndMerged,
|
|
23
|
+
options: [mergeConfirmationOption],
|
|
23
24
|
async prepare(transition) {
|
|
24
25
|
// The pull request was merged on an earlier pass through this state.
|
|
25
|
-
if (
|
|
26
|
+
if (isWorkMerged(transition)) {
|
|
26
27
|
logger.dim('The branch\'s PR is already merged; nothing to approve.');
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
@@ -43,7 +44,12 @@ export const approvePrHandler = {
|
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
await confirmApproverIdentity(context.branchName);
|
|
46
|
-
await mergeAsApprover({
|
|
47
|
+
await mergeAsApprover({
|
|
48
|
+
branchName: context.branchName,
|
|
49
|
+
baseBranch: context.baseBranch,
|
|
50
|
+
prNumber: prInfo.number,
|
|
51
|
+
confirmed: transition.options[mergeConfirmationOption.longName] === 'true'
|
|
52
|
+
});
|
|
47
53
|
context.branchState = WorkflowBranchState.Merged;
|
|
48
54
|
},
|
|
49
55
|
async complete(transition) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve-pr.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/approve-pr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"approve-pr.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/approve-pr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAA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,UAAU,CAAC,CAAC;QAClD,MAAM,eAAe,CAAC;YACpB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM;YACvB,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,MAAM;SAC3E,CAAC,CAAC;QACH,OAAO,CAAC,WAAW,GAAG,mBAAmB,CAAC,MAAM,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAU;QACvB,MAAM,OAAO,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;QAC3C,MAAM,mBAAmB,CAAC;YACxB,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,UAAU,CAAC,WAAW;SACpC,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,kBAAkB,OAAO,CAAC,UAAU,uCAAuC,CAAC,CAAC;QACzF,MAAM,CAAC,IAAI,CAAC,iBAAiB,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF,CAAC"}
|
|
@@ -3,7 +3,8 @@ import { type WorkflowStateHandler } from '../workflow-engine.js';
|
|
|
3
3
|
* Entering "Dev Implementation": the agent's work is committed and pushed and a
|
|
4
4
|
* PR exists, so a developer can test, clean up and finish the work. Afterwards
|
|
5
5
|
* the worktree is removed when `removeWorktreeAtState` says so. Idempotent: an
|
|
6
|
-
* existing PR is reused
|
|
6
|
+
* existing PR is reused, a clean branch is pushed as it is, and work that is
|
|
7
|
+
* already merged is left as it is.
|
|
7
8
|
*/
|
|
8
9
|
export declare const devImplementationHandler: WorkflowStateHandler;
|
|
9
10
|
//# sourceMappingURL=dev-implementation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-implementation.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/dev-implementation.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"dev-implementation.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/dev-implementation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwD,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAExH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,oBAoCtC,CAAC"}
|
|
@@ -3,16 +3,21 @@ import * as git from '../../../services/git.js';
|
|
|
3
3
|
import * as github from '../../../services/github.js';
|
|
4
4
|
import { removeWorktreeForWorkflowState } from '../../../services/worktree.js';
|
|
5
5
|
import { WorkflowStates } from '../../data/workflow-states.js';
|
|
6
|
-
import { requireLiveContext, requireWorkingPath } from '../workflow-engine.js';
|
|
6
|
+
import { isWorkMerged, requireLiveContext, requireWorkingPath } from '../workflow-engine.js';
|
|
7
7
|
/**
|
|
8
8
|
* Entering "Dev Implementation": the agent's work is committed and pushed and a
|
|
9
9
|
* PR exists, so a developer can test, clean up and finish the work. Afterwards
|
|
10
10
|
* the worktree is removed when `removeWorktreeAtState` says so. Idempotent: an
|
|
11
|
-
* existing PR is reused
|
|
11
|
+
* existing PR is reused, a clean branch is pushed as it is, and work that is
|
|
12
|
+
* already merged is left as it is.
|
|
12
13
|
*/
|
|
13
14
|
export const devImplementationHandler = {
|
|
14
15
|
state: WorkflowStates.DevImplementation,
|
|
15
16
|
async prepare(transition) {
|
|
17
|
+
if (isWorkMerged(transition)) {
|
|
18
|
+
logger.dim('The item\'s work is already merged; nothing to do.');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
16
21
|
const context = requireLiveContext(transition);
|
|
17
22
|
requireWorkingPath(transition, 'commit and push the implementation');
|
|
18
23
|
if (await git.hasUncommittedChanges()) {
|
|
@@ -26,6 +31,9 @@ export const devImplementationHandler = {
|
|
|
26
31
|
}
|
|
27
32
|
},
|
|
28
33
|
async complete(transition) {
|
|
34
|
+
if (isWorkMerged(transition)) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
29
37
|
const { branchName } = requireLiveContext(transition);
|
|
30
38
|
await removeWorktreeForWorkflowState(WorkflowStates.DevImplementation, branchName, transition.projectItemUrl, { checkoutBranchInMainRepo: false });
|
|
31
39
|
logger.newline();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-implementation.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/dev-implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAA6B,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"dev-implementation.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/dev-implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAA6B,MAAM,uBAAuB,CAAC;AAExH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAyB;IAC5D,KAAK,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AAoC,CAAC,CAAC;QACrD,MAAM,CAAC,IAAI,CAAC,0GAA0G,CAAC,CAAC;IAC1H,CAAC;CACF,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import type { CommandOption } from '../../../types/index.js';
|
|
1
2
|
import { type WorkflowStateHandler } from '../workflow-engine.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reviewers requested on the PR. Optional: the assignee is the approver.
|
|
5
|
+
*/
|
|
6
|
+
export declare const reviewersOption: CommandOption;
|
|
2
7
|
/**
|
|
3
8
|
* Entering "Needs Approval for Release": the PR is complete and gets its assignee - the person
|
|
4
9
|
* who will approve it by merging it with `idea1 approve-pr`. The assignee is required: without
|
|
5
10
|
* one the PR has no approver of record (change-management-policy.md clause 2). Reviewers are
|
|
6
11
|
* optional. From here on the branch stays as it is, so the CI/CD run the approval is gated on is
|
|
7
12
|
* the run on the code exactly as it will merge. Afterwards the worktree is removed when
|
|
8
|
-
* `removeWorktreeAtState` says so (this state is the default).
|
|
13
|
+
* `removeWorktreeAtState` says so (this state is the default). Work that is already merged has
|
|
14
|
+
* nothing left to approve, so re-entering the state then does nothing.
|
|
9
15
|
*/
|
|
10
16
|
export declare const readyForApprovalHandler: WorkflowStateHandler;
|
|
11
17
|
//# sourceMappingURL=ready-for-approval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ready-for-approval.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/ready-for-approval.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ready-for-approval.d.ts","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/ready-for-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM7D,OAAO,EAAoC,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,aAM7B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,oBAgDrC,CAAC"}
|
|
@@ -3,14 +3,25 @@ import * as git from '../../../services/git.js';
|
|
|
3
3
|
import { removeWorktreeForWorkflowState } from '../../../services/worktree.js';
|
|
4
4
|
import { WorkflowStates } from '../../data/workflow-states.js';
|
|
5
5
|
import { ensurePrReadyForApproval } from '../approval-flow.js';
|
|
6
|
-
import { requireLiveContext } from '../workflow-engine.js';
|
|
6
|
+
import { isWorkMerged, requireLiveContext } from '../workflow-engine.js';
|
|
7
|
+
/**
|
|
8
|
+
* Reviewers requested on the PR. Optional: the assignee is the approver.
|
|
9
|
+
*/
|
|
10
|
+
export const reviewersOption = {
|
|
11
|
+
longName: 'reviewers',
|
|
12
|
+
shortName: 'r',
|
|
13
|
+
description: 'Who to request a review from - optional, the assignee is the approver (select any number)',
|
|
14
|
+
choices: 'github-members',
|
|
15
|
+
multiSelect: true
|
|
16
|
+
};
|
|
7
17
|
/**
|
|
8
18
|
* Entering "Needs Approval for Release": the PR is complete and gets its assignee - the person
|
|
9
19
|
* who will approve it by merging it with `idea1 approve-pr`. The assignee is required: without
|
|
10
20
|
* one the PR has no approver of record (change-management-policy.md clause 2). Reviewers are
|
|
11
21
|
* optional. From here on the branch stays as it is, so the CI/CD run the approval is gated on is
|
|
12
22
|
* the run on the code exactly as it will merge. Afterwards the worktree is removed when
|
|
13
|
-
* `removeWorktreeAtState` says so (this state is the default).
|
|
23
|
+
* `removeWorktreeAtState` says so (this state is the default). Work that is already merged has
|
|
24
|
+
* nothing left to approve, so re-entering the state then does nothing.
|
|
14
25
|
*/
|
|
15
26
|
export const readyForApprovalHandler = {
|
|
16
27
|
state: WorkflowStates.NeedsApprovalForRelease,
|
|
@@ -22,15 +33,13 @@ export const readyForApprovalHandler = {
|
|
|
22
33
|
choices: 'github-members',
|
|
23
34
|
validate: value => value.trim() ? undefined : 'An assignee is required - the assignee is the approver of record'
|
|
24
35
|
},
|
|
25
|
-
|
|
26
|
-
longName: 'reviewers',
|
|
27
|
-
shortName: 'r',
|
|
28
|
-
description: 'Who to request a review from - optional, the assignee is the approver (select any number)',
|
|
29
|
-
choices: 'github-members',
|
|
30
|
-
multiSelect: true
|
|
31
|
-
}
|
|
36
|
+
reviewersOption
|
|
32
37
|
],
|
|
33
38
|
async prepare(transition) {
|
|
39
|
+
if (isWorkMerged(transition)) {
|
|
40
|
+
logger.dim('The item\'s work is already merged; nothing to do.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
34
43
|
const context = requireLiveContext(transition);
|
|
35
44
|
if (transition.workingPath) {
|
|
36
45
|
await git.ensureBranchUpToDate();
|
|
@@ -46,6 +55,9 @@ export const readyForApprovalHandler = {
|
|
|
46
55
|
context.pullRequestUrl = prInfo.url;
|
|
47
56
|
},
|
|
48
57
|
async complete(transition) {
|
|
58
|
+
if (isWorkMerged(transition)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
49
61
|
const { branchName } = requireLiveContext(transition);
|
|
50
62
|
await removeWorktreeForWorkflowState(WorkflowStates.NeedsApprovalForRelease, branchName, transition.projectItemUrl, { checkoutBranchInMainRepo: false });
|
|
51
63
|
logger.newline();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ready-for-approval.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/ready-for-approval.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ready-for-approval.js","sourceRoot":"","sources":["../../../../src/workflow/engine/handlers/ready-for-approval.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,kBAAkB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AAC,GAAG,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,UAAU;QACvB,IAAI,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,OAAO;QACT,CAAC;QAED,MAAM,EAAE,UAAU,EAAE,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACtD,MAAM,8BAA8B,CAAC,cAAc,CAAC,uBAAuB,EAAE,UAAU,EAAE,UAAU,CAAC,cAAc,EAAE,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzJ,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,qGAAqG,CAAC,CAAC;IACrH,CAAC;CACF,CAAC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import type { CommandOption } from '../../types/index.js';
|
|
1
|
+
import type { CommandOption, VersionedPackage } from '../../types/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* The gated PR sequence
|
|
3
|
+
* The release engine: the gated PR sequence, a PR whose body is the approval chain of the changes it carries, assigned
|
|
4
4
|
* to its approver, merged only once the required CI/CD checks have passed. `idea1 release`
|
|
5
5
|
* (release branch -> main) runs the whole sequence here, including the one sanctioned admin
|
|
6
6
|
* override (change-management-policy.md clause 3) recorded on the PR before any merge happens.
|
|
7
7
|
* `idea1 ready-for-approval` opens a stage-1 change PR with the same kind of body for a branch
|
|
8
8
|
* that has no project item (see approval-flow.ts).
|
|
9
|
+
*
|
|
10
|
+
* A release's version bumps land on the release branch before its PR is opened, so the PR's head,
|
|
11
|
+
* and the one CI/CD run the release is gated on, already carry them. The packages that changed since
|
|
12
|
+
* the last release are detected here, and this engine makes the bump itself: it edits each package's
|
|
13
|
+
* `package.json` and the lockfiles above it in the local checkout, commits the edit as one
|
|
14
|
+
* `chore: bump ...` commit, and pushes it. The repository only declares which folders are candidates
|
|
15
|
+
* (`release.versionedPackages` in `.idea1/settings.json`); no script or workflow is involved.
|
|
16
|
+
*
|
|
17
|
+
* The platform's `ReleaseEngine` (backend-core/applicationlayer/workflow) runs the same release
|
|
18
|
+
* sequence from the web app and writes the same PR and the same bump commit, by making the same edits
|
|
19
|
+
* to the same files and committing them through the GitHub API instead of a local checkout, so a
|
|
20
|
+
* release cut on either side reads the same. Keep the two in step.
|
|
9
21
|
*/
|
|
10
22
|
/** Which command opened the PR; shapes the PR body and the override record. */
|
|
11
23
|
export interface GatedPrKind {
|
|
@@ -28,7 +40,8 @@ export type PrMode = 'create' | 'merge';
|
|
|
28
40
|
/**
|
|
29
41
|
* The `--pr-mode` option of `idea1 release`. `create` is the default: the PR is opened and the
|
|
30
42
|
* approver merges it in GitHub once the required checks are green - that merge is the approval of
|
|
31
|
-
* record, exactly as in `merge` mode, where the CLI
|
|
43
|
+
* record, exactly as in `merge` mode, where the CLI turns on GitHub's auto-merge on the approver's
|
|
44
|
+
* behalf (or, where GitHub can't auto-merge, waits for the checks and merges here).
|
|
32
45
|
*/
|
|
33
46
|
export declare const PR_MODE_OPTION: CommandOption;
|
|
34
47
|
/** The first line of the comment that records an admin override; the evidence script keys on it. */
|
|
@@ -40,11 +53,46 @@ export declare const OVERRIDE_COMMENT_MARKER = "**Change-management exception: m
|
|
|
40
53
|
* the two separately.
|
|
41
54
|
*/
|
|
42
55
|
export declare const UNAPPROVED_COMMITS_COMMENT_MARKER = "**Change-management exception: released with commits that had no pull request.**";
|
|
56
|
+
/**
|
|
57
|
+
* The first line of the comment that records a release approved in the Idea1 web app. A web merge,
|
|
58
|
+
* or a web-enabled auto-merge, is performed by the Idea1 GitHub App, so GitHub records the app as
|
|
59
|
+
* `merged_by`; the platform posts this comment, naming the approver, before the merge happens, and
|
|
60
|
+
* the evidence script keys on it to attribute the merge to that approver.
|
|
61
|
+
*/
|
|
62
|
+
export declare const RELEASE_APPROVAL_COMMENT_MARKER = "**Change-management approval: release approved in Idea1.**";
|
|
43
63
|
/**
|
|
44
64
|
* The local checkout must be the source branch, clean, fully pushed and level with origin, so the
|
|
45
65
|
* PR carries exactly what the person running the command is looking at.
|
|
46
66
|
*/
|
|
47
67
|
export declare function validateSourceBranch(sourceBranch: string): Promise<void>;
|
|
68
|
+
export type VersionBumpType = 'patch' | 'minor' | 'major';
|
|
69
|
+
export declare const VERSION_BUMP_TYPES: readonly VersionBumpType[];
|
|
70
|
+
/** A versioned package that changed in the release without its version being bumped yet. */
|
|
71
|
+
export interface PendingVersionBump extends VersionedPackage {
|
|
72
|
+
currentVersion: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The versioned packages the release still has to bump, read from origin's branches as last
|
|
76
|
+
* fetched. A package needs a bump when its folder changed between the target and the release
|
|
77
|
+
* branch and its package.json version is still the same on both - a version that already differs
|
|
78
|
+
* was bumped for this release, so re-running a release never bumps twice. The Idea1 web app applies
|
|
79
|
+
* the same rule.
|
|
80
|
+
*/
|
|
81
|
+
export declare function detectPendingVersionBumps(packages: readonly VersionedPackage[], releaseBranch: string, targetBranch: string): Promise<PendingVersionBump[]>;
|
|
82
|
+
export interface CommitVersionBumpsOptions {
|
|
83
|
+
/** The release branch, which must be the checked-out branch. */
|
|
84
|
+
releaseBranch: string;
|
|
85
|
+
/** The packages that need a bump, as `detectPendingVersionBumps` returned them. */
|
|
86
|
+
pending: readonly PendingVersionBump[];
|
|
87
|
+
/** Bump type per package name; every pending package needs one. */
|
|
88
|
+
bumps: Record<string, VersionBumpType>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Bump the versions of the pending packages in one commit on the release branch and push it, so
|
|
92
|
+
* the release PR opens against a branch that already carries them. The commit is `chore: bump
|
|
93
|
+
* <package> <version>, ...` and is made as whoever runs the command.
|
|
94
|
+
*/
|
|
95
|
+
export declare function commitVersionBumps(options: CommitVersionBumpsOptions): Promise<void>;
|
|
48
96
|
interface BranchCommit {
|
|
49
97
|
sha: string;
|
|
50
98
|
author: string;
|
|
@@ -101,20 +149,43 @@ export declare function confirmApproverIdentity(branchName: string): Promise<voi
|
|
|
101
149
|
* comment cannot be posted, nothing is merged.
|
|
102
150
|
*/
|
|
103
151
|
export declare function mergeWithCheckGate(branchName: string, kind: GatedPrKind): Promise<void>;
|
|
152
|
+
/** What `enableAutoMergeOrPoll` left the PR as. */
|
|
153
|
+
export type AutoMergeOutcome = 'auto-merge-enabled' | 'merged';
|
|
154
|
+
/**
|
|
155
|
+
* Merge the PR the way that records the person running this as `merged_by`, without them having to
|
|
156
|
+
* wait: GitHub's auto-merge, which merges once the required checks pass. Where GitHub can't
|
|
157
|
+
* auto-merge (the PR is already mergeable, or the repository doesn't allow auto-merge), it falls
|
|
158
|
+
* back to waiting for the checks here and merging (`mergeWithCheckGate`, with its admin-override
|
|
159
|
+
* path). Any other refusal throws.
|
|
160
|
+
*/
|
|
161
|
+
export declare function enableAutoMergeOrPoll(branchName: string, kind: GatedPrKind): Promise<AutoMergeOutcome>;
|
|
104
162
|
export interface RunPrModeOptions {
|
|
105
163
|
mode: PrMode;
|
|
106
164
|
sourceBranch: string;
|
|
107
165
|
targetBranch: string;
|
|
108
166
|
prUrl: string;
|
|
109
167
|
kind: GatedPrKind;
|
|
110
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* Open the Actions page after a merge made here - the merge to main triggers the production
|
|
170
|
+
* deploy. An auto-merge GitHub performs later opens nothing.
|
|
171
|
+
*/
|
|
111
172
|
openActionsAfterMerge: boolean;
|
|
112
173
|
}
|
|
113
174
|
/**
|
|
114
175
|
* Finish the sequence in the chosen mode. Either way the merge is the approval of record: in
|
|
115
176
|
* `create` mode the approver performs it in GitHub once the checks are green; in `merge` mode the
|
|
116
|
-
* CLI
|
|
177
|
+
* CLI turns on GitHub's auto-merge as the approver, so GitHub merges once the checks pass and
|
|
178
|
+
* records the approver as the merger - or, where GitHub can't auto-merge, waits for the checks and
|
|
179
|
+
* merges here.
|
|
117
180
|
*/
|
|
118
181
|
export declare function runPrMode(options: RunPrModeOptions): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* `idea1 release --approve`: approve and merge the open release PR from the source branch into the
|
|
184
|
+
* target, as its approver. With every check passed it merges now; with checks still running it
|
|
185
|
+
* turns on auto-merge (or waits and merges where GitHub can't auto-merge); with a failed check it
|
|
186
|
+
* goes to the gate's admin-override path, which refuses unless the override is confirmed, reasoned
|
|
187
|
+
* and recorded.
|
|
188
|
+
*/
|
|
189
|
+
export declare function approveRelease(sourceBranch: string, targetBranch: string): Promise<void>;
|
|
119
190
|
export {};
|
|
120
|
-
//# sourceMappingURL=release-
|
|
191
|
+
//# sourceMappingURL=release-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-engine.d.ts","sourceRoot":"","sources":["../../../src/workflow/engine/release-engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAQ5E;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,YAAY,EAAE,WAA+F,CAAC;AAC3H,eAAO,MAAM,WAAW,EAAE,WAAwG,CAAC;AAEnI,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,aAU5B,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,uBAAuB,iEAAiE,CAAC;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,qFACsC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,+DAA+D,CAAC;AAE5G;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,YAAY,EAAE,MA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