@logickernel/agileflow 0.4.0 → 0.4.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.
@@ -1,341 +1,367 @@
1
1
  # Troubleshooting Guide
2
2
 
3
- This guide helps you resolve common issues when using AgileFlow. If you encounter a problem not covered here, check the community discussions or open an issue in the project repository.
3
+ This guide helps you resolve common issues when using AgileFlow.
4
4
 
5
5
  ## Quick Diagnosis
6
6
 
7
- ### Check Pipeline Status
8
-
9
- First, verify your pipeline status:
7
+ ### Check Your Setup
10
8
 
11
9
  ```bash
12
- # Check if AgileFlow job completed successfully
13
- gitlab-ci status
10
+ # Verify git repository
11
+ git status
14
12
 
15
- # View pipeline logs
16
- gitlab-ci logs agileflow
13
+ # Check existing version tags
14
+ git tag --sort=-version:refname | head -5
17
15
 
18
- # Check if VERSION variable is available
19
- echo $VERSION
16
+ # Preview next version
17
+ npx @logickernel/agileflow
20
18
  ```
21
19
 
22
20
  ### Common Symptoms
23
21
 
24
- - **Pipeline fails on version stage**
25
- - **VERSION variable not available**
26
- - **Build jobs fail with version errors**
27
- - **Deployment inconsistencies**
28
- - **Release notes not generated**
22
+ | Symptom | Likely Cause | Section |
23
+ |---------|--------------|---------|
24
+ | No tag created | Token permissions | [Authentication](#authentication-errors) |
25
+ | Wrong version | Commit format | [Version Generation](#version-generation-issues) |
26
+ | Tag created but no build | Release workflow config | [Release Workflow](#release-workflow-issues) |
29
27
 
30
- ## Installation Issues
28
+ ---
31
29
 
32
- ### Job Token Permissions Not Available
30
+ ## Authentication Errors
33
31
 
34
- **Problem**: You don't see the "Allow Git push requests to the repository" option in GitLab CI/CD settings.
32
+ ### GitHub: "Resource not accessible by integration"
35
33
 
36
- **Solution**:
37
- 1. Check if you're using a self-managed GitLab instance
38
- 2. Enable the feature flag `allow_push_repository_for_job_token`
39
- 3. Ensure you have admin access to the GitLab instance
34
+ **Cause:** Token lacks required permissions.
40
35
 
41
- ```bash
42
- # For self-managed GitLab, enable the feature flag
43
- sudo gitlab-rake gitlab:features:enable allow_push_repository_for_job_token
44
- ```
36
+ **Solution:**
37
+ 1. Create a Fine-grained Personal Access Token
38
+ 2. Grant `Contents: Read and write` permission
39
+ 3. Ensure repository is in token scope
40
+ 4. Update `AGILEFLOW_TOKEN` secret
45
41
 
46
- **Alternative**: Use a personal access token with write permissions to the repository.
42
+ ### GitHub: "Bad credentials"
47
43
 
48
- ### Template Include Fails
44
+ **Cause:** Token invalid or expired.
49
45
 
50
- **Problem**: The AgileFlow template include statement fails with a network error.
46
+ **Solution:**
47
+ 1. Check token hasn't expired
48
+ 2. Regenerate token
49
+ 3. Update secret
51
50
 
52
- **Solutions**:
53
- 1. **Check network connectivity** to `code.logickernel.com`
54
- 2. **Use local template** if remote access is restricted:
51
+ ### GitLab: "403 Forbidden"
55
52
 
56
- ```yaml
57
- # .gitlab-ci.yml
58
- include:
59
- - local: templates/AgileFlow.gitlab-ci.yml
60
- ```
53
+ **Cause:** Token lacks permissions.
61
54
 
62
- 3. **Copy template locally** and include from your repository:
55
+ **Solution:**
56
+ 1. Verify `api` scope
57
+ 2. Ensure `Maintainer` role
58
+ 3. Check token not expired
59
+ 4. For protected branches, ensure variable is protected
63
60
 
64
- ```bash
65
- # Download template to your repository
66
- curl -o templates/AgileFlow.gitlab-ci.yml \
67
- https://code.logickernel.com/kernel/agileflow/-/raw/main/templates/AgileFlow.gitlab-ci.yml
68
- ```
61
+ ### GitLab: "401 Unauthorized"
69
62
 
70
- ### Docker Image Pull Fails
63
+ **Cause:** Invalid or missing token.
71
64
 
72
- **Problem**: Cannot pull the AgileFlow Docker image.
65
+ **Solution:**
66
+ 1. Verify `AGILEFLOW_TOKEN` variable exists
67
+ 2. Check variable protection settings
68
+ 3. Regenerate if needed
73
69
 
74
- **Solutions**:
75
- 1. **Check Docker daemon** is running
76
- 2. **Verify image name** and tag
77
- 3. **Check registry access** and authentication
78
- 4. **Use alternative image** if available
79
-
80
- ```bash
81
- # Test Docker connectivity
82
- docker pull hello-world
83
-
84
- # Check AgileFlow image availability
85
- docker pull registry.logickernel.com/kernel/agileflow:latest
86
- ```
70
+ ---
87
71
 
88
72
  ## Version Generation Issues
89
73
 
90
- ### VERSION Variable Not Available
91
-
92
- **Problem**: The `${VERSION}` variable is not available in subsequent pipeline stages.
74
+ ### No Tag Created
93
75
 
94
- **Causes and Solutions**:
76
+ **Possible causes:**
95
77
 
96
- 1. **AgileFlow job failed**
78
+ 1. **No conventional commits**
97
79
  ```bash
98
- # Check agileflow job status
99
- gitlab-ci logs agileflow
80
+ # Check recent commits
81
+ git log --oneline -10
100
82
 
101
- # Ensure job completed successfully
102
- gitlab-ci status agileflow
83
+ # Should see: feat:, fix:, perf:, etc.
103
84
  ```
104
85
 
105
- 2. **Missing job dependency**
106
- ```yaml
107
- # Good - Proper dependency
108
- build:
109
- stage: build
110
- needs:
111
- - agileflow
112
-
113
- # Bad - No dependency specified
114
- build:
115
- stage: build
86
+ 2. **All commits are docs/chore/style**
87
+ ```bash
88
+ # These don't trigger bumps:
89
+ docs: update README
90
+ chore: update deps
91
+ style: format code
92
+ ```
93
+
94
+ 3. **Not on main branch**
95
+ ```bash
96
+ git branch --show-current
116
97
  ```
117
98
 
118
- ### Version Not Generated
99
+ **Solution:** Include bump-triggering commits (`feat`, `fix`, `perf`, etc.).
119
100
 
120
- **Problem**: AgileFlow doesn't create a new version tag.
101
+ ### Wrong Version Calculated
121
102
 
122
- **Causes and Solutions**:
103
+ **Possible causes:**
123
104
 
124
- 1. **No conventional commits detected**
105
+ 1. **Breaking change not marked**
125
106
  ```bash
126
- # Check commit messages
127
- git log --oneline -10
107
+ # Wrong
108
+ feat: remove old API
128
109
 
129
- # Use conventional commit format
130
- git commit -m "feat: add new feature"
131
- git commit -m "fix: resolve bug"
110
+ # Correct
111
+ feat!: remove old API
132
112
  ```
133
113
 
134
- 2. **No merge to main branch**
114
+ 2. **Wrong commit type**
135
115
  ```bash
136
- # Verify you're on main branch
137
- git branch
116
+ # Wrong
117
+ fix: add new login feature
138
118
 
139
- # Check if changes were merged
140
- git log --oneline --graph
119
+ # Correct
120
+ feat: add new login feature
141
121
  ```
142
122
 
143
- ### Incorrect Version Bumping
123
+ ### Commits Not Recognized
144
124
 
145
- **Problem**: AgileFlow generates the wrong version number.
125
+ **Common mistakes:**
146
126
 
147
- **Causes and Solutions**:
127
+ ```bash
128
+ # Wrong — missing colon
129
+ feat add new feature
148
130
 
149
- 1. **Commit type not recognized**
150
- ```bash
151
- # Use recognized commit types
152
- feat: new feature # Minor version bump
153
- fix: bug fix # Patch version bump
154
- perf: performance improvement # Patch version bump
155
- refactor: code refactoring # Patch version bump
156
- build: build system change # Patch version bump
157
- ci: CI/CD change # Patch version bump
158
- test: test additions/changes # Patch version bump
159
- revert: revert commit # Patch version bump
160
- feat!: breaking change # Major version bump
161
- ```
131
+ # Wrong wrong separator
132
+ feat - add new feature
162
133
 
163
- 2. **Breaking change not properly marked**
164
- ```bash
165
- # Use exclamation mark or footer
166
- feat!: remove deprecated API
167
-
168
- # Or use footer
169
- feat: change API format
170
-
171
- BREAKING CHANGE: API format changed from v1 to v2
172
- ```
134
+ # Wrong capitalized
135
+ Feat: add new feature
173
136
 
174
- 3. **Version calculation logic issues**
175
- ```bash
176
- # Check commit history
177
- git log --oneline --since="1 week ago"
178
-
179
- # Verify conventional commit format
180
- git log --grep="^feat\|^fix\|^perf\|^refactor"
181
- ```
137
+ # Correct
138
+ feat: add new feature
139
+ ```
182
140
 
183
- ## Pipeline Issues
141
+ ---
184
142
 
185
- ### Build Stage Failures
143
+ ## Release Workflow Issues
186
144
 
187
- **Problem**: Build jobs fail with version-related errors.
145
+ ### Tag Created but Build Didn't Run
188
146
 
189
- **Solutions**:
147
+ **Cause:** Release workflow not triggered by tags.
190
148
 
191
- 1. **Check VERSION variable usage**
192
- ```yaml
193
- # ✅ Good - Proper variable usage
194
- build:
195
- script:
196
- - docker build -t myapp:${VERSION} .
197
-
198
- # ❌ Bad - Hardcoded or incorrect variable
199
- build:
200
- script:
201
- - docker build -t myapp:latest .
202
- - docker build -t myapp:$VERSION .
203
- ```
149
+ **GitHub Actions — Check workflow trigger:**
150
+ ```yaml
151
+ # ✅ Correct
152
+ on:
153
+ push:
154
+ tags:
155
+ - 'v*'
156
+
157
+ # ❌ Wrong — only triggers on branch push
158
+ on:
159
+ push:
160
+ branches: [main]
161
+ ```
162
+
163
+ **GitLab CI — Check rules:**
164
+ ```yaml
165
+ # ✅ Correct
166
+ build:
167
+ rules:
168
+ - if: '$CI_COMMIT_TAG =~ /^v/'
169
+
170
+ # ❌ Wrong — only runs on main branch
171
+ build:
172
+ rules:
173
+ - if: '$CI_COMMIT_BRANCH == "main"'
174
+ ```
175
+
176
+ ### Version Not Available in Release Workflow
177
+
178
+ **GitHub Actions:**
179
+ ```yaml
180
+ # Extract version from tag
181
+ - name: Get version
182
+ run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
183
+
184
+ - name: Use version
185
+ run: docker build -t myapp:$VERSION .
186
+ ```
187
+
188
+ **GitLab CI:**
189
+ ```yaml
190
+ # Use CI_COMMIT_TAG directly
191
+ build:
192
+ script:
193
+ - docker build -t myapp:$CI_COMMIT_TAG .
194
+ rules:
195
+ - if: '$CI_COMMIT_TAG =~ /^v/'
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Git Repository Errors
201
+
202
+ ### "Not a git repository"
203
+
204
+ **Cause:** Running outside git repository.
205
+
206
+ **Solution:**
207
+ ```bash
208
+ ls -la .git # Verify .git exists
209
+ ```
210
+
211
+ ### "Detached HEAD state"
212
+
213
+ **GitHub Actions:**
214
+ ```yaml
215
+ - uses: actions/checkout@v4
216
+ with:
217
+ fetch-depth: 0
218
+ ref: main # Checkout branch
219
+ ```
220
+
221
+ **GitLab CI:**
222
+ ```yaml
223
+ agileflow:
224
+ script:
225
+ - git checkout $CI_COMMIT_REF_NAME
226
+ - npx @logickernel/agileflow gitlab
227
+ ```
228
+
229
+ ### Shallow Clone Issues
230
+
231
+ **Cause:** Commit history not available.
232
+
233
+ **GitHub Actions:**
234
+ ```yaml
235
+ - uses: actions/checkout@v4
236
+ with:
237
+ fetch-depth: 0 # Fetch all history
238
+ ```
239
+
240
+ **GitLab CI:**
241
+ ```yaml
242
+ variables:
243
+ GIT_DEPTH: 0
244
+ ```
204
245
 
205
- 2. **Verify job dependencies**
246
+ ---
247
+
248
+ ## Pipeline Issues
249
+
250
+ ### Versioning Job Fails
251
+
252
+ **Debug steps:**
253
+
254
+ 1. **Check logs** for error messages
255
+ 2. **Verify token** is set:
206
256
  ```yaml
207
- # Ensure build depends on agileflow
208
- build:
209
- stage: build
210
- needs:
211
- - agileflow
212
- script:
213
- - echo "Building version ${VERSION}"
257
+ - run: echo "Token set: ${{ secrets.AGILEFLOW_TOKEN != '' }}"
214
258
  ```
215
-
216
- 3. **Check variable expansion**
259
+ 3. **Check git state**:
217
260
  ```yaml
218
- # Test variable availability
219
- build:
220
- script:
221
- - echo "VERSION: ${VERSION}"
222
- - echo "CI_COMMIT_REF_NAME: ${CI_COMMIT_REF_NAME}"
223
- - docker build -t myapp:${VERSION} .
261
+ - run: |
262
+ git log --oneline -5
263
+ git tag --sort=-version:refname | head -3
224
264
  ```
225
265
 
226
- ## Release Notes Issues
266
+ ### Both Workflows Running on Same Push
227
267
 
228
- ### Empty Release Notes
268
+ **Cause:** Main push triggers versioning, tag push triggers release — correct behavior!
229
269
 
230
- **Problem**: Release notes are not generated or are empty.
270
+ This is expected:
271
+ 1. Push to main → Versioning workflow → Creates tag
272
+ 2. Tag push → Release workflow → Builds
231
273
 
232
- **Solutions**:
274
+ ---
233
275
 
234
- 1. **Check commit message format**
235
- ```bash
236
- # View recent commits
237
- git log --oneline -10
238
-
239
- # Ensure conventional commit format
240
- git log --grep="^feat\|^fix\|^perf\|^refactor\|^docs\|^test\|^build\|^ci\|^chore\|^style"
241
- ```
276
+ ## Debug Commands
242
277
 
243
- 2. **Verify AgileFlow configuration**
244
- ```javascript
245
- // agileflow.config.js
246
- module.exports = {
247
- releaseNotes: {
248
- enabled: true,
249
- format: 'conventional',
250
- includeBody: true,
251
- groupByType: true
252
- }
253
- };
254
- ```
278
+ ### Verify AgileFlow
255
279
 
256
- 3. **Check tag creation**
257
- ```bash
258
- # List all tags
259
- git tag --sort=-version:refname
260
-
261
- # View tag message
262
- git tag -l -n99 v1.2.3
263
- ```
280
+ ```bash
281
+ # Check version
282
+ npx @logickernel/agileflow --version
264
283
 
265
- ### Malformed Release Notes
284
+ # Preview (no tag creation)
285
+ npx @logickernel/agileflow
266
286
 
267
- **Problem**: Release notes are generated but poorly formatted.
287
+ # Quiet mode
288
+ npx @logickernel/agileflow --quiet
289
+ ```
268
290
 
269
- **Solutions**:
291
+ ### Check Git State
270
292
 
271
- 1. **Improve commit message quality**
272
- ```bash
273
- # Good commit messages
274
- feat(auth): add OAuth2 login support
275
- fix(api): handle null user ID gracefully
276
- docs: update installation guide
277
-
278
- # ❌ Poor commit messages
279
- add oauth
280
- fix bug
281
- update docs
282
- ```
293
+ ```bash
294
+ # Recent tags
295
+ git tag --sort=-version:refname | head -5
283
296
 
284
- 2. **Use consistent scopes**
285
- ```bash
286
- # Consistent scope usage
287
- feat(auth): add OAuth2 login
288
- feat(auth): implement JWT refresh
289
- fix(auth): handle expired tokens
290
- ```
297
+ # Recent commits
298
+ git log --oneline -10
291
299
 
292
- 3. **Include meaningful descriptions**
293
- ```bash
294
- # Descriptive commit messages
295
- feat(auth): add OAuth2 login support with Google and GitHub providers
296
-
297
- Implements OAuth2 authentication flow supporting multiple
298
- identity providers. Includes proper error handling and
299
- user session management.
300
- ```
300
+ # Current branch
301
+ git branch --show-current
302
+ ```
301
303
 
302
- ## Debugging Techniques
304
+ ### Test Tokens
303
305
 
304
- ### Enable Debug Logging
306
+ **GitLab:**
307
+ ```bash
308
+ curl --header "PRIVATE-TOKEN: $AGILEFLOW_TOKEN" \
309
+ "https://gitlab.com/api/v4/projects"
310
+ ```
305
311
 
306
- ```yaml
307
- agileflow:
308
- variables:
309
- AGILEFLOW_DEBUG: "true"
310
- AGILEFLOW_LOG_LEVEL: "debug"
311
- script:
312
- - agileflow gitlab-ci --verbose
312
+ **GitHub:**
313
+ ```bash
314
+ curl -H "Authorization: token $AGILEFLOW_TOKEN" \
315
+ "https://api.github.com/user"
313
316
  ```
314
317
 
315
- ### Check Environment Variables
318
+ ---
319
+
320
+ ## Common Patterns
316
321
 
322
+ ### Complete Debug Workflow
323
+
324
+ **GitHub Actions:**
317
325
  ```yaml
318
- debug-env:
319
- stage: build
320
- script:
321
- - echo "VERSION: ${VERSION}"
322
- - echo "CI_COMMIT_REF_NAME: ${CI_COMMIT_REF_NAME}"
323
- - echo "CI_COMMIT_SHA: ${CI_COMMIT_SHA}"
324
- - env | grep -E "(VERSION|CI_|AGILEFLOW_)"
325
- needs:
326
- - agileflow
326
+ - name: Debug
327
+ run: |
328
+ echo "Node: $(node --version)"
329
+ echo "Git: $(git --version)"
330
+ echo "Branch: $(git branch --show-current)"
331
+ echo "Tags: $(git tag --sort=-version:refname | head -3)"
332
+ echo "Commits:"
333
+ git log --oneline -5
334
+ npx @logickernel/agileflow || echo "Exit: $?"
327
335
  ```
328
336
 
329
- ### Verify Git State
330
-
337
+ **GitLab CI:**
331
338
  ```yaml
332
- verify-git:
333
- stage: build
339
+ debug:
334
340
  script:
335
- - git status
341
+ - node --version
342
+ - git --version
343
+ - git branch --show-current
344
+ - git tag --sort=-version:refname | head -3
336
345
  - git log --oneline -5
337
- - git tag --sort=-version:refname | head -5
338
- - git remote -v
339
- needs:
340
- - agileflow
346
+ - npx @logickernel/agileflow || echo "Exit: $?"
341
347
  ```
348
+
349
+ ---
350
+
351
+ ## Getting Help
352
+
353
+ If still stuck:
354
+
355
+ 1. **Check error messages** — Usually descriptive
356
+ 2. **Verify configuration** — Tokens, workflow triggers
357
+ 3. **Test locally** — `npx @logickernel/agileflow`
358
+ 4. **Open an issue** — Include logs and config
359
+
360
+ ---
361
+
362
+ ## Related Documentation
363
+
364
+ - [Installation Guide](./installation.md) — Setup
365
+ - [Configuration](./configuration.md) — Variables
366
+ - [CLI Reference](./cli-reference.md) — Commands
367
+ - [Conventional Commits](./conventional-commits.md) — Commit format