Skip to content

Commit 4fdc869

Browse files
committed
switch to wetrun
1 parent d4dad77 commit 4fdc869

12 files changed

Lines changed: 102 additions & 100 deletions

.changeset/odd-seas-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuzdev/fuz_gitops': minor
3+
---
4+
5+
switch to `wetrun`

CLAUDE.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Publishing uses fixed-point iteration to handle transitive dependency updates:
6363
- Auto-changesets trigger republishing in subsequent passes (transitive
6464
cascades)
6565
- Stops when no new changesets are created (converged state)
66-
- Single `gro gitops_publish` command handles full dependency cascades
66+
- Single `gro gitops_publish --wetrun` command handles full dependency cascades
6767
- If MAX_ITERATIONS reached without convergence, warns with pending package
6868
count and estimated iterations needed
6969

@@ -145,13 +145,13 @@ Requires `SECRET_GITHUB_API_TOKEN` in `.env` for API access.
145145

146146
#### Publishing Workflow
147147

148-
- `gro gitops_publish` - publishes repos in dependency order
148+
- `gro gitops_publish --wetrun` - publishes repos in dependency order
149149
- Uses fixed-point iteration to handle transitive dependency updates
150150
- Converges after multiple passes (max 10 iterations)
151151
- Creates auto-changesets for dependent packages during publishing
152152
- `gro gitops_plan` - generates a publishing plan (read-only prediction)
153153
- `gro gitops_analyze` - analyzes dependencies and changesets
154-
- `gro gitops_publish --dry_run` - simulates publishing without preflight checks
154+
- `gro gitops_publish` - simulates publishing (dry run) without preflight checks
155155
or state persistence
156156
- Handles circular dev dependencies by excluding from topological sort
157157
- Waits for NPM propagation with exponential backoff (10 minute default
@@ -162,7 +162,7 @@ Requires `SECRET_GITHUB_API_TOKEN` in `.env` for API access.
162162
publishing dependents
163163
- Updates cross-repo dependencies automatically
164164
- Preflight checks validate clean workspaces, branches, builds, and npm
165-
authentication (skipped for --dry_run runs)
165+
authentication (skipped for dry runs)
166166

167167
**Build Validation (Fail-Fast Safety)**
168168

@@ -218,7 +218,7 @@ The publishing workflow automatically installs dependencies after package.json u
218218
auto-generated changesets, and no changes
219219
- No side effects - does not modify any files or state
220220

221-
`gro gitops_publish --dry_run`:
221+
`gro gitops_publish` (dry run, default):
222222

223223
- **Simulated execution** - Runs the same code path as real publishing
224224
- Skips preflight checks (workspace, branch, npm auth)
@@ -324,14 +324,14 @@ gro gitops_run "npm audit" --concurrency 3 # limit parallelism
324324
gro gitops_run "gro check" --format json # JSON output for scripting
325325

326326
# Publishing
327-
gro gitops_validate # validate configuration (runs analyze, plan, and dry run)
328-
gro gitops_analyze # analyze dependencies and changesets
329-
gro gitops_plan # generate publishing plan
330-
gro gitops_plan --verbose # show additional details
331-
gro gitops_publish # publish repos in dependency order (interactive y/n prompt)
332-
gro gitops_publish --dry_run # dry run without preflight checks
333-
gro gitops_publish --no-plan # skip interactive plan confirmation
334-
gro gitops_publish --verbose # show additional details in plan
327+
gro gitops_validate # validate configuration (runs analyze, plan, and dry run)
328+
gro gitops_analyze # analyze dependencies and changesets
329+
gro gitops_plan # generate publishing plan
330+
gro gitops_plan --verbose # show additional details
331+
gro gitops_publish # dry run (default, simulates publishing)
332+
gro gitops_publish --wetrun # actually publish repos in dependency order
333+
gro gitops_publish --wetrun --no-plan # skip interactive plan confirmation
334+
gro gitops_publish --verbose # show additional details in plan
335335

336336
# Output formats (analyze, plan, publish)
337337
gro gitops_analyze --format json --outfile analysis.json
@@ -355,7 +355,7 @@ gro test src/test/fixtures/check # validate gitops commands against fixture
355355
- `gro gitops_plan` - Generate publishing plan showing version changes and
356356
cascades
357357
- `gro gitops_validate` - Run all validation checks (analyze + plan + dry run)
358-
- `gro gitops_publish --dry_run` - Simulate publishing without preflight checks
358+
- `gro gitops_publish` - Simulate publishing without preflight checks (dry run default)
359359

360360
**Data Sync (Local Changes Only):**
361361

@@ -376,13 +376,13 @@ gro test src/test/fixtures/check # validate gitops commands against fixture
376376

377377
**Publishing (Git & NPM Side Effects):**
378378

379-
- `gro gitops_publish` - Publish packages, update dependencies, git commits
379+
- `gro gitops_publish --wetrun` - Publish packages, update dependencies, git commits
380380

381381
### Command Workflow
382382

383383
- `gitops_validate` runs: `gitops_analyze` + `gitops_plan` +
384-
`gitops_publish --dry_run`
385-
- `gitops_publish` runs: `gitops_plan` (with confirmation) + actual publish
384+
`gitops_publish` (dry run)
385+
- `gitops_publish --wetrun` runs: `gitops_plan` (with confirmation) + actual publish
386386

387387
## Dependencies
388388

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ gro gitops_sync --download # clone missing repos first
9696
### Diagnostic commands (read-only)
9797

9898
```bash
99-
gro gitops_validate # run all validation checks (analyze + plan + dry run)
100-
gro gitops_analyze # analyze dependency graph and detect cycles
101-
gro gitops_plan # generate publishing plan showing version changes and cascades
102-
gro gitops_publish --dry_run # simulate publishing without side effects
99+
gro gitops_validate # run all validation checks (analyze + plan + dry run)
100+
gro gitops_analyze # analyze dependency graph and detect cycles
101+
gro gitops_plan # generate publishing plan showing version changes and cascades
102+
gro gitops_publish # simulate publishing without side effects (dry run default)
103103
```
104104

105105
### Publishing packages
106106

107107
```bash
108-
gro gitops_publish # publish all repos with changesets (interactive y/n prompt)
109-
gro gitops_publish --no-plan # skip plan confirmation
108+
gro gitops_publish --wetrun # actually publish all repos with changesets
109+
gro gitops_publish --wetrun --no-plan # skip plan confirmation
110110
```
111111

112112
**Note:** If publishing fails, simply re-run the same command. Already-published packages are automatically skipped (changesets consumed), failed packages retried naturally.

docs/publishing.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ gro gitops_validate
2222
# 2. Review what will be published
2323
gro gitops_plan
2424

25-
# 3. Publish
26-
gro gitops_publish
25+
# 3. Publish (after dry run looks good)
26+
gro gitops_publish --wetrun
2727
```
2828

2929
## Changeset Semantics
@@ -84,7 +84,7 @@ production/peer takes priority for dependency graph calculations.
8484
auto-generated changesets, and no changes
8585
- No side effects - does not modify any files or state
8686

87-
### `gro gitops_publish --dry_run`
87+
### `gro gitops_publish` (dry run, default)
8888

8989
- **Simulated execution** - Runs the same code path as real publishing
9090
- Skips preflight checks (workspace, branch, npm auth)
@@ -164,11 +164,11 @@ gro gitops_analyze
164164
# 3. Review plan to see what will be published
165165
gro gitops_plan
166166

167-
# 4. Test with dry run
168-
gro gitops_publish --dry_run
169-
170-
# 5. If everything looks good, publish
167+
# 4. Test with dry run (default)
171168
gro gitops_publish
169+
170+
# 5. If everything looks good, actually publish
171+
gro gitops_publish --wetrun
172172
```
173173

174174
### Output Formats
@@ -195,7 +195,7 @@ gro gitops_plan
195195
# Output shows: my-package: 1.0.0 → 1.1.0 (minor)
196196

197197
# Publish
198-
gro gitops_publish
198+
gro gitops_publish --wetrun
199199
```
200200

201201
### Publishing multiple packages with cascading dependencies
@@ -211,18 +211,18 @@ gro gitops_plan
211211
# @my/ui: 1.5.0 → 2.0.0 (auto-changeset, BREAKING cascade)
212212

213213
# Publish in dependency order
214-
gro gitops_publish
214+
gro gitops_publish --wetrun
215215
```
216216

217217
### Recovering from failures (natural resumption)
218218

219219
```bash
220220
# Publishing failed midway through
221-
gro gitops_publish
221+
gro gitops_publish --wetrun
222222
# Error: Failed to publish @my/package-5
223223

224224
# Fix the issue, then re-run the same command
225-
gro gitops_publish
225+
gro gitops_publish --wetrun
226226
# Already-published packages have no changesets → skipped automatically
227227
# Failed packages still have changesets → retried automatically
228228
```
@@ -240,5 +240,5 @@ gro gitops_plan
240240
# @my/app: 2.0.0 → 3.0.0 (patch → major, escalated)
241241

242242
# Publish handles escalation automatically
243-
gro gitops_publish
243+
gro gitops_publish --wetrun
244244
```

docs/troubleshooting.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ NPM propagation can be slow. Either:
7878
- Increase timeout with `--max-wait` (default is 10 minutes / 600000ms)
7979
- Check NPM registry status
8080
- Verify package was actually published
81-
- If verified published, re-run `gro gitops_publish` to continue
81+
- If verified published, re-run `gro gitops_publish --wetrun` to continue
8282
(already-published packages will be skipped)
8383

8484
## Unexpected Behavior
@@ -118,12 +118,12 @@ Check:
118118
Resumption is **automatic** and **natural**:
119119

120120
1. When `gro publish` succeeds, it consumes changesets
121-
2. Single `gro gitops_publish` run handles full dependency cascades via
121+
2. Single `gro gitops_publish --wetrun` run handles full dependency cascades via
122122
iteration (max 10 passes)
123-
3. If publishing fails mid-way, re-run `gro gitops_publish`:
123+
3. If publishing fails mid-way, re-run `gro gitops_publish --wetrun`:
124124
- Already-published packages have no changesets → skipped automatically
125125
- Failed packages still have changesets → retried automatically
126-
4. No flags needed, no state files, just re-run the same command!
126+
4. No state files needed, just re-run the same command!
127127

128128
This is safer than explicit state tracking because:
129129

@@ -146,8 +146,8 @@ gro gitops_analyze --format markdown --outfile deps.md
146146
# Before publishing
147147
gro gitops_plan --format markdown --outfile plan.md
148148

149-
# After publishing (dry run)
150-
gro gitops_publish --dry_run --format markdown --outfile actual.md
149+
# After publishing (dry run, which is the default)
150+
gro gitops_publish --format markdown --outfile actual.md
151151

152152
# Compare files
153153
diff plan.md actual.md

src/lib/gitops_publish.task.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export const Args = z.strictObject({
2727
.enum(['exact', 'caret', 'tilde'])
2828
.meta({description: 'version strategy for peer dependencies'})
2929
.default('caret' as const),
30-
dry_run: z
31-
.boolean()
32-
.meta({description: 'perform a dry run without actually publishing'})
33-
.default(false),
30+
wetrun: z.boolean().meta({description: 'actually publish (default is dry run)'}).default(false),
3431
format: z
3532
.enum(['stdout', 'json', 'markdown'])
3633
.meta({description: 'output format'})
@@ -63,7 +60,7 @@ export const task: Task<Args> = {
6360
config,
6461
dir,
6562
peer_strategy,
66-
dry_run,
63+
wetrun,
6764
format,
6865
deploy,
6966
plan,
@@ -82,7 +79,7 @@ export const task: Task<Args> = {
8279
});
8380

8481
// Show plan if requested (skip for dry runs)
85-
if (plan && !dry_run) {
82+
if (plan && wetrun) {
8683
log.info(st('cyan', 'Publishing Plan'));
8784
const plan_result = await generate_publishing_plan(repos, {log, verbose});
8885
log_publishing_plan(plan_result, log, {verbose});
@@ -103,7 +100,7 @@ export const task: Task<Args> = {
103100

104101
// Publishing options
105102
const options: PublishingOptions = {
106-
dry_run,
103+
wetrun,
107104
update_deps: true, // Always update dependencies
108105
version_strategy: peer_strategy,
109106
deploy,

src/lib/gitops_validate.task.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ export const task: Task<Args> = {
153153
log.error(st('red', ` ✗ gitops_plan failed: ${error}`));
154154
}
155155

156-
// 3. Run gitops_publish --dry_run
157-
log.info(st('yellow', 'Running gitops_publish --dry_run...'));
156+
// 3. Run gitops_publish (dry run)
157+
log.info(st('yellow', 'Running gitops_publish (dry run)...'));
158158
const dry_start = Date.now();
159159
try {
160160
const options: PublishingOptions = {
161-
dry_run: true,
161+
wetrun: false,
162162
update_deps: true,
163163
log: undefined, // Silent for validation
164164
};
@@ -171,27 +171,27 @@ export const task: Task<Args> = {
171171
const errors = result.ok ? 0 : result.failed.length;
172172

173173
results.push({
174-
command: 'gitops_publish --dry_run',
174+
command: 'gitops_publish (dry run)',
175175
success: result.ok,
176176
warnings: 0,
177177
errors,
178178
duration: dry_duration,
179179
});
180180

181-
log.info(st('green', ` ✓ gitops_publish --dry_run completed in ${dry_duration}ms`));
181+
log.info(st('green', ` ✓ gitops_publish (dry run) completed in ${dry_duration}ms`));
182182
if (errors > 0) {
183183
log.error(st('red', ` ❌ Found ${errors} error(s)`));
184184
}
185185
} catch (error) {
186186
const dry_duration = Date.now() - dry_start;
187187
results.push({
188-
command: 'gitops_publish --dry_run',
188+
command: 'gitops_publish (dry run)',
189189
success: false,
190190
warnings: 0,
191191
errors: 1,
192192
duration: dry_duration,
193193
});
194-
log.error(st('red', ` ✗ gitops_publish --dry_run failed: ${error}`));
194+
log.error(st('red', ` ✗ gitops_publish (dry run) failed: ${error}`));
195195
}
196196

197197
// Summary

0 commit comments

Comments
 (0)