@osdlc/repo-cleaner 0.20.5 → 0.22.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/CHANGELOG.md +64 -0
- package/README.md +545 -165
- package/dist/approval.d.ts +91 -0
- package/dist/approval.js +233 -0
- package/dist/archive.d.ts +87 -0
- package/dist/archive.js +252 -0
- package/dist/branches.d.ts +4 -4
- package/dist/branches.js +56 -43
- package/dist/clean.d.ts +30 -70
- package/dist/clean.js +251 -197
- package/dist/cli.d.ts +16 -10
- package/dist/cli.js +252 -103
- package/dist/discover.d.ts +28 -7
- package/dist/discover.js +185 -42
- package/dist/index.d.ts +6 -3
- package/dist/index.js +5 -2
- package/dist/landing.d.ts +10 -5
- package/dist/landing.js +15 -16
- package/dist/plan.d.ts +18 -11
- package/dist/plan.js +33 -13
- package/dist/processes.d.ts +19 -9
- package/dist/processes.js +51 -25
- package/dist/providers/github.d.ts +21 -3
- package/dist/providers/github.js +149 -27
- package/dist/providers/gitlab.js +37 -17
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +1 -1
- package/dist/providers/types.d.ts +15 -2
- package/dist/prs.d.ts +19 -10
- package/dist/prs.js +21 -13
- package/dist/receipt.d.ts +68 -3
- package/dist/receipt.js +30 -3
- package/dist/reference.d.ts +1 -1
- package/dist/reference.js +93 -50
- package/dist/remote-mirror.d.ts +2 -1
- package/dist/remote-mirror.js +3 -14
- package/dist/render.d.ts +17 -2
- package/dist/render.js +80 -13
- package/dist/scope.d.ts +15 -0
- package/dist/scope.js +125 -0
- package/dist/size.d.ts +20 -0
- package/dist/size.js +34 -0
- package/dist/status-line.js +1 -0
- package/dist/step-board.js +6 -4
- package/dist/sweep.d.ts +45 -18
- package/dist/sweep.js +151 -127
- package/dist/types.d.ts +89 -10
- package/dist/types.js +50 -6
- package/dist/util.d.ts +2 -0
- package/dist/util.js +25 -0
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/worktrees.js +87 -11
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @osdlc/repo-cleaner
|
|
2
2
|
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0ce8abc: - A worktree lock's owner is checked with `@osdlc/file-lock`'s `sameProcess`. A lock may now record file-lock's `processIdentity` (on Linux, boot id and start ticks, which no clock change or time zone moves). A recorded start later than the process's real start, such as when the owner took the lock, still names the owner; before, a live owner's lock could read as stale.
|
|
8
|
+
- A sweep that fetches several remotes fetches them in one parallel `git fetch --multiple`, and reads their default branches in one call.
|
|
9
|
+
- Breaking, for library users: `RepoInfo.remotes` lists every remote the sweep touches (the default remote, the judged ones with `judged: true`, and the `against` remote), `RepoInfo.against` is the remote's name, and `RepoInfo.fetched` is gone (use `fetchedRemotes`). `judgedRemotes`, `landedFor`, `refOf` and the `RemoteInfo` and `LandedAgainst` types are exported.
|
|
10
|
+
- The two tests that make a receipt unsavable skip when run as root, which can always write it.
|
|
11
|
+
- 976bbee: The command line by phase and scope ([D-4CE9](packages/ts/repo-cleaner/docs/planning/decisions/D-4CE9-the-cli-by-use-case.md)). Breaking; nothing is kept for compatibility.
|
|
12
|
+
|
|
13
|
+
- Nothing runs until a phase is named: `status` (the old report), `plan`, `clean`, `cache`. The bare command explains them and exits 2.
|
|
14
|
+
- Scope: `--local` (the default), `--remote` (the default remote's branches), `--remote=<name>` (repeatable, `*` for every remote), `--all`, and `--worktrees` or `--branches`. `--only` is gone; the old `--remote` is `--all`; the report's `--all` is `--all-rows`. `--remote upstream` with a space is refused with the fix.
|
|
15
|
+
- Several remotes: each is fetched, and its branches judged against its own default branch. `--against <remote>` judges every row against one remote's default branch, as a fork against its parent. The default remote is `origin`, else the remote the default branch tracks, else the only remote.
|
|
16
|
+
- A fork's pull requests are read from its parent, so its branches no longer all need `confirm-open-pr`.
|
|
17
|
+
- `--fetch` fetches the default remote for local rows.
|
|
18
|
+
- `--pick` adds a row to the run instead of narrowing it; the library's `select` names rows exactly. `--spare` takes a glob, and a bare name spares that branch everywhere.
|
|
19
|
+
- `clean -i` chooses rows from a checklist and asks for each ticked row's risks.
|
|
20
|
+
- Library: `SweepOptions.remote` is `remotes`; `RepoInfo` gains `remotes`, `against` and `fetchedRemotes`; every judged row records `evidence.landedAgainst`, part of its fingerprint, which replaces a branch's `compareAgainst`. Plans are version 3.
|
|
21
|
+
- 9c0f5ae: A clean worktree whose HEAD is on a branch of the fetched remote is now `delete`, whatever its PR state short of an open PR, once its branch shows a sign of use. Nothing is lost: the remote holds the commits. The row carries no `abandon-unmerged`, and `evidence.recoverableFrom` names the remote branches (it is part of the plan fingerprint). A run that also deletes every one of those remote branches drops the worktree unless `abandon-unmerged` is allowed. A sweep that did not fetch keeps its verdict and notes that `--remote` would check.
|
|
22
|
+
- c8356f7: `repo-cleaner status --sizes` (`sizes` in the library's sweep options) reads each on-disk worktree's size with `du -sk` into `evidence.sizeBytes` (`null` when `du` fails or times out), lists rows largest first within each verdict, and reports `reclaimableBytes` for the `delete` and `review` rows in the totals line and in JSON. `--sizes` is a `status` flag: `plan` and `clean` refuse it (exit 2). Sizes are not part of a plan fingerprint.
|
|
23
|
+
|
|
24
|
+
`clean` reports the disk space it freed, with no flag: each worktree a `remove-worktree` step removes is measured with `du` just before, into the step's new optional `freedBytes` in the receipt (`null` when the measurement failed or timed out; set only once the removal succeeded). The run summary adds `freed: 4.2 GB (2 worktrees)`, or `freed: at least 4.2 GB (2 worktrees, 1 not measured)`, and `RunSummary` (the JSON `summary`) gains `freedBytes` and `unmeasured`. A dry run measures nothing. `RunOptions.sizeTimeoutMs` caps each measurement.
|
|
25
|
+
|
|
26
|
+
New exports: `sizeOf`, `formatBytes`. `repo-cleaner cache` now reports disk usage through `sizeOf` rather than apparent size.
|
|
27
|
+
- 1db132e: `clean`: a failed step no longer ends the run. It skips only the steps that depend on it and the rest go on: a failed unlock skips that row's remove, a failed worktree removal skips the delete of the branch it held and a repository-wide prune, and a failed local branch delete skips the same branch's remote delete. Nothing in another repository is skipped. A failed spared-tip check still stops the run. A skipped step has the new receipt result `skipped` and names the failed step in `error`, so the receipt version is now 3. The summary counts steps run, failed and skipped, `RunSummary` gains `ran` and `skipped`, and the exit code is still `11` when any step failed.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 2fd3d61: The GitHub provider lists the swept remote's own repository (`gh pr list --repo <host>/<project>`) instead of the one `gh` prefers, so a fork's branches are no longer judged against the upstream's PRs. It reads every open PR (up to 1000) apart from the newest 300 of any state, and both providers now report a listing that stopped short, or one for a fork whose PRs to its parent were not checked, as incomplete: the sweep adds a note and a remote branch with no known PR needs `confirm-open-pr`.
|
|
32
|
+
- cbb1040: The default process probe runs `ps` under `TZ=UTC` and `LC_ALL=C` and reads `lstart` as UTC, so the repeated hour of a DST fall-back and a non-English locale can no longer make a live lock owner look gone. A pid that `process.kill(pid, 0)` reports as gone is answered without spawning `ps`. A new `pidExists` option on `defaultProcessProbe` overrides that check.
|
|
33
|
+
- Updated dependencies [976bbee]
|
|
34
|
+
- Updated dependencies [976bbee]
|
|
35
|
+
- Updated dependencies [6d37030]
|
|
36
|
+
- Updated dependencies [f8b19a9]
|
|
37
|
+
- Updated dependencies [976bbee]
|
|
38
|
+
- Updated dependencies [2fd3d61]
|
|
39
|
+
- Updated dependencies [c8470d6]
|
|
40
|
+
- Updated dependencies [0ce8abc]
|
|
41
|
+
- Updated dependencies [9c0f5ae]
|
|
42
|
+
- @osdlc/cli-tool@0.21.0
|
|
43
|
+
- @osdlc/command-seam@0.15.1
|
|
44
|
+
- @osdlc/typed-gh@0.19.0
|
|
45
|
+
- @osdlc/typed-git@0.19.0
|
|
46
|
+
|
|
47
|
+
## 0.21.0
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- b0ff1b3: `clean --archive` (and the `archive` option of `check` and `run`) pushes the work a run would lose to an archive branch on the repository's remote, checks with `ls-remote` that it is there, and only then deletes. A new risk, `discard-archived`, takes the place of `abandon-unmerged` and `discard-changes` on a row whose work the archive holds; a file the snapshot leaves out (secret-shaped, `--archive-exclude`, over 10 MiB) keeps `discard-changes`, and a worktree's submodule work keeps both. A worktree's uncommitted files are snapshotted in a temporary index, so its own index and files are not touched. The receipt gains an `archive` step that records the ref, the sha and what each parent holds. Without `--archive`, `clean` behaves as before. Needs `@osdlc/typed-git` with `readTree` and `writeTree`.
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [b0ff1b3]
|
|
56
|
+
- Updated dependencies [cb56f16]
|
|
57
|
+
- @osdlc/typed-git@0.18.0
|
|
58
|
+
- @osdlc/typed-gh@0.18.2
|
|
59
|
+
|
|
60
|
+
## 0.20.6
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [acf57e6]
|
|
65
|
+
- @osdlc/cli-tool@0.20.0
|
|
66
|
+
|
|
3
67
|
## 0.20.5
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|