@logickernel/agileflow 0.1.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.
@@ -0,0 +1,234 @@
1
+ # Conventional Commits
2
+
3
+ This document describes the conventional commit format used in AgileFlow and how it affects version bumping.
4
+
5
+ ## Version Bump Logic
6
+
7
+ AgileFlow automatically determines version bumps based on conventional commit messages using the following logic:
8
+
9
+ ### For versions 1.0.0 and above:
10
+ - **Major version bump (X.0.0)**: Breaking changes (`!` suffix or `BREAKING CHANGE:` in footer)
11
+ - **Minor version bump (0.X.0)**: New features (`feat:`)
12
+ - **Patch version bump (0.0.X)**: Bug fixes, performance improvements, build system changes, CI changes, refactors, reverts, tests, or dependency updates
13
+ - **No version bump**: Documentation, style changes, or chores (unless they affect build artifacts)
14
+
15
+ ### For pre-1.0.0 versions (0.x.x):
16
+ - **Minor version bump (0.X.0)**: Breaking changes (`!` suffix or `BREAKING CHANGE:` in footer)
17
+ - **Patch version bump (0.0.X)**: New features, bug fixes, performance improvements, build system changes, CI changes, refactors, reverts, tests, or dependency updates
18
+ - **No version bump**: Documentation, style changes, or chores (unless they affect build artifacts)
19
+
20
+ ## Commit Types and Version Impact
21
+
22
+ | Commit Type | Description | (>1.0.0) | (0.x.x) |
23
+ |-------------|-------------|----------|---------|
24
+ | [feat](./conventional-commits/type-feat.md) | New features | **Minor** | **Patch** |
25
+ | [fix](./conventional-commits/type-fix.md) | Bug fixes | **Patch** | **Patch** |
26
+ | [perf](./conventional-commits/type-perf.md) | Performance improvements | **Patch** | **Patch** |
27
+ | [build](./conventional-commits/type-build.md) | Build system changes | **Patch** | **Patch** |
28
+ | [ci](./conventional-commits/type-ci.md) | CI/CD changes | **Patch** | **Patch** |
29
+ | [refactor](./conventional-commits/type-refactor.md) | Code refactoring | **Patch** | **Patch** |
30
+ | [revert](./conventional-commits/type-revert.md) | Revert previous commits | **Patch** | **Patch** |
31
+ | [test](./conventional-commits/type-test.md) | Test additions/changes | **Patch** | **Patch** |
32
+ | [docs](./conventional-commits/type-docs.md) | Documentation changes | **None** | **None** |
33
+ | [style](./conventional-commits/type-style.md) | Code style changes | **None** | **None** |
34
+ | [chore](./conventional-commits/type-chore.md) | Maintenance tasks | **None** | **None** |
35
+
36
+ ### Dependency Updates
37
+
38
+ Dependency updates are handled consistently based on their impact:
39
+
40
+ - **`build(deps):`** - Always triggers patch version bump (affects build artifacts)
41
+ - **`chore(deps):`** - Triggers patch version bump if it affects runtime dependencies, no bump for dev/test-only dependencies
42
+
43
+ #### Examples:
44
+ ```
45
+ build(deps): upgrade React to 18.2.0 # Patch bump (affects runtime)
46
+ chore(deps): bump lodash to 4.17.21 # Patch bump (runtime dependency)
47
+ chore(deps): bump jest to 29.0.0 [skip release] # No bump (dev dependency)
48
+ ```
49
+
50
+ ## Breaking Changes
51
+
52
+ Breaking changes can be indicated in two ways:
53
+
54
+ 1. **Exclamation mark suffix**: `feat!: breaking change` or `feat(scope)!: breaking change`
55
+ 2. **BREAKING CHANGE in footer**: Any commit with `BREAKING CHANGE:` in the commit footer/trailer section
56
+
57
+ **Important**: Breaking change indicators in the commit body are not supported and may cause false positives. Always use the footer section.
58
+
59
+ ### Breaking Change Examples:
60
+ ```
61
+ feat!: remove deprecated API endpoints
62
+
63
+ feat(auth)!: change authentication flow
64
+
65
+ fix!: modify database schema
66
+
67
+ feat: new feature
68
+ BREAKING CHANGE: The /api/v1/users endpoint has been removed
69
+ ```
70
+
71
+ ## Commit Message Format
72
+
73
+ The standard format for conventional commits is:
74
+
75
+ ```text
76
+ type[!]?(scope)?: description
77
+
78
+ [optional body]
79
+
80
+ [optional footer(s)]
81
+ ```
82
+
83
+ ### Format Components:
84
+ - **type**: The type of change (feat, fix, perf, etc.)
85
+ - **!**: Optional breaking change indicator
86
+ - **scope**: Optional scope in parentheses (e.g., auth, api, ui)
87
+ - **description**: Short description of the change
88
+ - **body**: Optional detailed explanation
89
+ - **footer**: Optional footers like `BREAKING CHANGE:` or `[skip release]`
90
+
91
+ ## Non-Conventional Commits
92
+
93
+ Commits that don't follow the conventional format are handled as follows:
94
+
95
+ - **Version bumping**: Non-conventional commits trigger **patch version bumps by default** unless they contain `[skip release]`
96
+ - **Release notes**: They appear under "Other changes" section
97
+ - **Examples**: `git merge`, `git revert`, or plain text commits
98
+
99
+ ### Skip Release Convention
100
+
101
+ Use `[skip release]` suffix to explicitly prevent version bumping:
102
+
103
+ ```
104
+ docs: update internal notes [skip release]
105
+ chore: update local config [skip release]
106
+ test: add debug logging [skip release]
107
+ ```
108
+
109
+ ## Release Note Generation
110
+
111
+ AgileFlow automatically generates organized release notes by grouping commits by type. The system follows this specific order:
112
+
113
+ 1. **Features** - New functionality
114
+ 2. **Bug fixes** - Bug resolutions
115
+ 3. **Performance improvements** - Performance enhancements
116
+ 4. **Refactors** - Code refactoring
117
+ 5. **Documentation** - Documentation updates
118
+ 6. **Build system** - Build tooling changes
119
+ 7. **CI** - Continuous integration changes
120
+ 8. **Chores** - Maintenance tasks
121
+ 9. **Tests** - Test additions/changes (placed after chores as they're not user-facing)
122
+ 10. **Code style** - Formatting and style changes
123
+ 11. **Reverts** - Reverted changes
124
+ 12. **Other changes** - Non-conventional commits
125
+
126
+ ### Breaking Change Indicators
127
+
128
+ When breaking changes are detected, they are automatically prefixed with `BREAKING: ` in the release notes:
129
+
130
+ ```
131
+ v2.0.0
132
+
133
+ Features:
134
+ - BREAKING: auth: change authentication flow
135
+ - BREAKING: remove deprecated API endpoints
136
+
137
+ Bug fixes:
138
+ - BREAKING: modify database schema
139
+ ```
140
+
141
+ ## Examples
142
+
143
+ ### Major Version Bump (1.0.0+)
144
+ ```
145
+ feat!: remove deprecated API endpoints
146
+
147
+ feat(auth)!: change authentication flow
148
+
149
+ fix!: modify database schema
150
+ BREAKING CHANGE: Database schema has changed
151
+ ```
152
+
153
+ ### Minor Version Bump
154
+ ```
155
+ feat: add new user management dashboard
156
+ feat(auth): implement two-factor authentication
157
+ feat(api): add user search endpoint
158
+ ```
159
+
160
+ ### Patch Version Bump
161
+ ```
162
+ fix: resolve user login issue
163
+ fix(auth): correct null handling in user lookup
164
+ perf: optimize database queries
165
+ perf(cache): improve Redis connection pooling
166
+ build: update webpack to v5
167
+ build(deps): upgrade React to 18.2.0
168
+ ci: add GitHub Actions workflow
169
+ ci(gitlab): update pipeline configuration
170
+ refactor: extract common utilities
171
+ refactor(auth): simplify token validation
172
+ revert: "feat: add user authentication"
173
+ test: add unit tests for auth module
174
+ test(integration): add API endpoint tests
175
+ chore(deps): bump lodash to 4.17.21
176
+ ```
177
+
178
+ ### No Version Bump
179
+ ```
180
+ docs: update API documentation
181
+ docs(readme): add installation instructions
182
+ style: format code with prettier
183
+ style(eslint): enforce consistent formatting
184
+ chore: update local configuration
185
+ chore(deps): bump jest to 29.0.0 [skip release]
186
+ ```
187
+
188
+ ## Version Bump Priority
189
+
190
+ When multiple commit types are present in the commit history since the last version, the highest priority bump is applied:
191
+
192
+ 1. **Breaking changes** → Major version bump (or minor for 0.x.x)
193
+ 2. **Features** → Minor version bump (or patch for 0.x.x)
194
+ 3. **Fixes, Performance, Build, CI, Refactor, Revert, Test, Dependencies** → Patch version bump
195
+ 4. **Documentation, Style, Chores** → No version bump (unless they affect build artifacts)
196
+
197
+ **Non-conventional commits** trigger patch version bumps by default unless they contain `[skip release]`.
198
+
199
+ This ensures semantic versioning follows the [SemVer specification](https://semver.org/).
200
+
201
+ ## Implementation Details
202
+
203
+ AgileFlow's versioning system:
204
+
205
+ - **Analyzes commit messages** since the last version tag
206
+ - **Groups changes by type** for organized release notes using the defined section order
207
+ - **Generates comprehensive tag messages** with categorized changes
208
+ - **Supports scoped commits** for better organization
209
+ - **Handles breaking changes** automatically with `BREAKING: ` prefix
210
+ - **Creates annotated tags** with detailed commit summaries
211
+ - **Falls back to flat list** for repositories without conventional commits
212
+ - **Supports metadata** in version tags (e.g., `v1.0.0-alpha.1`)
213
+ - **Treats non-conventional commits** as patch-level changes by default
214
+ - **Respects `[skip release]`** convention for explicit version control
215
+
216
+ ## Best Practices
217
+
218
+ 1. **Use conventional commit types** consistently
219
+ 2. **Add scopes** when changes affect specific areas
220
+ 3. **Use breaking change indicators** (`!` or `BREAKING CHANGE:` in footer) for incompatible changes
221
+ 4. **Write clear descriptions** that explain what changed
222
+ 5. **Keep commits focused** on single changes
223
+ 6. **Use present tense** in commit messages ("add feature" not "added feature")
224
+ 7. **Follow the established section order** for consistent release notes
225
+ 8. **Use `[skip release]`** for dev/test dependencies that shouldn't trigger releases
226
+ 9. **Place breaking changes in footer** to avoid false positives
227
+ 10. **Group dependency updates** consistently: `build(deps)` for runtime, `chore(deps)` for maintenance
228
+
229
+ ## Related Documentation
230
+
231
+ - [Getting Started](./getting-started.md) - Quick start guide
232
+ - [Release Management](./release-management.md) - How versions are managed
233
+ - [GitLab CI Template](./gitlab-ci-template.md) - CI/CD integration
234
+ - [Branching Strategy](./branching-strategy.md) - Development workflow
@@ -0,0 +1,209 @@
1
+ # Getting Started with AgileFlow
2
+
3
+ Welcome to AgileFlow! This guide will help you get up and running with AgileFlow's version-centric CI/CD approach in just a few minutes.
4
+
5
+ ## What You'll Learn
6
+
7
+ By the end of this guide, you'll have:
8
+ - ✅ AgileFlow installed in your GitLab project
9
+ - ✅ A working CI/CD pipeline that automatically generates versions
10
+ - ✅ Understanding of how the version-centric approach works
11
+ - ✅ Confidence to customize the pipeline for your needs
12
+
13
+ ## Prerequisites
14
+
15
+ Before you begin, ensure you have:
16
+ - A GitLab project with CI/CD enabled
17
+ - Access to modify `.gitlab-ci.yml` files and CI/CD variables
18
+ - Basic understanding of Git and CI/CD concepts
19
+
20
+ ## Quick Start (5 minutes)
21
+
22
+ ### Step 1: Include the AgileFlow Template
23
+
24
+ Add this line to the top of your `.gitlab-ci.yml` file:
25
+
26
+ ```yaml
27
+ include:
28
+ - remote: https://code.logickernel.com/kernel/agileflow/-/raw/main/templates/AgileFlow.gitlab-ci.yml
29
+ ```
30
+
31
+ ### Step 2: Configure the AGILEFLOW_TOKEN
32
+
33
+ AgileFlow needs a GitLab access token to create version tags via the API. Set this in your GitLab project:
34
+
35
+ 1. Go to **Settings > CI/CD > Variables**
36
+ 2. Add the `AGILEFLOW_TOKEN` variable:
37
+
38
+ | Variable | Value | Type | Protect | Mask |
39
+ |----------|-------|------|---------|------|
40
+ | `AGILEFLOW_TOKEN` | Your GitLab API token | Variable | Yes | No |
41
+
42
+ **Creating the AGILEFLOW_TOKEN:**
43
+ - **Project Access Token (Recommended)**: Go to **Settings > Access Tokens** in your project
44
+ - **Personal Access Token**: Go to your user **Settings > Access Tokens**
45
+ - Set **Name**: `AgileFlow Bot`, **Scopes**: `api`, **Role**: `maintainer` or higher
46
+
47
+ ### Step 3: Add Your First Job
48
+
49
+ Below the include statement, add a simple build job:
50
+
51
+ ```yaml
52
+ build:
53
+ stage: build
54
+ script:
55
+ - echo "Building version ${VERSION}"
56
+ - docker build -t myapp:${VERSION} .
57
+ - docker push myapp:${VERSION}
58
+ needs:
59
+ - agileflow
60
+ ```
61
+
62
+ ### Step 4: Commit and Push
63
+
64
+ ```bash
65
+ git add .gitlab-ci.yml
66
+ git commit -m "feat: add AgileFlow CI/CD pipeline"
67
+ git push
68
+ ```
69
+
70
+ That's it! 🎉 Your first AgileFlow pipeline is now running.
71
+
72
+ ## What Happens Next
73
+
74
+ 1. **Pipeline Starts**: GitLab CI automatically detects your changes
75
+ 2. **Version Generation**: AgileFlow analyzes your commit history and generates the next semantic version
76
+ 3. **Build Process**: Your build job runs with the generated version
77
+ 4. **Version Tag**: A new version tag is created via GitLab API (not git push)
78
+
79
+ ## Understanding the Pipeline
80
+
81
+ Your pipeline now has 6 stages:
82
+
83
+ ```
84
+ version → test → build → deploy → e2e → clean
85
+ ```
86
+
87
+ - **version**: AgileFlow generates semantic versions automatically using GitLab API
88
+ - **test**: Run tests against source code before building (add your test jobs here)
89
+ - **build**: Your application builds with the generated version
90
+ - **deploy**: Deploy the versioned artifacts (add your deployment jobs here)
91
+ - **e2e**: Run end-to-end tests against deployed versions (add your e2e test jobs here)
92
+ - **clean**: Cleanup temporary resources (optional)
93
+
94
+ ## How AgileFlow Works
95
+
96
+ ### No Git Push Required
97
+ - **AgileFlow uses GitLab API** to create version tags
98
+ - **No repository write permissions** needed for CI/CD jobs
99
+ - **More secure** than traditional git push approaches
100
+ - **Works with protected branches** without special permissions
101
+
102
+ ### Version Generation
103
+ - **Analyzes commit messages** since the last version
104
+ - **Uses conventional commits** to determine version bump type
105
+ - **Creates semantic versions** automatically (v1.0.0, v1.0.1, etc.)
106
+ - **Generates release notes** from commit history
107
+
108
+ ## Next Steps
109
+
110
+ Now that you have the basics working, explore these areas:
111
+
112
+ ### 1. Add Deployment Jobs
113
+ ```yaml
114
+ deploy-staging:
115
+ stage: deploy
116
+ script:
117
+ - kubectl set image deployment/myapp myapp=myapp:${VERSION}
118
+ environment:
119
+ name: staging
120
+ needs:
121
+ - build
122
+ ```
123
+
124
+ ### 2. Add Testing
125
+ ```yaml
126
+ # Unit tests run before building
127
+ unit-tests:
128
+ stage: test
129
+ script:
130
+ - npm test
131
+ - npm run lint
132
+ needs:
133
+ - agileflow
134
+
135
+ # Integration tests run after deployment
136
+ integration-tests:
137
+ stage: e2e
138
+ script:
139
+ - ./run-tests.sh --version ${VERSION}
140
+ needs:
141
+ - deploy-staging
142
+ ```
143
+
144
+ ### 3. Customize for Multiple Services
145
+ ```yaml
146
+ build-backend:
147
+ stage: build
148
+ script:
149
+ - docker build -t backend:${VERSION} ./backend
150
+ - docker push backend:${VERSION}
151
+ needs:
152
+ - agileflow
153
+
154
+ build-frontend:
155
+ stage: build
156
+ script:
157
+ - docker build -t frontend:${VERSION} ./frontend
158
+ - docker push frontend:${VERSION}
159
+ needs:
160
+ - agileflow
161
+ ```
162
+
163
+ ## Common Questions
164
+
165
+ ### Q: How does AgileFlow determine the next version?
166
+ A: AgileFlow analyzes your commit messages using conventional commits. Each merge to main increments the patch version (v1.0.0 → v1.0.1). Use `feat:` for minor versions and `feat!:` for major versions.
167
+
168
+ ### Q: Can I use this with existing CI/CD pipelines?
169
+ A: Yes! AgileFlow is designed to work alongside existing pipelines. Just include the template and gradually migrate your jobs to use the `${VERSION}` variable.
170
+
171
+ ### Q: What if I need different versions for different environments?
172
+ A: AgileFlow generates one version per pipeline run. Deploy the same version everywhere to eliminate environment drift. Use environment-specific configuration instead of different versions.
173
+
174
+ ### Q: How do I rollback to a previous version?
175
+ A: Simply redeploy the previous version tag. Since all environments use the same version, rollbacks are consistent and predictable.
176
+
177
+ ### Q: Why doesn't AgileFlow need git push permissions?
178
+ A: AgileFlow uses the GitLab API to create tags remotely instead of pushing them with git commands. This is more secure and doesn't require repository write access.
179
+
180
+ ## Troubleshooting
181
+
182
+ ### Pipeline Fails on Version Stage
183
+ - Check that the `AGILEFLOW_TOKEN` is set correctly
184
+ - Ensure the token has `api` scope and `maintainer` role
185
+ - Verify your GitLab CI/CD settings
186
+ - Check the `agileflow` job logs for specific errors
187
+
188
+ ### VERSION Variable Not Available
189
+ - Ensure the `agileflow` job completed successfully
190
+ - Check that your jobs have `needs: - agileflow` dependency
191
+ - Verify the dotenv artifact is properly configured
192
+
193
+ ### Build Jobs Fail
194
+ - Check that you're using `${VERSION}` correctly
195
+ - Ensure proper job dependencies with `needs:`
196
+ - Verify your build scripts work with the version variable
197
+
198
+ ## Getting Help
199
+
200
+ - 📚 [Complete Documentation](./README.md) - Browse all available guides
201
+ - 🔧 [GitLab CI Template Reference](./gitlab-ci-template.md) - Detailed template documentation
202
+ - 💡 [Version-Centric CI/CD Approach](./version-centric-cicd.md) - Deep dive into the methodology
203
+ - 🐛 [Troubleshooting](./troubleshooting.md) - Common issues and solutions
204
+
205
+ ## Congratulations! 🎉
206
+
207
+ You've successfully set up AgileFlow and are now using a modern, version-centric CI/CD approach. Your deployments will be more predictable, your rollbacks will be simpler, and your team will have better visibility into what's running where.
208
+
209
+ Ready to dive deeper? Explore the [advanced topics](./README.md#advanced-topics) or customize your pipeline further!