Skip to content

Commit b8643db

Browse files
authored
Merge pull request #318 from tbrandenburg/fix/issue-293-stale-submodule
2 parents bd5aa40 + 01c089d commit b8643db

File tree

2 files changed

+158
-1
lines changed

2 files changed

+158
-1
lines changed
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Investigation: Git Process Failures - Multiple workflows failing with exit code 128
2+
3+
**Issue**: #293 (https://github.com/tbrandenburg/made/issues/293)
4+
**Type**: BUG
5+
**Investigated**: 2026-03-14T12:00:00Z
6+
7+
### Assessment
8+
9+
| Metric | Value | Reasoning |
10+
| ---------- | ----------------------------- | ------------------------------------------------------------------------ |
11+
| Severity | MEDIUM | Workflows fail with exit code 128 but tests still pass; the failure is in post-checkout cleanup, not core functionality |
12+
| Complexity | LOW | Single file change needed to remove stale submodule reference; isolated to repository configuration |
13+
| Confidence | HIGH | Root cause clearly identified in git logs: "fatal: No url found for submodule path 'examples/kiro-cli' in .gitmodules" |
14+
15+
---
16+
17+
## Problem Statement
18+
19+
GitHub Actions workflows are failing with exit code 128 during post-checkout cleanup steps. The error occurs because there's a stale submodule reference (`examples/kiro-cli`) in the git tree without a corresponding `.gitmodules` file. This causes the `git submodule foreach` command in GitHub Actions' post-checkout hook to fail.
20+
21+
---
22+
23+
## Analysis
24+
25+
### Root Cause Analysis (5 Whys)
26+
27+
**WHY**: Git operations fail with exit code 128 in GitHub Actions
28+
↓ BECAUSE: The post-checkout step runs `git submodule foreach --recursive` which fails
29+
↓ BECAUSE: There's no `.gitmodules` file but git references a submodule at `examples/kiro-cli`
30+
↓ BECAUSE: The repository tree contains a submodule entry (`160000` mode) pointing to commit `0d70cfa2f561e386bc66ed57be0f499b293cc63d` but the `.gitmodules` configuration was removed
31+
32+
**ROOT CAUSE**: Stale submodule reference exists in git tree without .gitmodules file
33+
34+
### Evidence Chain
35+
36+
```bash
37+
# Evidence 1: Git ls-tree shows submodule entry
38+
$ git ls-tree HEAD examples/kiro-cli
39+
160000 commit 0d70cfa2f561e386bc66ed57be0f499b293cc63d examples/kiro-cli
40+
41+
# Evidence 2: Git submodule status fails
42+
$ git submodule status
43+
fatal: no submodule mapping found in .gitmodules for path 'examples/kiro-cli'
44+
45+
# Evidence 3: GitHub Actions log shows exact error
46+
2026-03-14T19:40:18.1613518Z fatal: No url found for submodule path 'examples/kiro-cli' in .gitmodules
47+
2026-03-14T19:40:18.1660175Z ##[warning]The process '/usr/bin/git' failed with exit code 128
48+
```
49+
50+
### Affected Files
51+
52+
| File | Lines | Action | Description |
53+
| --------------- | ----- | ------ | -------------- |
54+
| N/A (submodule) | N/A | DELETE | Remove submodule reference via git rm --cached |
55+
56+
### Integration Points
57+
58+
- GitHub Actions `actions/checkout@v4` - triggers post-checkout cleanup which runs submodule commands
59+
- No source code files are affected
60+
61+
### Git History
62+
63+
- **Introduced**: Unknown - the submodule reference was present in commit `766dbd96da1ebe7cdb949be78836af784c946bf8` (current main)
64+
- **Implication**: Long-standing issue that manifests in CI due to post-checkout hook
65+
66+
---
67+
68+
## Implementation Plan
69+
70+
### Step 1: Remove stale submodule reference
71+
72+
**Command**:
73+
```bash
74+
git rm --cached examples/kiro-cli
75+
rm -rf .git/modules/examples/kiro-cli 2>/dev/null || true
76+
```
77+
78+
**Why**: The submodule entry in the git index points to a non-existent commit and has no .gitmodules configuration. Removing it will fix the CI failure.
79+
80+
**Note**: The `examples/kiro-cli` directory is empty anyway (contains only `.` and `..`).
81+
82+
---
83+
84+
### Step 2: Commit the change
85+
86+
```bash
87+
git commit -m "fix: remove stale submodule reference for examples/kiro-cli
88+
89+
The submodule was never properly configured with a .gitmodules file,
90+
causing 'git submodule foreach' to fail in CI with:
91+
'fatal: No url found for submodule path examples/kiro-cli in .gitmodules'
92+
93+
This removes the broken submodule reference from the repository index."
94+
```
95+
96+
---
97+
98+
## Patterns to Follow
99+
100+
**Not applicable** - This is a repository configuration issue, not a code pattern.
101+
102+
---
103+
104+
## Edge Cases & Risks
105+
106+
| Risk/Edge Case | Mitigation |
107+
| -------------- | --------------- |
108+
| Submodule was intentionally added for a reason | The directory is empty and the submodule reference is broken; no functional code depends on it |
109+
| Remote repository might become available later | If needed, the submodule can be re-added properly with a working .gitmodules |
110+
111+
---
112+
113+
## Validation
114+
115+
### Automated Checks
116+
117+
```bash
118+
# Verify no more submodule issues
119+
git submodule status
120+
121+
# Verify the directory is no longer tracked as submodule
122+
git ls-tree HEAD examples/kiro-cli # Should return error or file content, not submodule mode 160000
123+
124+
# Run a test checkout to ensure post-checkout hook works
125+
git checkout HEAD -- .
126+
```
127+
128+
### Manual Verification
129+
130+
1. Push the fix to a branch and verify GitHub Actions workflow passes without the exit code 128 error
131+
132+
---
133+
134+
## Scope Boundaries
135+
136+
**IN SCOPE:**
137+
- Remove the broken submodule reference from git index
138+
139+
**OUT OF SCOPE (do not touch):**
140+
- Any source code changes
141+
- Docker or CI configuration files
142+
- The empty `examples/kiro-cli` directory (can be removed separately if desired)
143+
144+
---
145+
146+
## Metadata
147+
148+
- **Investigated by**: GHAR
149+
- **Timestamp**: 2026-03-14T12:00:00Z
150+
- **Artifact**: `.ghar/issues/issue-293.md`
151+
152+
---
153+
154+
## Implementation Completed
155+
156+
- **Branch**: `fix/issue-293-stale-submodule`
157+
- **PR**: #318 (https://github.com/tbrandenburg/made/pull/318)
158+
- **Committed**: `7acd9fa` - fix: remove stale submodule reference for examples/kiro-cli

examples/kiro-cli

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)