@eldrforge/kodrdriv 1.2.29 → 1.2.124

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.
Files changed (84) hide show
  1. package/dist/application.js +16 -13
  2. package/dist/application.js.map +1 -1
  3. package/dist/arguments.js +5 -5
  4. package/dist/arguments.js.map +1 -1
  5. package/dist/commands/audio-review.js +2 -5
  6. package/dist/commands/audio-review.js.map +1 -1
  7. package/dist/commands/clean.js +2 -4
  8. package/dist/commands/clean.js.map +1 -1
  9. package/dist/commands/commit.js +3 -6
  10. package/dist/commands/commit.js.map +1 -1
  11. package/dist/commands/development.js +7 -7
  12. package/dist/commands/development.js.map +1 -1
  13. package/dist/commands/link.js +3 -7
  14. package/dist/commands/link.js.map +1 -1
  15. package/dist/commands/precommit.js +99 -0
  16. package/dist/commands/precommit.js.map +1 -0
  17. package/dist/commands/publish.js +47 -32
  18. package/dist/commands/publish.js.map +1 -1
  19. package/dist/commands/release.js +3 -7
  20. package/dist/commands/release.js.map +1 -1
  21. package/dist/commands/review.js +4 -6
  22. package/dist/commands/review.js.map +1 -1
  23. package/dist/commands/tree.js +213 -84
  24. package/dist/commands/tree.js.map +1 -1
  25. package/dist/commands/unlink.js +3 -7
  26. package/dist/commands/unlink.js.map +1 -1
  27. package/dist/commands/updates.js +2 -4
  28. package/dist/commands/updates.js.map +1 -1
  29. package/dist/commands/versions.js +3 -7
  30. package/dist/commands/versions.js.map +1 -1
  31. package/dist/constants.js +4 -2
  32. package/dist/constants.js.map +1 -1
  33. package/dist/content/files.js +2 -4
  34. package/dist/content/files.js.map +1 -1
  35. package/dist/execution/CommandValidator.js +33 -1
  36. package/dist/execution/CommandValidator.js.map +1 -1
  37. package/dist/execution/ResourceMonitor.js +26 -1
  38. package/dist/execution/ResourceMonitor.js.map +1 -1
  39. package/dist/execution/TreeExecutionAdapter.js +2 -2
  40. package/dist/execution/TreeExecutionAdapter.js.map +1 -1
  41. package/dist/util/checkpointManager.js +2 -4
  42. package/dist/util/checkpointManager.js.map +1 -1
  43. package/dist/util/dependencyGraph.js +2 -4
  44. package/dist/util/dependencyGraph.js.map +1 -1
  45. package/dist/util/general.js +8 -219
  46. package/dist/util/general.js.map +1 -1
  47. package/dist/util/gitMutex.js +63 -18
  48. package/dist/util/gitMutex.js.map +1 -1
  49. package/dist/util/precommitOptimizations.js +310 -0
  50. package/dist/util/precommitOptimizations.js.map +1 -0
  51. package/dist/util/storageAdapter.js +2 -6
  52. package/dist/util/storageAdapter.js.map +1 -1
  53. package/dist/util/validation.js +3 -3
  54. package/dist/util/validation.js.map +1 -1
  55. package/dist/utils/branchState.js +178 -45
  56. package/dist/utils/branchState.js.map +1 -1
  57. package/package.json +6 -5
  58. package/AI-FRIENDLY-LOGGING-GUIDE.md +0 -237
  59. package/AI-LOGGING-MIGRATION-COMPLETE.md +0 -371
  60. package/ALREADY-PUBLISHED-PACKAGES-FIX.md +0 -264
  61. package/AUDIT-BRANCHES-PROGRESS-FIX.md +0 -90
  62. package/AUDIT-EXAMPLE-OUTPUT.md +0 -113
  63. package/CHECKPOINT-RECOVERY-FIX.md +0 -450
  64. package/LOGGING-MIGRATION-STATUS.md +0 -186
  65. package/MONOREPO-PUBLISH-IMPROVEMENTS.md +0 -281
  66. package/PARALLEL-EXECUTION-FIXES.md +0 -132
  67. package/PARALLEL-PUBLISH-DEBUGGING-GUIDE.md +0 -441
  68. package/PARALLEL-PUBLISH-FIXES-IMPLEMENTED.md +0 -405
  69. package/PARALLEL-PUBLISH-IMPROVEMENTS-IMPLEMENTED.md +0 -439
  70. package/PARALLEL-PUBLISH-LOGGING-FIXES.md +0 -274
  71. package/PARALLEL-PUBLISH-QUICK-REFERENCE.md +0 -375
  72. package/PARALLEL_EXECUTION_FIX.md +0 -146
  73. package/PUBLISH_IMPROVEMENTS_IMPLEMENTED.md +0 -294
  74. package/RECOVERY-FIXES.md +0 -72
  75. package/SUBMODULE-LOCK-FIX.md +0 -132
  76. package/VERSION-AUDIT-FIX.md +0 -333
  77. package/WORKFLOW-PRECHECK-IMPLEMENTATION.md +0 -239
  78. package/WORKFLOW-SKIP-SUMMARY.md +0 -121
  79. package/dist/util/safety.js +0 -166
  80. package/dist/util/safety.js.map +0 -1
  81. package/dist/util/stdin.js +0 -133
  82. package/dist/util/stdin.js.map +0 -1
  83. package/dist/util/storage.js +0 -187
  84. package/dist/util/storage.js.map +0 -1
