@idea1/cli 1.10.0 → 1.10.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/README.md +15 -18
- package/dist/cli/named-lists.d.ts.map +1 -1
- package/dist/cli/named-lists.js +0 -5
- package/dist/cli/named-lists.js.map +1 -1
- package/dist/commands/approve-pr.d.ts.map +1 -1
- package/dist/commands/approve-pr.js +1 -54
- package/dist/commands/approve-pr.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +1 -2
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/ready-for-approval.d.ts.map +1 -1
- package/dist/commands/ready-for-approval.js +1 -79
- package/dist/commands/ready-for-approval.js.map +1 -1
- package/dist/commands/release.d.ts.map +1 -1
- package/dist/commands/release.js +5 -8
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/ship-local-changes.d.ts +2 -0
- package/dist/commands/ship-local-changes.d.ts.map +1 -1
- package/dist/commands/ship-local-changes.js +31 -7
- package/dist/commands/ship-local-changes.js.map +1 -1
- package/dist/services/github.d.ts +25 -19
- package/dist/services/github.d.ts.map +1 -1
- package/dist/services/github.js +23 -47
- package/dist/services/github.js.map +1 -1
- package/dist/workflow/engine/approval-flow.d.ts +20 -4
- package/dist/workflow/engine/approval-flow.d.ts.map +1 -1
- package/dist/workflow/engine/approval-flow.js +123 -9
- package/dist/workflow/engine/approval-flow.js.map +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.js +1 -1
- package/dist/workflow/engine/handlers/dev-implementation.js.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts +4 -9
- package/dist/workflow/engine/handlers/ready-for-approval.d.ts.map +1 -1
- package/dist/workflow/engine/handlers/ready-for-approval.js +5 -16
- package/dist/workflow/engine/handlers/ready-for-approval.js.map +1 -1
- package/dist/workflow/engine/release-engine.d.ts +16 -5
- package/dist/workflow/engine/release-engine.d.ts.map +1 -1
- package/dist/workflow/engine/release-engine.js +80 -8
- package/dist/workflow/engine/release-engine.js.map +1 -1
- package/dist/workflow/engine/ship-flow.d.ts +10 -5
- package/dist/workflow/engine/ship-flow.d.ts.map +1 -1
- package/dist/workflow/engine/ship-flow.js +70 -22
- package/dist/workflow/engine/ship-flow.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ A transition is "enter state X". Entering a state runs that state's automation (
|
|
|
115
115
|
| Build Spec in Progress … Ready for Agent Implementation | none — status only. Build Spec in Progress, Refinement - Implementation and Ready for Agent Implementation take an optional teammate assignment (see below) |
|
|
116
116
|
| **Agent Implementation** | ensures the branch is checked out locally (worktree or main repo) — the one step that creates a checkout when the branch has none — then **starts a Claude session** to implement the item, from one of the state's [entry points](#prompts). This is the only transition that starts code-writing automation |
|
|
117
117
|
| **Dev Implementation** | commits and pushes the agent's work from the branch's checkout (a branch with no checkout here has its work on origin), creates the PR, removes the worktree if `removeWorktreeAtState` says so |
|
|
118
|
-
| **Needs Approval for Release** | takes a required teammate assignment: the item is assigned to the teammate, who approves the PR, so the PR is assigned to their linked GitHub account. Requires the PR, sets its assignee
|
|
118
|
+
| **Needs Approval for Release** | takes a required teammate assignment: the item is assigned to the teammate, the workflow-level approver, who approves the PR, so the PR is assigned to their linked GitHub account. Requires the PR, sets its assignee, removes a legacy workflow context file if the branch still carries one (its final commit), and removes the worktree if configured. From here on the branch stays as it is |
|
|
119
119
|
| **Approved and Merged** | verifies you are the assignee, refuses a PR that conflicts with its base, waits for the CI/CD suite, merges the PR as it stands — the merge is the approval — then deletes the branch and worktree and fast-forwards your base branch checkout |
|
|
120
120
|
| Released | none — normally set by GitHub automation when the work merges to `main` |
|
|
121
121
|
|
|
@@ -127,7 +127,7 @@ A transition is "enter state X". Entering a state runs that state's automation (
|
|
|
127
127
|
|
|
128
128
|
A change reaches production through two merges, and **each merge is its approval**.
|
|
129
129
|
|
|
130
|
-
**Into `working/release`** — the PR's **assignee** (required) is its approver: the teammate the project item is assigned to on the way into Needs Approval for Release, through their linked GitHub account. They review the code and approve it by running `idea1 approve-pr`, which waits for the full CI/CD suite and then **merges** the PR. That is not the GitHub "Approve" button, which only leaves a review behind and merges nothing. A red or unfinished suite stops the merge, and there is no override at this stage. `approve-pr` checks that the person merging is the assignee; anyone else has to confirm explicitly, and the evidence report lists that merge as an exception.
|
|
130
|
+
**Into `working/release`** — the PR's **assignee** (required) is its approver: the teammate the project item is assigned to on the way into Needs Approval for Release, through their linked GitHub account. They review the code and approve it by running `idea1 approve-pr`, which waits for the full CI/CD suite and then **merges** the PR. That is not the GitHub "Approve" button, which only leaves a review behind and merges nothing. A red or unfinished suite stops the merge, and there is no override at this stage. `approve-pr` checks that the person merging is the assignee; anyone else has to confirm explicitly, and the evidence report lists that merge as an exception. GitHub records the approval as `merged_by`, with its timestamp and merge commit.
|
|
131
131
|
|
|
132
132
|
**Any other branch into `working/release`** — a branch with no project item takes the same gate. `idea1 ready-for-approval` opens its PR (with the approval chain of what the branch carries as the body) and names its assignee — a teammate, assigned through their linked GitHub account, with no item to assign; `idea1 approve-pr` merges it once the suite passes, with the same no-override rule, and then deletes the branch. Only the idea1.ai status writes are absent. Integration branches work this way: work items PR into `working/integration/<name>-main` and are approved there exactly as above, then the integration branch itself is carried into `working/release` with these two commands — its PR body lists every work-item PR and who approved it, and `approve-pr` refuses while any PR still targets the integration branch.
|
|
133
133
|
|
|
@@ -157,7 +157,6 @@ idea1 s --target <url>
|
|
|
157
157
|
- `--approve-and-merge` - Advance the item through every state up to **Approved and Merged** without prompting. See [Carrying local changes](#carrying-local-changes).
|
|
158
158
|
- `-M, --commit-message <message>` - Commit message for carried changes (default: the new item's title).
|
|
159
159
|
- `-iso, --isolation <mode>` - Where to work on the branch, when changes are carried or the item is approved and merged. See [Isolation mode](#isolation-mode).
|
|
160
|
-
- `-r, --reviewers <user1,user2>` - Reviewers to request on the PR with `--approve-and-merge` (never asked; optional).
|
|
161
160
|
- `-a, --assignee <email or GitHub login>` - Teammate to assign the item to as it enters Build Spec in Progress (optional; asked, with **None** preselected, when the command gives the item its branch). See [Teammate assignment](#how-the-workflow-engine-works).
|
|
162
161
|
|
|
163
162
|
### Carrying local changes
|
|
@@ -172,7 +171,7 @@ With `--approve-and-merge`, the item is then advanced through every workflow sta
|
|
|
172
171
|
|
|
173
172
|
### ship-local-changes
|
|
174
173
|
|
|
175
|
-
`start --carry-local-changes --approve-and-merge` as one unattended command: create a project item, cut its branch from `working/release`, commit and push your uncommitted changes there, advance it to Needs Approval for Release assigned to you, with a PR assigned to you, wait for the PR's checks and merge it into `working/release`. You end on `working/release`, clean, with your changes merged. The only questions are the ones a new item needs (its title and Project) when they are not supplied.
|
|
174
|
+
`start --carry-local-changes --approve-and-merge` as one unattended command: create a project item, cut its branch from `working/release`, commit and push your uncommitted changes there, advance it to Needs Approval for Release assigned to you, with a PR assigned to you, wait for the PR's checks and merge it into `working/release`. You end on `working/release`, clean, with your changes merged. The only questions are the ones a new item needs (its title and Project) when they are not supplied. Leaving the title blank ships with no project item: the changes go onto a branch that gets a PR assigned to you, which merges once its checks pass, exactly as `ready-for-approval` and `approve-pr` treat a branch with no item, and no workflow status is recorded.
|
|
176
175
|
|
|
177
176
|
```bash
|
|
178
177
|
idea1 ship-local-changes --title "Release prep" --project "Omega"
|
|
@@ -183,12 +182,11 @@ idea1 ship --target <url> # an existing item whose branch has no commit
|
|
|
183
182
|
|
|
184
183
|
**Options:**
|
|
185
184
|
- `--target <url | branch | PR url>` - An existing project item (default: create a new one).
|
|
186
|
-
- `-t, --title <title>`, `-P, --project <name>` - The new item's title and Project (asked when
|
|
185
|
+
- `-t, --title <title>`, `-P, --project <name>` - The new item's title and Project (asked when no target is given; a blank title skips the item and the Project).
|
|
187
186
|
- `-n, --branch-name <name>` - Branch name under the branch prefix (default: derived from the item).
|
|
188
187
|
- `-b, --base-branch <branch>` - The branch your checkout is on, which the item's branch is cut from and merges into (default: `baseBranch`).
|
|
189
|
-
- `-M, --commit-message <message>` - Commit message (default: the item's title).
|
|
188
|
+
- `-M, --commit-message <message>` - Commit message (default: the item's title; with no item, a generic message naming the base branch).
|
|
190
189
|
- `-iso, --isolation <mode>` - `worktree` (default, never asked) works on the branch in a worktree while it is shipped and leaves your checkout on `working/release`; `main-repo` switches your checkout to the branch until the merge, then back.
|
|
191
|
-
- `-r, --reviewers <user1,user2>` - Reviewers to request on the PR (optional).
|
|
192
190
|
|
|
193
191
|
### next-workflow-step
|
|
194
192
|
|
|
@@ -209,7 +207,7 @@ idea1 n
|
|
|
209
207
|
- `--to <state>` - Workflow state to advance to (default: the next state).
|
|
210
208
|
- `-p, --source-path <path>` - Path to source directory.
|
|
211
209
|
- `-a, --assignee <email or GitHub login>` - Teammate to assign the item to, when a state entered takes an assignment (asked otherwise; see [Teammate assignment](#how-the-workflow-engine-works)).
|
|
212
|
-
- Any option of the state being entered (for example `--model`/`--effort` for Agent Implementation, `--
|
|
210
|
+
- Any option of the state being entered (for example `--model`/`--effort` for Agent Implementation, `--assignee` for Needs Approval for Release). Options that were not supplied are prompted for when that state is reached.
|
|
213
211
|
|
|
214
212
|
**What it does:**
|
|
215
213
|
1. Reads the item's workflow context from idea1.ai (picking up changes made in the web client) and fast-forwards the local checkout to origin when it is behind.
|
|
@@ -306,7 +304,7 @@ idea1 a --target <url>
|
|
|
306
304
|
- `-p, --source-path <path>` - Path to source directory.
|
|
307
305
|
- `-b, --base-branch <branch>` - Base branch / PR target for an independent feature (default: `working/release`).
|
|
308
306
|
- `-w, --workflow-type <type>` - Development workflow type: `independent` or `integration`. You also choose any stack branch and (for integration) the integration branch. Asked here because attaching records a new branch on the item; an option given on the command line is not asked.
|
|
309
|
-
- `-c, --carry-local-changes`, `--approve-and-merge`, `-n, --branch-name`, `-M, --commit-message`, `-iso, --isolation
|
|
307
|
+
- `-c, --carry-local-changes`, `--approve-and-merge`, `-n, --branch-name`, `-M, --commit-message`, `-iso, --isolation` - As for `start`.
|
|
310
308
|
|
|
311
309
|
**What it does:**
|
|
312
310
|
1. Verifies the current branch is free to implement the item (a branch that already implements one is resumed with `join-project-item`).
|
|
@@ -337,7 +335,7 @@ idea1 dev --target <url>,<url>
|
|
|
337
335
|
|
|
338
336
|
### ready-for-approval
|
|
339
337
|
|
|
340
|
-
For a project item, advance the item to **Needs Approval for Release** — the same as `next --to "Needs Approval for Release"`: from an earlier state, every state in between is entered first, each with its own automation (PR creation on the way into Dev Implementation, for one), an item already in it enters it again, so its PR gets the assignee
|
|
338
|
+
For a project item, advance the item to **Needs Approval for Release** — the same as `next --to "Needs Approval for Release"`: from an earlier state, every state in between is entered first, each with its own automation (PR creation on the way into Dev Implementation, for one), an item already in it enters it again, so its PR gets the assignee named now, and an item past it is left as it is. For any other branch (an integration branch, a branch with no project item), open the branch's PR into the base branch when it has none. Either way its job is to name the **assignee** — a teammate, by email or GitHub login — who will approve the change by merging it: a project item is assigned to that teammate, the workflow-level approver, and the PR to their linked GitHub account. Several targets run in parallel.
|
|
341
339
|
|
|
342
340
|
```bash
|
|
343
341
|
idea1 ready-for-approval [options]
|
|
@@ -349,15 +347,14 @@ idea1 rfa --assignee name@company.com --target <url>,<branch> # from working/r
|
|
|
349
347
|
|
|
350
348
|
**Options:**
|
|
351
349
|
- `--target <url | branch | PR url>[,...]` - The project item(s) or branch(es) (default: the current branch; asked for on the base branch)
|
|
352
|
-
- `-a, --assignee <email or GitHub login>` - **Required.** The teammate who approves the PR by merging it
|
|
353
|
-
- `-r, --reviewers <user1,user2>` - Who to request a review from (multi-select when omitted). Optional, and separate from approval — the assignee is the approver
|
|
350
|
+
- `-a, --assignee <email or GitHub login>` - **Required.** The teammate who approves the PR by merging it — the workflow-level approver — one of the team's members with a linked GitHub account (asked when omitted: for a project item, preselecting its current assignee)
|
|
354
351
|
- `-b, --base-branch <branch>` - Branches with no project item only: the branch the PR targets (default: the open PR's base, else `baseBranch`, then `working/release`)
|
|
355
352
|
- `--title <title>` - Branches with no project item only: PR title when the PR has to be created (default: `Integration <name> <YYYY-MM-DD>` for an integration branch, else the branch name; prompted when omitted)
|
|
356
353
|
|
|
357
354
|
**What it does for a project item:**
|
|
358
355
|
1. Resolves the teammate (refusing an item out of scope, which has no assignee, and a teammate with no linked GitHub account), then enters every state before Needs Approval for Release the item has yet to reach (after syncing from origin)
|
|
359
356
|
2. Ensures no uncommitted or unpushed changes in the local checkout
|
|
360
|
-
3. Requires the PR to exist, then sets its assignee to the teammate's GitHub login
|
|
357
|
+
3. Requires the PR to exist, then sets its assignee to the teammate's GitHub login
|
|
361
358
|
4. Legacy branches only: removes the `.idea1/<branch>.json` workflow context file the branch still carries and pushes — the branch's final commit, so the CI/CD suite runs once more on exactly what will merge and the target branch receives the work alone
|
|
362
359
|
5. Records "Needs Approval for Release" on Idea1.ai, assigning the item to the teammate. From here on the branch stays as it is
|
|
363
360
|
6. If in a worktree and `removeWorktreeAtState` is `Needs Approval for Release` (the default) or earlier, removes the worktree
|
|
@@ -365,7 +362,7 @@ idea1 rfa --assignee name@company.com --target <url>,<branch> # from working/r
|
|
|
365
362
|
**What it does for a branch with no project item:**
|
|
366
363
|
1. Requires the branch on origin and, when it is checked out here, nothing uncommitted, unpushed or behind origin in that checkout; refuses the base branch itself and refuses a PR straight into `main` (that is `idea1 release`)
|
|
367
364
|
2. Reuses the branch's open PR (and its base) when one exists; otherwise creates the PR into the base branch with the approval chain of what the branch carries as its body — every PR merged into the branch with its author and approver, and commits pushed straight to the branch listed as the change under review (they are not an exception: this PR is their stage-1 approval)
|
|
368
|
-
3. Sets the assignee (the teammate's GitHub login)
|
|
365
|
+
3. Sets the assignee (the teammate's GitHub login)
|
|
369
366
|
4. Records no workflow status and assigns no item — there is no project item
|
|
370
367
|
|
|
371
368
|
### approve-pr
|
|
@@ -420,8 +417,8 @@ idea1 r
|
|
|
420
417
|
- `-y, --yes` - In `merge` mode, merge without asking for confirmation; with `--target`, also start the approvals without asking. The required checks still gate every merge
|
|
421
418
|
|
|
422
419
|
**What it does:**
|
|
423
|
-
1. Requires you to be on the release branch with nothing uncommitted, unpushed or behind origin
|
|
424
|
-
2. Bumps versions, when the repository's `.idea1/settings.json` has a `release` section (see [Release Settings](#release-settings)). A versioned package needs a bump when its folder differs between the release branch and the target and its `package.json` version is still the same on both — so a release re-run after a bump never bumps twice. You pick `patch`, `minor` or `major` for each such package (or give them with `--bumps`), and are asked nothing when no package changed. The CLI makes the bump itself, in your checkout, with no script or workflow: it sets the new version in each package's `package.json` and in the lockfiles at or above the package's folder that record it (the same files `npm version` touches, edited in place so nothing else changes), commits them as one `chore: bump <package> <version>, ...` commit and pushes it to the release branch. Only plain `major.minor.patch` versions are bumped. The bump lands before the PR is opened, so its commit is the PR's head and the suite runs once, on the release as it will merge.
|
|
420
|
+
1. Requires you to be on the release branch with nothing uncommitted, unpushed or behind origin, and to have write access to the repository. Refuses when a PR from the release branch into the target is already open: one that does not follow the release workflow (it has no assignee, or its description carries no approval chain) has to be fixed in GitHub or closed, and a release PR is approved with `--approve` instead. The Idea1 web app refuses a release on the same terms
|
|
421
|
+
2. Bumps versions, when the repository's `.idea1/settings.json` has a `release` section (see [Release Settings](#release-settings)). A versioned package needs a bump when its folder differs between the release branch and the target and its `package.json` version is still the same on both — so a release re-run after a bump never bumps twice. You pick `patch`, `minor` or `major` for each such package (or give them with `--bumps`), and are asked nothing when no package changed. The CLI makes the bump itself, in your checkout, with no script or workflow: it sets the new version in each package's `package.json` and in the lockfiles at or above the package's folder that record it (the same files `npm version` touches, edited in place so nothing else changes), commits them as one `chore: bump <package> <version>, ...` commit and pushes it to the release branch. Only plain `major.minor.patch` versions are bumped. The bump lands before the PR is opened, so its commit is the PR's head and the suite runs once, on the release as it will merge. The Idea1 web app's release view makes the same bump through the GitHub API
|
|
425
422
|
3. Creates the release PR assigned to you, whose body is the release's approval chain: every contained PR — attributed by GitHub's commit association, so squash and rebase merges are covered — with its author and the assignee who approved it by merging. Commits with no PR are listed separately, split in two: the version bumps (a commit with no PR that changes only version files, meaning the `package.json` of a declared package and the lockfiles above it, whatever its name or author), which are release automation and not an exception, and genuine direct commits, which are exceptions under change-management-policy.md clause 2, explained at the quarterly review
|
|
426
423
|
4. Refuses the release when nothing in it came through a merged PR. A repository admin can override that — an explicit confirmation and a required reason — and the exception is recorded as a comment on the PR naming the admin, the reason and every commit that had no PR, as well as in the PR body. Anyone who is not a repository admin just gets the refusal
|
|
427
424
|
5. In `merge` mode, enables auto-merge, or waits for the required CI/CD checks and merges normally. Checks that fail, never start or never finish stop the release; an admin override is available but takes an explicit confirmation and a required reason, and the exception is recorded as a comment on the PR before anything is merged
|
|
@@ -431,7 +428,7 @@ idea1 r
|
|
|
431
428
|
|
|
432
429
|
`idea1 release --target <items, branches or PRs>` releases the release branch once the given targets are approved into it, as one unattended sequence:
|
|
433
430
|
|
|
434
|
-
1. **Checks:** your checkout must be on the release branch, clean and level with origin. Then every target is resolved exactly as `approve-pr` resolves several targets.
|
|
431
|
+
1. **Checks:** your checkout must be on the release branch, clean and level with origin, and the release must be one that can be created (see step 1 above). Then every target is resolved exactly as `approve-pr` resolves several targets.
|
|
435
432
|
2. **Questions, all asked up front:**
|
|
436
433
|
- the options the targets' workflow states need, then one confirmation of the approvals;
|
|
437
434
|
- the version bump of every versioned package changed on the release branch or on any target's branch;
|
|
@@ -447,7 +444,7 @@ In interactive mode the whole sequence runs as a background job (see `/jobs`); o
|
|
|
447
444
|
|
|
448
445
|
#### Approving an open release
|
|
449
446
|
|
|
450
|
-
`idea1 release --approve` finds the open release PR from the release branch into the target and merges it as its approver,
|
|
447
|
+
`idea1 release --approve` finds the open release PR from the release branch into the target and merges it as its approver, on the same terms as the Idea1 web app: you need write access to the repository, the PR must follow the release workflow (an assignee, and the approval chain as its description), and you must be one of its assignees — anyone else is refused, and the PR is reassigned in GitHub or approved by its assignee. Then:
|
|
451
448
|
- every check passed — merges now
|
|
452
449
|
- checks still running — enables auto-merge, or waits for the checks and merges where GitHub can't auto-merge
|
|
453
450
|
- a check failed — stops, unless a repository admin confirms the admin override, gives a reason, and has it recorded on the PR before the merge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-lists.d.ts","sourceRoot":"","sources":["../../src/cli/named-lists.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"named-lists.d.ts","sourceRoot":"","sources":["../../src/cli/named-lists.ts"],"names":[],"mappings":"AAqCA;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAYvI"}
|
package/dist/cli/named-lists.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as github from '../services/github.js';
|
|
2
1
|
import * as platform from '../services/platform.js';
|
|
3
2
|
import { WorkflowStates } from '../workflow/data/workflow-states.js';
|
|
4
3
|
import { entryPointChoices } from '../workflow/engine/agent-session.js';
|
|
@@ -10,10 +9,6 @@ import { TARGET_OPTION_NAME } from '../jobs/targets.js';
|
|
|
10
9
|
* dynamically-resolved list.
|
|
11
10
|
*/
|
|
12
11
|
const registry = {
|
|
13
|
-
'github-members': async () => {
|
|
14
|
-
const logins = await github.listAssignableUsers();
|
|
15
|
-
return logins.map(login => ({ label: login, value: login }));
|
|
16
|
-
},
|
|
17
12
|
'idea1-projects': async () => {
|
|
18
13
|
const projects = await platform.listProjects();
|
|
19
14
|
return projects.map(name => ({ label: name, value: name }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-lists.js","sourceRoot":"","sources":["../../src/cli/named-lists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"named-lists.js","sourceRoot":"","sources":["../../src/cli/named-lists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,q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AAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,gBAAgB,IAAI,uBAAuB,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve-pr.d.ts","sourceRoot":"","sources":["../../src/commands/approve-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"approve-pr.d.ts","sourceRoot":"","sources":["../../src/commands/approve-pr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAOjD,eAAO,MAAM,gBAAgB,EAAE,OA0B9B,CAAC"}
|
|
@@ -1,61 +1,8 @@
|
|
|
1
|
-
import { logger } from '../lib/logger.js';
|
|
2
|
-
import { readBranchSettings } from '../lib/settings.js';
|
|
3
|
-
import * as git from '../services/git.js';
|
|
4
|
-
import * as github from '../services/github.js';
|
|
5
|
-
import * as worktree from '../services/worktree.js';
|
|
6
1
|
import { WorkflowStates } from '../workflow/data/workflow-states.js';
|
|
7
|
-
import {
|
|
8
|
-
import { confirmApproverIdentity } from '../workflow/engine/release-engine.js';
|
|
2
|
+
import { approvePrOnBranchWithNoItem, mergeConfirmationOption } from '../workflow/engine/approval-flow.js';
|
|
9
3
|
import { advanceAsNeededTo, resolveTarget } from '../workflow/engine/workflow-engine.js';
|
|
10
4
|
import { runForTargets, targetOption } from '../jobs/targets.js';
|
|
11
5
|
import { deferredHandlerOptions } from '../workflow/engine/handlers/index.js';
|
|
12
|
-
/**
|
|
13
|
-
* Stage 1 approval for a branch with no project item: the assignee merges the branch's PR once
|
|
14
|
-
* the required checks pass (no override), then the branch is cleaned up. No workflow status is
|
|
15
|
-
* recorded. The branch need not be checked out - the assignee can approve from anywhere.
|
|
16
|
-
*/
|
|
17
|
-
async function approvePrOnBranchWithNoItem(branchName, confirmed) {
|
|
18
|
-
await github.ensureGitHubCli();
|
|
19
|
-
// Captured before anything moves: cleanup may switch branches or remove a worktree.
|
|
20
|
-
const workingPath = await git.getCheckoutPathForBranch(branchName);
|
|
21
|
-
const prInfo = await github.getPrInfo(branchName);
|
|
22
|
-
if (!prInfo) {
|
|
23
|
-
throw new Error(`No PR found for ${branchName}. Run idea1 ready-for-approval --target ${branchName} first to open it and name its approver.`);
|
|
24
|
-
}
|
|
25
|
-
logger.info(`PR #${prInfo.number} found`);
|
|
26
|
-
const state = prInfo.state.toUpperCase();
|
|
27
|
-
if (state === 'CLOSED') {
|
|
28
|
-
throw new Error(`PR #${prInfo.number} is closed without being merged; there is nothing to approve.`);
|
|
29
|
-
}
|
|
30
|
-
const baseBranch = prInfo.baseRefName ?? await worktree.resolveBaseBranch();
|
|
31
|
-
const releaseTargetBranch = (await readBranchSettings(await git.getRepoRoot())).releaseTargetBranch;
|
|
32
|
-
if (baseBranch === releaseTargetBranch) {
|
|
33
|
-
throw new Error(`PR #${prInfo.number} targets ${releaseTargetBranch}: that is a release, not a change to approve. ` +
|
|
34
|
-
'Use idea1 release for it (change-management-policy.md clause 2).');
|
|
35
|
-
}
|
|
36
|
-
logger.header(`Approve: ${branchName} -> ${baseBranch}`);
|
|
37
|
-
logger.info('This branch has no project item, so no workflow status is recorded.');
|
|
38
|
-
logger.newline();
|
|
39
|
-
if (state === 'MERGED') {
|
|
40
|
-
logger.dim(`PR #${prInfo.number} is already merged; cleaning up the branch.`);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
if (workingPath) {
|
|
44
|
-
await git.ensureBranchUpToDate();
|
|
45
|
-
}
|
|
46
|
-
// Merging retires the branch, which would orphan any PR still targeting it.
|
|
47
|
-
const openPrsInto = await github.listOpenPrsInto(branchName);
|
|
48
|
-
if (openPrsInto.length > 0) {
|
|
49
|
-
const list = openPrsInto.map(pr => ` #${pr.number} ${pr.headRefName} ${pr.title}`).join('\n');
|
|
50
|
-
throw new Error(`${openPrsInto.length} open PR(s) still target ${branchName}; approve or close them before approving this branch:\n${list}`);
|
|
51
|
-
}
|
|
52
|
-
await confirmApproverIdentity(branchName);
|
|
53
|
-
await mergeAsApprover({ branchName, baseBranch, prNumber: prInfo.number, confirmed });
|
|
54
|
-
}
|
|
55
|
-
await cleanUpMergedBranch({ branchName, baseBranch, workingPath });
|
|
56
|
-
logger.newline();
|
|
57
|
-
logger.success(`PR merged into ${baseBranch} - the merge is the recorded approval`);
|
|
58
|
-
}
|
|
59
6
|
export const approvePrCommand = {
|
|
60
7
|
name: 'approve-pr',
|
|
61
8
|
aliases: ['approve'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approve-pr.js","sourceRoot":"","sources":["../../src/commands/approve-pr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"approve-pr.js","sourceRoot":"","sources":["../../src/commands/approve-pr.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,WAAW,EAAE,8LAA8L;IAC3M,OAAO,EAAE;QACP,YAAY,CAAC,IAAI,CAAC;QAClB,4FAA4F;QAC5F,qEAAqE;QACrE,GAAG,sBAAsB,CAAC,EAAE,CAAC;KAC9B;IAED,KAAK,CAAC,OAAO,CAAC,QAAgC;QAC5C,MAAM,aAAa,CAAC,gBAAgB,EAAE,QAAQ,EAAE;YAC9C,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,iBAAiB;YAClD,gBAAgB,EAAE,IAAI;YACtB,uBAAuB,EAAE,IAAI;YAC7B,GAAG,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;gBAClB,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC1E,IAAI,cAAc,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBACnC,MAAM,iBAAiB,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAC;oBACrF,OAAO;gBACT,CAAC;gBACD,MAAM,2BAA2B,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAC,CAAC;YACtH,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAMjD,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAMjD,eAAO,MAAM,WAAW,EAAE,OAoLzB,CAAC"}
|
package/dist/commands/help.js
CHANGED
|
@@ -44,8 +44,7 @@ export const helpCommand = {
|
|
|
44
44
|
console.log(' full CI/CD suite and then MERGES the PR - it is not the GitHub');
|
|
45
45
|
console.log(' "Approve" button, which only leaves a review and merges');
|
|
46
46
|
console.log(' nothing. A red or unfinished suite stops the merge; there is');
|
|
47
|
-
console.log(' no override at this stage.
|
|
48
|
-
console.log(' and record nothing.');
|
|
47
|
+
console.log(' no override at this stage.');
|
|
49
48
|
console.log();
|
|
50
49
|
console.log(` ${chalk.bold('Any other branch')} A branch with no project item (an integration branch, say) takes`);
|
|
51
50
|
console.log(' the same gate: ready-for-approval opens its PR into working/release');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACnB,WAAW,EAAE,uBAAuB;IAEpC,KAAK,CAAC,OAAO,CAAC,SAAiC;QAC7C,qBAAqB;QACrB,UAAU,EAAE,CAAC;QAEb,0BAA0B;QAC1B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,4DAA4D,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,QAAQ,KAAK,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7C,OAAO,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC;QAC5F,OAAO,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;QACrF,OAAO,CAAC,GAAG,CAAC,sFAAsF,CAAC,CAAC;QACpG,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ready-for-approval.d.ts","sourceRoot":"","sources":["../../src/commands/ready-for-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ready-for-approval.d.ts","sourceRoot":"","sources":["../../src/commands/ready-for-approval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQjD,eAAO,MAAM,uBAAuB,EAAE,OA0CrC,CAAC"}
|
|
@@ -1,87 +1,9 @@
|
|
|
1
|
-
import { logger } from '../lib/logger.js';
|
|
2
|
-
import { promptInput, promptSelect } from '../lib/prompt.js';
|
|
3
|
-
import { readBranchSettings } from '../lib/settings.js';
|
|
4
1
|
import { WorkflowStates } from '../workflow/data/workflow-states.js';
|
|
5
|
-
import
|
|
6
|
-
import * as github from '../services/github.js';
|
|
7
|
-
import * as platform from '../services/platform.js';
|
|
8
|
-
import * as worktree from '../services/worktree.js';
|
|
9
|
-
import { approverGitHubLogin, assigneeOption, ensurePrReadyForApproval } from '../workflow/engine/approval-flow.js';
|
|
10
|
-
import { validateSourceBranch } from '../workflow/engine/release-engine.js';
|
|
2
|
+
import { readyForApprovalOnBranchWithNoItem, resolveApproverForBranch } from '../workflow/engine/approval-flow.js';
|
|
11
3
|
import { advanceOrReenter, resolveTarget } from '../workflow/engine/workflow-engine.js';
|
|
12
4
|
import { runForTargets, targetOption } from '../jobs/targets.js';
|
|
13
5
|
import { deferredHandlerOptions } from '../workflow/engine/handlers/index.js';
|
|
14
6
|
import { readyForApprovalHandler } from '../workflow/engine/handlers/ready-for-approval.js';
|
|
15
|
-
/**
|
|
16
|
-
* The teammate who approves a branch with no project item, as the `assignee` option (their email or
|
|
17
|
-
* GitHub login): asked from the team's members when not supplied. There is no item to assign; the
|
|
18
|
-
* teammate's linked GitHub account becomes the PR's assignee.
|
|
19
|
-
*/
|
|
20
|
-
async function resolveApproverForBranch(options) {
|
|
21
|
-
if ((options[assigneeOption.longName] ?? '').trim().length > 0) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const members = await platform.listTeamMembers();
|
|
25
|
-
options[assigneeOption.longName] = await promptSelect('Assign to a teammate (the assignee approves the pull request)', members.map(member => ({ label: member.email, value: member.email })));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Stage 1 for a branch with no project item - an integration branch carrying approved work items,
|
|
29
|
-
* for instance: the PR into the base branch is opened when the branch has none, with the approval
|
|
30
|
-
* chain of what it carries as its body, and gets its assignee. No workflow status is recorded.
|
|
31
|
-
*/
|
|
32
|
-
async function readyForApprovalOnBranchWithNoItem(branchName, resolved) {
|
|
33
|
-
await github.ensureGitHubCli();
|
|
34
|
-
await resolveApproverForBranch(resolved);
|
|
35
|
-
const approver = approverGitHubLogin(await platform.resolveTeammate(resolved[assigneeOption.longName]));
|
|
36
|
-
const existingPr = await github.getPrInfo(branchName);
|
|
37
|
-
const openPr = existingPr && existingPr.state.toUpperCase() === 'OPEN' ? existingPr : null;
|
|
38
|
-
const requestedBase = resolved['base-branch'] || null;
|
|
39
|
-
const targetBranch = openPr?.baseRefName ?? requestedBase ?? await worktree.resolveBaseBranch();
|
|
40
|
-
if (openPr?.baseRefName && requestedBase && openPr.baseRefName !== requestedBase) {
|
|
41
|
-
logger.warning(`PR #${openPr.number} targets ${openPr.baseRefName}; --base-branch ${requestedBase} is ignored. Retarget the PR in GitHub if that is wrong.`);
|
|
42
|
-
}
|
|
43
|
-
if (branchName === targetBranch) {
|
|
44
|
-
throw new Error(`${targetBranch} is the branch changes are approved into, not a change to approve. Pass --target <the branch, item or PR to approve>.`);
|
|
45
|
-
}
|
|
46
|
-
const releaseTargetBranch = (await readBranchSettings(await git.getRepoRoot())).releaseTargetBranch;
|
|
47
|
-
if (targetBranch === releaseTargetBranch) {
|
|
48
|
-
throw new Error(`A change is approved into ${await worktree.resolveBaseBranch()}, never straight into ${releaseTargetBranch}; ` +
|
|
49
|
-
'use idea1 release for that (change-management-policy.md clause 2).');
|
|
50
|
-
}
|
|
51
|
-
logger.header(`Ready for approval: ${branchName} -> ${targetBranch}`);
|
|
52
|
-
logger.info('This branch has no project item, so no workflow status is recorded.');
|
|
53
|
-
logger.newline();
|
|
54
|
-
if (!await git.fetchRemoteBranch(branchName)) {
|
|
55
|
-
throw new Error(`Branch ${branchName} is not on origin. Push it first: git push -u origin ${branchName}`);
|
|
56
|
-
}
|
|
57
|
-
// A local checkout of the branch (the working directory, once the target is resolved) must
|
|
58
|
-
// carry exactly what origin has; a branch with no checkout here is what origin has.
|
|
59
|
-
if (await git.getCheckoutPathForBranch(branchName)) {
|
|
60
|
-
await validateSourceBranch(branchName);
|
|
61
|
-
}
|
|
62
|
-
const title = openPr ? '' : (resolved['title'] || await promptPrTitle(branchName));
|
|
63
|
-
await ensurePrReadyForApproval({
|
|
64
|
-
branchName,
|
|
65
|
-
baseBranch: targetBranch,
|
|
66
|
-
assignee: approver,
|
|
67
|
-
reviewers: resolved['reviewers'] ?? '',
|
|
68
|
-
createWhenMissing: openPr ? null : { title }
|
|
69
|
-
});
|
|
70
|
-
logger.newline();
|
|
71
|
-
logger.success('PR is ready for approval');
|
|
72
|
-
logger.hint(`The assignee approves it by running: idea1 approve-pr --target ${branchName} (which merges it)`);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* The PR title, defaulting to `Integration <name> <date>` for an integration branch and to the
|
|
76
|
-
* branch name otherwise.
|
|
77
|
-
*/
|
|
78
|
-
async function promptPrTitle(branchName) {
|
|
79
|
-
const integrationBranches = await worktree.listExistingIntegrationBranches();
|
|
80
|
-
const defaultTitle = integrationBranches.includes(branchName)
|
|
81
|
-
? `Integration ${await worktree.extractIntegrationName(branchName)} ${new Date().toISOString().split('T')[0]}`
|
|
82
|
-
: branchName;
|
|
83
|
-
return promptInput('Enter PR title:', { default: defaultTitle });
|
|
84
|
-
}
|
|
85
7
|
export const readyForApprovalCommand = {
|
|
86
8
|
name: 'ready-for-approval',
|
|
87
9
|
aliases: ['rfa'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ready-for-approval.js","sourceRoot":"","sources":["../../src/commands/ready-for-approval.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ready-for-approval.js","sourceRoot":"","sources":["../../src/commands/ready-for-approval.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AACnH,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,CAAC;AAE5F,MAAM,CAAC,MAAM,uBAAuB,GAAY;IAC9C,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,CAAC,KAAK,CAAC;IAChB,WAAW,EAAE,yNAAyN;IACtO,OAAO,EAAE;QACP,YAAY,CAAC,IAAI,CAAC;QAClB,iHAAiH;QACjH,GAAG,CAAC,uBAAuB,CAAC,OAAO,IAAI,EAAE,CAAC;QAC1C;YACE,QAAQ,EAAE,aAAa;YACvB,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,2HAA2H;YACxI,YAAY,EAAE,EAAE;YAChB,uBAAuB,EAAE,KAAK;SAC/B;QACD;YACE,QAAQ,EAAE,OAAO;YACjB,WAAW,EAAE,mFAAmF;YAChG,YAAY,EAAE,EAAE;YAChB,uBAAuB,EAAE,KAAK;SAC/B;QACD,4FAA4F;QAC5F,eAAe;QACf,GAAG,sBAAsB,CAAC,uBAAuB,CAAC,OAAO,IAAI,EAAE,CAAC;KACjE;IAED,KAAK,CAAC,OAAO,CAAC,QAAgC;QAC5C,MAAM,aAAa,CAAC,uBAAuB,EAAE,QAAQ,EAAE;YACrD,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,uBAAuB;YACxD,gBAAgB,EAAE,IAAI;YACtB,uBAAuB,EAAE,wBAAwB;YACjD,GAAG,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;gBAClB,MAAM,cAAc,GAAG,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;gBAC1E,IAAI,cAAc,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBACnC,gGAAgG;oBAChG,MAAM,gBAAgB,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,uBAAuB,CAAC,CAAC;oBAC1F,OAAO;gBACT,CAAC;gBACD,MAAM,kCAAkC,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;YAChF,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/commands/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/commands/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAgOjD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,OAoH5B,CAAC"}
|
package/dist/commands/release.js
CHANGED
|
@@ -9,7 +9,7 @@ import { TARGET_OPTION_NAME, parseTargets, prepareTargetRuns, promptForTargets }
|
|
|
9
9
|
import { WorkflowStates } from '../workflow/data/workflow-states.js';
|
|
10
10
|
import { mergeConfirmationOption } from '../workflow/engine/approval-flow.js';
|
|
11
11
|
import { approvePrCommand } from './approve-pr.js';
|
|
12
|
-
import { PR_MODE_OPTION, RELEASE_KIND, VERSION_BUMP_TYPES, approveRelease, commitVersionBumps, createGatedPr, detectPendingVersionBumps, runPrMode, validateSourceBranch } from '../workflow/engine/release-engine.js';
|
|
12
|
+
import { PR_MODE_OPTION, RELEASE_KIND, VERSION_BUMP_TYPES, approveRelease, commitVersionBumps, createGatedPr, detectPendingVersionBumps, ensureReleasable, runPrMode, validateSourceBranch } from '../workflow/engine/release-engine.js';
|
|
13
13
|
/**
|
|
14
14
|
* Resolve the release branch (source branch)
|
|
15
15
|
*/
|
|
@@ -62,8 +62,8 @@ function parseBumpsOption(value) {
|
|
|
62
62
|
* The versioned packages that need a bump for the release, with the bump type of each: from
|
|
63
63
|
* `--bumps`, else asked. Counts the changes of `incomingBranches`, the branches approved into the
|
|
64
64
|
* release branch before it is released, as the release's own. None when the repository declares no
|
|
65
|
-
* versioned packages
|
|
66
|
-
* release PR, which may already be approved.
|
|
65
|
+
* versioned packages. The caller has already refused a release with a PR open, so a bump is never
|
|
66
|
+
* made onto an open release PR, which may already be approved.
|
|
67
67
|
*/
|
|
68
68
|
async function resolvePendingBumps(sourceBranch, targetBranch, requestedBumps, incomingBranches) {
|
|
69
69
|
const settings = await readReleaseSettings(await git.getRepoRoot());
|
|
@@ -79,11 +79,6 @@ async function resolvePendingBumps(sourceBranch, targetBranch, requestedBumps, i
|
|
|
79
79
|
throw new Error(`--bumps names unknown package(s): ${unknownNames.join(', ')}. ` +
|
|
80
80
|
`The versioned packages are: ${knownNames.join(', ')}.`);
|
|
81
81
|
}
|
|
82
|
-
if (await github.checkPrExists(sourceBranch, targetBranch)) {
|
|
83
|
-
logger.dim('A release PR is already open, so no version bump is made onto it');
|
|
84
|
-
logger.newline();
|
|
85
|
-
return { pending: [], bumps: {} };
|
|
86
|
-
}
|
|
87
82
|
logger.step('Checking which versioned packages changed since the last release...');
|
|
88
83
|
const pending = await detectPendingVersionBumps(settings.versionedPackages, sourceBranch, targetBranch, incomingBranches);
|
|
89
84
|
if (pending.length === 0) {
|
|
@@ -134,6 +129,7 @@ async function releaseWithApprovals(sourceBranch, targetBranch, targets, resolve
|
|
|
134
129
|
logger.newline();
|
|
135
130
|
// The release runs in this checkout once the approvals have merged, so it must be fit for that now.
|
|
136
131
|
await validateSourceBranch(sourceBranch);
|
|
132
|
+
await ensureReleasable(sourceBranch, targetBranch);
|
|
137
133
|
const { runs, summaries } = await prepareTargetRuns(approvePrCommand, targets, resolved, {
|
|
138
134
|
advancesTo: () => WorkflowStates.ApprovedAndMerged,
|
|
139
135
|
itemlessBranches: true,
|
|
@@ -253,6 +249,7 @@ export const releaseCommand = {
|
|
|
253
249
|
logger.header(`Release: ${sourceBranch} -> ${targetBranch}`);
|
|
254
250
|
logger.newline();
|
|
255
251
|
await validateSourceBranch(sourceBranch);
|
|
252
|
+
await ensureReleasable(sourceBranch, targetBranch);
|
|
256
253
|
await bumpPendingVersions(sourceBranch, targetBranch, parseBumpsOption(resolved['bumps']));
|
|
257
254
|
const prTitle = titleArg ?? await promptPrTitle();
|
|
258
255
|
logger.info(`Using title: ${prTitle}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.js","sourceRoot":"","sources":["../../src/commands/release.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MA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CAAC,CAAC;QACnD,MAAM,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE3F,MAAM,OAAO,GAAG,QAAQ,IAAI,MAAM,aAAa,EAAE,CAAC;QAClD,MAAM,CAAC,IAAI,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC;QAClC,MAAM,CAAC,OAAO,EAAE,CAAC;QAEjB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC;YAChC,YAAY;YACZ,YAAY;YACZ,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,YAAY;SACnB,CAAC,CAAC;QACH,MAAM,CAAC,OAAO,EAAE,CAAC;QAEjB,MAAM,SAAS,CAAC;YACd,IAAI,EAAE,MAAM;YACZ,YAAY;YACZ,YAAY;YACZ,KAAK;YACL,IAAI,EAAE,YAAY;YAClB,qBAAqB,EAAE,IAAI;YAC3B,SAAS,EAAE,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,MAAM;SACjE,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -3,6 +3,8 @@ import type { Command } from '../types/index.js';
|
|
|
3
3
|
* `start --carry-local-changes --approve-and-merge` with nothing asked beyond what a new item
|
|
4
4
|
* needs (its title and Project): the uncommitted changes of the base branch checkout become a
|
|
5
5
|
* project item's branch and PR, which merges into the base branch once the required checks pass.
|
|
6
|
+
* With the title left blank no item is created: the changes become a branch with no project item,
|
|
7
|
+
* which goes through the same approval and merge.
|
|
6
8
|
*/
|
|
7
9
|
export declare const shipLocalChangesCommand: Command;
|
|
8
10
|
//# sourceMappingURL=ship-local-changes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship-local-changes.d.ts","sourceRoot":"","sources":["../../src/commands/ship-local-changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAYjD
|
|
1
|
+
{"version":3,"file":"ship-local-changes.d.ts","sourceRoot":"","sources":["../../src/commands/ship-local-changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAYjD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,EAAE,OA6CrC,CAAC"}
|