@@ -1,333 +0,0 @@
1
- # Version Consistency Audit Fix
2
-
3
- ## Summary
4
-
5
- Enhanced the `kodrdriv tree publish --audit-branches` command to detect version consistency issues, preventing publish failures caused by packages having release versions on development branches or vice versa.
6
-
7
- ## Problems Fixed
8
-
9
- ### 1. ✅ Audit Misses Version Issues
10
-
11
- **Before**: `--audit-branches` only checked:
12
- - Branch consistency
13
- - Uncommitted changes
14
- - Sync status
15
- - Merge conflicts
16
-
17
- **Did NOT check**:
18
- - Version patterns (dev vs release)
19
- - Whether versions match branch expectations
20
- - Monorepo version alignment
21
-
22
- **After**: Now checks all of the above PLUS:
23
- - ✅ Version patterns for each package
24
- - ✅ Validates versions match branch type
25
- - ✅ Shows clear fix instructions
26
- - ✅ Blocks publish if issues found
27
-
28
- ### 2. ✅ Silent Version Inconsistencies
29
-
30
- **Before**: Developer could have:
31
- ```
32
- ✅ @fjell/common-config: 1.1.37-dev.0 (correct)
33
- ❌ @fjell/logging: 4.4.64 (missing -dev.0 suffix)
34
- ✅ @fjell/core: 4.4.72-dev.0 (correct)
35
- ```
36
-
37
- And `--audit-branches` would say "All OK!" leading to:
38
- - Skipped packages during publish
39
- - Unclear failures
40
- - Wasted debugging time
41
-
42
- **After**: Audit now reports:
43
- ```
44
- ⚠️ Version Issues (1 package):
45
- @fjell/logging
46
- - Branch: working
47
- - Version: 4.4.64
48
- - Issue: Release version on development branch
49
- - Fix: Run kodrdriv development to update to development version
50
- ```
51
-
52
- ## Implementation Details
53
-
54
- ### New Utility Functions (`src/util/general.ts`)
55
-
56
- ```typescript
57
- // Check if version has prerelease tag
58
- export const isDevelopmentVersion = (version: string): boolean
59
-
60
- // Check if version is release version (X.Y.Z)
61
- export const isReleaseVersion = (version: string): boolean
62
-
63
- // Get expected version pattern for branch
64
- export const getExpectedVersionPattern = (branchName: string): {
65
- pattern: RegExp;
66
- description: string;
67
- isDevelopment: boolean;
68
- }
69
-
70
- // Validate version against branch expectations
71
- export const validateVersionForBranch = (version: string, branchName: string): {
72
- valid: boolean;
73
- issue?: string;
74
- fix?: string;
75
- }
76
- ```
77
-
78
- ### Enhanced Branch Audit (`src/utils/branchState.ts`)
79
-
80
- Added new interfaces:
81
- ```typescript
82
- interface VersionStatus {
83
- version: string;
84
- isValid: boolean;
85
- issue?: string;
86
- fix?: string;
87
- }
88
-
89
- interface PackageBranchAudit {
90
- packageName: string;
91
- path: string;
92
- status: BranchStatus;
93
- versionStatus?: VersionStatus; // NEW
94
- issues: string[];
95
- fixes: string[];
96
- }
97
-
98
- interface BranchAuditResult {
99
- totalPackages: number;
100
- goodPackages: number;
101
- issuesFound: number;
102
- versionIssues: number; // NEW
103
- audits: PackageBranchAudit[];
104
- }
105
- ```
106
-
107
- ### Version Pattern Rules
108
-
109
- **Development Branches** (`working`, `development`, `dev`, `feature/*`, `wip/*`):
110
- - **Expected**: `X.Y.Z-<tag>` (e.g., `1.2.3-dev.0`)
111
- - **Invalid**: `X.Y.Z` (release versions)
112
- - **Fix**: `kodrdriv development`
113
-
114
- **Release Branches** (`main`, `master`, `production`, `release/*`):
115
- - **Expected**: `X.Y.Z` (e.g., `1.2.3`)
116
- - **Invalid**: `X.Y.Z-<tag>` (development versions)
117
- - **Fix**: Do not commit dev versions to release branches
118
-
119
- **Other Branches**:
120
- - **Expected**: Either format acceptable
121
- - **No strict validation**
122
-
123
- ### Enhanced Audit Output
124
-
125
- ```
126
- ╔══════════════════════════════════════════════════════════════╗
127
- ║ Branch State Audit (16 packages) ║
128
- ║ All packages on: working ║
129
- ╠══════════════════════════════════════════════════════════════╣
130
-
131
- ✅ Good State (15 packages):
132
- @fjell/common-config (v1.1.37-dev.0)
133
- @fjell/core (v4.4.72-dev.0)
134
- @fjell/http-api (v4.4.62-dev.0)
135
- ...
136
-
137
- ⚠️ Version Issues (1 package):
138
- @fjell/logging
139
- - Branch: working
140
- - Version: 4.4.64
141
- - Issue: Release version on development branch
142
- - Fix: Run kodrdriv development to update to development version
143
-
144
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
145
- 📝 RECOMMENDED WORKFLOW:
146
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
147
-
148
- 1️⃣ FIX VERSION ISSUES (recommended before publish):
149
- • @fjell/logging: cd logging && kodrdriv development
150
-
151
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
152
-
153
- 🔄 After fixing issues, re-run audit to verify:
154
- kodrdriv tree publish --audit-branches
155
-
156
- ✅ Once all clear, proceed with publish:
157
- kodrdriv tree publish --parallel --model "gpt-5-mini"
158
-
159
- ╚══════════════════════════════════════════════════════════════╝
160
-
161
- ⚠️ Found issues in 1 package(s). Review the fixes above.
162
- 1 package(s) have version consistency issues
163
- Run 'kodrdriv development' in each package to fix version issues
164
- ```
165
-
166
- ### Integration with Tree Commands
167
-
168
- Enhanced tree.ts audit handling:
169
- ```typescript
170
- const auditResult = await auditBranchState(packages, undefined, {
171
- targetBranch,
172
- checkPR: true,
173
- checkConflicts: true,
174
- checkVersions: true, // NEW - enabled by default
175
- });
176
-
177
- if (auditResult.issuesFound > 0 || auditResult.versionIssues > 0) {
178
- const totalIssues = auditResult.issuesFound + (auditResult.versionIssues || 0);
179
- logger.warn(`Found issues in ${totalIssues} package(s)`);
180
-
181
- if (auditResult.versionIssues > 0) {
182
- logger.warn(`${auditResult.versionIssues} package(s) have version consistency issues`);
183
- }
184
- }
185
- ```
186
-
187
- ## Real-World Usage
188
-
189
- ### Before This Fix
190
-
191
- ```bash
192
- $ kodrdriv tree publish --audit-branches
193
- ✅ All 16 packages are in good state!
194
-
195
- $ kodrdriv tree publish --parallel
196
- # Publishes, but skips @fjell/logging
197
- # Developer confused: "Why was logging skipped? It had changes!"
198
- # 30 minutes debugging to find: version was 4.4.64 instead of 4.4.64-dev.0
199
- ```
200
-
201
- ### After This Fix
202
-
203
- ```bash
204
- $ kodrdriv tree publish --audit-branches
205
-
206
- ⚠️ Version Issues (1 package):
207
- @fjell/logging
208
- - Branch: working
209
- - Version: 4.4.64
210
- - Issue: Release version on development branch
211
- - Fix: Run kodrdriv development to update to development version
212
-
213
- 1️⃣ FIX VERSION ISSUES (recommended before publish):
214
- • @fjell/logging: cd logging && kodrdriv development
215
-
216
- ⚠️ Found issues in 1 package(s). Review the fixes above.
217
-
218
- $ cd logging && kodrdriv development
219
- ✓ Updated to 4.4.65-dev.0
220
-
221
- $ kodrdriv tree publish --audit-branches
222
- ✅ All 16 packages are in good state!
223
-
224
- $ kodrdriv tree publish --parallel
225
- # All packages publish successfully
226
- ```
227
-
228
- ## Files Modified
229
-
230
- ```
231
- src/util/general.ts - Added version validation utilities
232
- src/utils/branchState.ts - Enhanced audit with version checking
233
- src/commands/tree.ts - Enabled version checking in audit
234
- tests/utils/branchState.test.ts - Updated tests for new fields
235
- VERSION-AUDIT-FIX.md - This documentation
236
- ```
237
-
238
- ## Test Updates
239
-
240
- Updated existing tests to include new `versionIssues` field:
241
- ```typescript
242
- const result: BranchAuditResult = {
243
- totalPackages: 2,
244
- goodPackages: 2,
245
- issuesFound: 0,
246
- versionIssues: 0, // NEW
247
- audits: [...]
248
- };
249
- ```
250
-
251
- ## Backward Compatibility
252
-
253
- ✅ **Fully backward compatible**
254
- - Version checking enabled by default (can be disabled with `checkVersions: false`)
255
- - Existing audit functionality unchanged
256
- - New fields added to interfaces (optional in most contexts)
257
-
258
- ## Impact
259
-
260
- ### Before
261
- - ❌ Version issues discovered during publish (too late)
262
- - ❌ Unclear why packages skipped
263
- - ❌ 30+ minutes debugging per issue
264
- - ❌ No pre-flight validation
265
-
266
- ### After
267
- - ✅ Version issues caught in audit (before publish)
268
- - ✅ Clear fix instructions shown
269
- - ✅ 2 minutes to identify and fix
270
- - ✅ Confidence before publishing
271
-
272
- ## Remaining Work (Future Enhancements)
273
-
274
- ### 1. Tree Development Command (Not Implemented)
275
-
276
- User requested but not yet implemented:
277
- ```bash
278
- kodrdriv tree development
279
- ```
280
-
281
- Would update ALL packages in monorepo to development versions in one command.
282
-
283
- **Current Workaround**: Run `kodrdriv development` in each package individually, or use the audit to identify which packages need updating.
284
-
285
- ### 2. Smart Monorepo Detection (Not Implemented)
286
-
287
- User requested: When running `kodrdriv development` in one package, detect monorepo and ask:
288
- ```
289
- 📦 Detected monorepo: 16 packages found
290
- Update only this package, or all packages in monorepo? [single/all]
291
- ```
292
-
293
- **Current Behavior**: Only updates current package.
294
-
295
- ### 3. Automated Version Alignment (Not Implemented)
296
-
297
- User requested: Automatically update all packages when one is updated.
298
-
299
- **Current Behavior**: Manual per-package updates required.
300
-
301
- ## Priority Assessment
302
-
303
- **COMPLETED (This PR)**:
304
- - ✅ Version consistency checking in audit
305
- - ✅ Clear error messages and fix instructions
306
- - ✅ Integration with existing workflows
307
-
308
- **FUTURE (Lower Priority)**:
309
- - Tree development command (nice-to-have)
310
- - Automatic monorepo-wide updates (quality-of-life)
311
- - Smart monorepo detection (convenience)
312
-
313
- The core issue (audit missing version problems) is **FIXED**. The remaining items are enhancements that improve convenience but don't block workflows.
314
-
315
- ## Version
316
-
317
- Implemented in: **kodrdriv 1.2.29-dev.0**
318
-
319
- ---
320
-
321
- ## Example Test Case
322
-
323
- Given monorepo with 3 packages:
324
- - package-a: 1.0.0-dev.0 on `working` branch ✓
325
- - package-b: 2.0.0 on `working` branch ✗ (missing -dev.0)
326
- - package-c: 3.0.0-dev.0 on `working` branch ✓
327
-
328
- Running `kodrdriv tree publish --audit-branches`:
329
- - ✅ Reports version issue in package-b
330
- - ✅ Provides fix command
331
- - ✅ Returns non-zero exit code
332
- - ✅ Prevents publish from proceeding until fixed
333
-
@@ -1,239 +0,0 @@
1
- # Workflow Precheck Implementation
2
-
3
- ## Problem Statement
4
-
5
- The `kodrdriv publish` command was freezing when running in the getfjell/http-api repository during the `publish-tree` operation.
6
-
7
- ### Root Cause
8
-
9
- The workflow file at `~/gitw/getfjell/http-api/.github/workflows/test.yml` is configured with:
10
-
11
- ```yaml
12
- on:
13
- push:
14
- branches:
15
- - main
16
- - working
17
- - 'feature/**'
18
- ```
19
-
20
- **The problem:** This workflow triggers on `push` events but **NOT on `pull_request` events**.
21
-
22
- When `kodrdriv publish`:
23
- 1. Creates a new branch and pushes commits ✅
24
- 2. Creates a pull request ✅
25
- 3. Waits for PR checks to complete using `waitForPullRequestChecks()` ❌
26
-
27
- The `waitForPullRequestChecks()` function queries the GitHub API for check runs associated with the PR. Because the workflow only triggers on `push` (not `pull_request`), GitHub doesn't associate those workflow runs with the PR, so the API returns no checks.
28
-
29
- The function was designed to detect this after 1 minute (6 consecutive checks with no results), but in your case it was likely stuck in a detection loop or the command was running with `skipUserConfirmation: true` which caused it to wait for the full 1-hour timeout.
30
-
31
- ## Solution
32
-
33
- I've implemented **two complementary improvements** to prevent this issue:
34
-
35
- ### 1. Workflow Validation Precheck (runs before PR creation)
36
- ### 2. Smart Wait Skipping (skips waiting if no PR workflows detected)
37
-
38
- ### Changes Made
39
-
40
- #### 1. Workflow Validation Precheck
41
-
42
- **New function** `checkWorkflowConfiguration()` in `@eldrforge/github-tools` that:
43
- - Lists all workflows in the repository
44
- - Analyzes each workflow file's YAML content
45
- - Determines if workflows will be triggered by PRs to the target branch
46
- - Returns detailed information about workflow configuration
47
-
48
- **Location:** `~/gitw/calenvarek/github-tools/src/github.ts`
49
-
50
- **Example output:**
51
- ```typescript
52
- {
53
- hasWorkflows: true,
54
- workflowCount: 4,
55
- hasPullRequestTriggers: false, // ⚠️ This is the warning
56
- triggeredWorkflowNames: [],
57
- warning: "4 workflow(s) are configured, but none appear to trigger on pull requests to main"
58
- }
59
- ```
60
-
61
- #### 2. Smart Wait Skipping
62
-
63
- **After** the PR is created, the publish command now checks the workflow configuration again and **skips waiting entirely** if no workflows will trigger on the PR.
64
-
65
- **Location:** `~/gitw/calenvarek/kodrdriv/src/commands/publish.ts` (lines 833-850)
66
-
67
- **Output when skipping:**
68
- ```
69
- Waiting for PR #75 checks to complete...
70
- ⏭️ Skipping check wait - no workflows configured to trigger on this PR
71
- ```
72
-
73
- This prevents the command from freezing when workflows exist but don't trigger on PRs.
74
-
75
- #### 3. Improved Detection in `waitForPullRequestChecks`
76
-
77
- Made the wait function smarter and faster:
78
- - **Reduced wait time**: Now checks after 30 seconds instead of 1 minute
79
- - **Better detection**: Distinguishes between "no workflow runs" vs "workflow runs exist on branch but aren't PR checks"
80
- - **Explicit handling**: When workflows trigger on `push` but not `pull_request`, it detects this and proceeds without waiting
81
-
82
- **Location:** `~/gitw/calenvarek/github-tools/src/github.ts`
83
-
84
- **Key improvements:**
85
- ```typescript
86
- // Changed from 6 checks (1 minute) to 3 checks (30 seconds)
87
- const maxConsecutiveNoChecks = 3;
88
-
89
- // New logic to detect workflows that trigger on push but not pull_request
90
- logger.info(`Found workflow runs on the branch, but none appear as PR checks.`);
91
- logger.info(`This usually means workflows trigger on 'push' but not 'pull_request'.`);
92
- // ... proceeds without waiting in non-interactive mode
93
- ```
94
-
95
- #### 4. Precheck Warning
96
-
97
- Modified the `runPrechecks()` function to call `checkWorkflowConfiguration()` and warn users before creating the PR.
98
-
99
- **Location:** `~/gitw/calenvarek/kodrdriv/src/commands/publish.ts` (lines 244-267)
100
-
101
- **Output when workflows are missing:**
102
- ```
103
- Checking GitHub Actions workflow configuration...
104
- ⚠️ Found 4 workflow(s), but none are triggered by PRs to main.
105
- The publish process will create a PR but will not wait for any checks to complete.
106
- Consider updating workflow triggers to include: on.pull_request.branches: [main]
107
- ```
108
-
109
- #### 5. Tests
110
-
111
- Created comprehensive test suite with 8 test cases covering:
112
- - No workflows configured
113
- - Workflows with `pull_request` triggers
114
- - Workflows without `pull_request` triggers
115
- - Branch-specific triggers
116
- - Wildcard patterns
117
- - Multiple workflows with mixed configurations
118
- - API error handling
119
-
120
- **Location:** `~/gitw/calenvarek/github-tools/tests/checkWorkflowConfiguration.test.ts`
121
-
122
- **Result:** All 8 tests passing ✅
123
-
124
- ## How to Fix the http-api Workflow
125
-
126
- Update `~/gitw/getfjell/http-api/.github/workflows/test.yml`:
127
-
128
- ```yaml
129
- name: Run Tests
130
-
131
- on:
132
- push:
133
- branches:
134
- - main
135
- - working
136
- - 'feature/**'
137
- pull_request: # ← ADD THIS
138
- branches:
139
- - main
140
-
141
- permissions:
142
- contents: read
143
- statuses: write
144
-
145
- jobs:
146
- test:
147
- runs-on: ubuntu-latest
148
- steps:
149
- - uses: actions/checkout@v4
150
- - uses: actions/setup-node@v4
151
- with:
152
- node-version: 22
153
-
154
- - run: npm ci
155
- - run: npm run lint
156
- - run: npm run build
157
- - run: npm test
158
-
159
- - uses: codecov/codecov-action@v5
160
- with:
161
- slug: getfjell/http-api
162
- token: ${{ secrets.CODECOV_TOKEN }}
163
- ```
164
-
165
- **What this does:**
166
- - Triggers the workflow when PRs are opened/updated targeting `main` branch
167
- - GitHub will now associate the check runs with the PR
168
- - `kodrdriv publish` will detect the checks and wait for them to complete
169
- - The PR merge will only proceed after checks pass ✅
170
-
171
- ## Testing the Fix
172
-
173
- After updating the workflow file and rebuilding:
174
-
175
- 1. **Test the precheck:**
176
- ```bash
177
- cd ~/gitw/getfjell/http-api
178
- kodrdriv publish --dry-run
179
- ```
180
-
181
- Before fix: Would warn about missing PR triggers
182
- After fix: Should show workflow will run on PRs ✅
183
-
184
- 2. **Test actual publish:**
185
- ```bash
186
- kodrdriv publish
187
- ```
188
-
189
- Should now:
190
- - Create PR
191
- - Detect workflow runs
192
- - Wait for checks to complete
193
- - Merge when checks pass
194
-
195
- ## Related Files Modified
196
-
197
- ### github-tools package:
198
- - `~/gitw/calenvarek/github-tools/src/github.ts` - Added `checkWorkflowConfiguration()` and `isTriggeredByPullRequest()`
199
- - `~/gitw/calenvarek/github-tools/src/index.ts` - Exported new function
200
- - `~/gitw/calenvarek/github-tools/tests/checkWorkflowConfiguration.test.ts` - New test file
201
-
202
- ### kodrdriv package:
203
- - `~/gitw/calenvarek/kodrdriv/src/commands/publish.ts` - Added workflow validation to prechecks
204
-
205
- Both packages have been built and all tests pass.
206
-
207
- ## Future Improvements
208
-
209
- Consider adding:
210
- 1. Configuration option to skip workflow validation if desired
211
- 2. Ability to specify minimum required workflows
212
- 3. Integration with workflow file templates for new projects
213
-
214
- ## Summary
215
-
216
- **What was frozen:** The `kodrdriv publish` command waiting for PR checks that never appeared
217
-
218
- **Why it happened:** The workflow triggers on `push` but not `pull_request`, so GitHub doesn't associate runs with the PR
219
-
220
- **How we fixed it:**
221
- 1. ✅ **Precheck Warning**: Validates workflow configuration before creating the PR and warns about missing triggers
222
- 2. ✅ **Smart Wait Skipping**: Automatically skips waiting if no workflows will trigger on the PR (no more freezing!)
223
- 3. ✅ **Improved Detection**: Detects within 30 seconds when workflows exist on branch but aren't PR checks
224
-
225
- **How to fix your workflow:** Add `pull_request` trigger to your workflow files (see above)
226
-
227
- **Current state:**
228
- - ✅ Precheck implemented and warns users
229
- - ✅ Smart skip logic prevents freezing
230
- - ✅ Faster detection (30s instead of 1 minute)
231
- - ✅ Better error messages
232
- - ✅ All tests passing (8/8)
233
- - ✅ Both packages built
234
- - ⚠️ http-api workflow needs updating for best experience (see above)
235
-
236
- **Behavior now:**
237
- - **Before fix**: Command would freeze for up to 1 hour waiting for checks
238
- - **After fix**: Command detects the issue within 30 seconds and proceeds automatically in non-interactive mode, or prompts user in interactive mode
239
-
@@ -1,121 +0,0 @@
1
- # Smart Workflow Wait Skipping - Implementation Summary
2
-
3
- ## The Problem You Asked About
4
-
5
- > "If there is no action fired from a pull request workflow, can we just not wait for it to complete?"
6
-
7
- **Answer: YES! ✅ Now implemented.**
8
-
9
- ## What I've Added
10
-
11
- ### 1. Pre-check Before Creating PR
12
- The publish command now checks workflow configuration **before** creating the PR and warns you:
13
-
14
- ```
15
- Checking GitHub Actions workflow configuration...
16
- ⚠️ Found 4 workflow(s), but none are triggered by PRs to main.
17
- The publish process will create a PR but will not wait for any checks to complete.
18
- ```
19
-
20
- ### 2. **Smart Skip After Creating PR** ⭐ (This is what you asked for!)
21
- After the PR is created, the command checks workflow configuration again and **skips waiting entirely**:
22
-
23
- ```
24
- Waiting for PR #75 checks to complete...
25
- ⏭️ Skipping check wait - no workflows configured to trigger on this PR
26
- ```
27
-
28
- **No more freezing!** The command proceeds immediately instead of waiting.
29
-
30
- ### 3. Faster Detection When Checks Won't Appear
31
- If we can't determine workflow configuration in advance, the wait logic now:
32
- - Detects the issue in **30 seconds** instead of 1 minute
33
- - Distinguishes between "no workflows" vs "workflows exist but don't trigger on PRs"
34
- - Automatically proceeds in non-interactive mode (like in `publish-tree`)
35
-
36
- ## How It Works
37
-
38
- ```typescript
39
- // In publish.ts - after PR is created
40
- const workflowConfig = await GitHub.checkWorkflowConfiguration(targetBranch);
41
- if (!workflowConfig.hasWorkflows || !workflowConfig.hasPullRequestTriggers) {
42
- logger.info('⏭️ Skipping check wait - no workflows configured to trigger on this PR');
43
- shouldSkipWait = true;
44
- }
45
- ```
46
-
47
- The command:
48
- 1. Checks if workflows are configured
49
- 2. Checks if any workflows will trigger on this PR
50
- 3. If NO → skips waiting entirely
51
- 4. If YES → waits for checks as normal
52
-
53
- ## Timeline Comparison
54
-
55
- ### Before These Changes:
56
- ```
57
- Create PR ✓
58
- Wait for checks...
59
- [10s] No checks found
60
- [20s] No checks found
61
- [30s] No checks found
62
- [40s] No checks found
63
- [50s] No checks found
64
- [60s] No checks found - checking workflows...
65
- [70s] Workflows exist, checking if triggered for PR...
66
- [80s] Found runs on branch...
67
- ... continues waiting or hangs ...
68
- ```
69
-
70
- ### After These Changes:
71
- ```
72
- Precheck: Workflows exist but don't trigger on PRs ⚠️
73
- Create PR ✓
74
- Check workflow config again...
75
- ⏭️ Skipping check wait - no workflows configured to trigger on this PR
76
- Merge PR ✓
77
- ```
78
-
79
- **Time saved per publish:** Up to 60 minutes (if you were hitting the timeout!)
80
-
81
- ## What Gets Detected
82
-
83
- The smart skip detects:
84
- - ❌ No workflows configured at all
85
- - ❌ Workflows configured but none trigger on `pull_request` events
86
- - ❌ Workflows trigger on PRs but not to your target branch (e.g., only to `develop`)
87
- - ✅ Workflows will run on this PR → waits normally
88
-
89
- ## For Your http-api Repository
90
-
91
- The command will now:
92
- 1. **Warn during precheck**: "4 workflow(s) configured, but none trigger on PRs to main"
93
- 2. **Skip waiting**: Proceeds immediately after creating the PR
94
- 3. **No freezing**: Command completes successfully
95
-
96
- To get actual CI checks on your PRs (recommended), add to `test.yml`:
97
- ```yaml
98
- on:
99
- push:
100
- branches: [main, working, 'feature/**']
101
- pull_request: # ← Add this
102
- branches: [main]
103
- ```
104
-
105
- ## Testing
106
-
107
- Run your `publish-tree` command again - it should now:
108
- - Complete much faster (no 1-hour wait!)
109
- - Show skip messages for repos without PR workflows
110
- - Wait normally for repos with PR workflows
111
- - Never freeze
112
-
113
- ## Files Modified
114
-
115
- - `github-tools/src/github.ts` - Added `checkWorkflowConfiguration()`, improved `waitForPullRequestChecks()`
116
- - `github-tools/src/index.ts` - Exported new function
117
- - `kodrdriv/src/commands/publish.ts` - Added precheck + smart skip logic
118
- - `github-tools/tests/checkWorkflowConfiguration.test.ts` - 8 comprehensive tests (all passing)
119
-
120
- Both packages rebuilt and ready to use! ✅
121
-