gitflow-analytics 1.0.0__tar.gz → 1.0.1__tar.gz

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 (47) hide show
  1. gitflow_analytics-1.0.1/CHANGELOG.md +94 -0
  2. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/CLAUDE.md +55 -0
  3. gitflow_analytics-1.0.1/PKG-INFO +463 -0
  4. gitflow_analytics-1.0.1/README.md +418 -0
  5. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/docs/configuration.md +93 -7
  6. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/pyproject.toml +1 -1
  7. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/__init__.py +2 -0
  8. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/_version.py +1 -1
  9. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/cli.py +113 -19
  10. gitflow_analytics-1.0.1/src/gitflow_analytics/config.py +398 -0
  11. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/core/analyzer.py +68 -8
  12. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/core/branch_mapper.py +1 -1
  13. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/core/cache.py +3 -5
  14. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/core/identity.py +5 -6
  15. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/extractors/base.py +1 -1
  16. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/extractors/story_points.py +1 -1
  17. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/extractors/tickets.py +13 -4
  18. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/integrations/github_integration.py +11 -4
  19. gitflow_analytics-1.0.1/src/gitflow_analytics/integrations/jira_integration.py +272 -0
  20. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/integrations/orchestrator.py +33 -7
  21. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/metrics/dora.py +3 -3
  22. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/models/database.py +4 -4
  23. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/reports/analytics_writer.py +14 -4
  24. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/reports/csv_writer.py +12 -4
  25. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/reports/narrative_writer.py +5 -1
  26. gitflow_analytics-1.0.1/src/gitflow_analytics.egg-info/PKG-INFO +463 -0
  27. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics.egg-info/SOURCES.txt +1 -0
  28. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics.egg-info/requires.txt +1 -0
  29. gitflow_analytics-1.0.0/CHANGELOG.md +0 -54
  30. gitflow_analytics-1.0.0/PKG-INFO +0 -201
  31. gitflow_analytics-1.0.0/README.md +0 -156
  32. gitflow_analytics-1.0.0/src/gitflow_analytics/config.py +0 -215
  33. gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/PKG-INFO +0 -201
  34. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/LICENSE +0 -0
  35. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/MANIFEST.in +0 -0
  36. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/docs/DEPLOY.md +0 -0
  37. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/docs/design/git_pm_correlation_design.md +0 -0
  38. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/setup.cfg +0 -0
  39. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/core/__init__.py +0 -0
  40. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/extractors/__init__.py +0 -0
  41. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/integrations/__init__.py +0 -0
  42. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/metrics/__init__.py +0 -0
  43. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/models/__init__.py +0 -0
  44. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics/reports/__init__.py +0 -0
  45. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics.egg-info/dependency_links.txt +0 -0
  46. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics.egg-info/entry_points.txt +0 -0
  47. {gitflow_analytics-1.0.0 → gitflow_analytics-1.0.1}/src/gitflow_analytics.egg-info/top_level.txt +0 -0
@@ -0,0 +1,94 @@
1
+ # Changelog
2
+
3
+ All notable changes to GitFlow Analytics will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.1] - 2025-07-31
9
+
10
+ ### Added
11
+ - Path exclusion support for filtering boilerplate/generated files from line count metrics
12
+ - Configurable via `analysis.exclude.paths` in YAML configuration
13
+ - Default exclusions for common patterns (node_modules, lock files, minified files, etc.)
14
+ - Filtered metrics available as `filtered_insertions`, `filtered_deletions`, `filtered_files_changed`
15
+ - JIRA integration for fetching story points from tickets
16
+ - Configurable story point field names via `jira_integration.story_point_fields`
17
+ - Automatic story point extraction from JIRA tickets referenced in commits
18
+ - Support for custom field IDs and field names
19
+ - Organization-based repository discovery from GitHub
20
+ - Automatic discovery of all non-archived repositories in an organization
21
+ - No manual repository configuration needed for organization-wide analysis
22
+ - Ticket platform filtering via `analysis.ticket_platforms`
23
+ - Ability to track only specific platforms (e.g., only JIRA, ignoring GitHub Issues)
24
+ - Enhanced `.env` file support
25
+ - Automatic loading from configuration directory
26
+ - Validation of required environment variables
27
+ - Clear error messages for missing credentials
28
+ - New CLI command: `discover-jira-fields` to find custom field IDs
29
+
30
+ ### Changed
31
+ - All report generators now use filtered line counts when available
32
+ - Cache and output directories now default to config file location (not current directory)
33
+ - Improved developer identity resolution with better consolidation
34
+
35
+ ### Fixed
36
+ - Timezone comparison errors between GitHub and local timestamps
37
+ - License configuration in pyproject.toml for PyPI compatibility
38
+ - Manual identity mapping format validation
39
+ - Linting errors for better code quality
40
+
41
+ ### Documentation
42
+ - Added comprehensive environment variable configuration guide
43
+ - Complete configuration examples with `.env` and YAML files
44
+ - Path exclusion documentation with default patterns
45
+ - Updated README with clearer setup instructions
46
+
47
+ ## [1.0.0] - 2025-07-29
48
+
49
+ ### Added
50
+ - Initial release of GitFlow Analytics
51
+ - Core Git repository analysis with batch processing
52
+ - Developer identity resolution with fuzzy matching
53
+ - Manual identity mapping support
54
+ - Story point extraction from commit messages
55
+ - Multi-platform ticket tracking (GitHub, JIRA, Linear, ClickUp)
56
+ - Comprehensive caching system with SQLite
57
+ - CSV report generation:
58
+ - Weekly metrics
59
+ - Developer statistics
60
+ - Activity distribution
61
+ - Developer focus analysis
62
+ - Qualitative insights
63
+ - Markdown narrative reports with insights
64
+ - JSON export for API integration
65
+ - DORA metrics calculation:
66
+ - Deployment frequency
67
+ - Lead time for changes
68
+ - Mean time to recovery
69
+ - Change failure rate
70
+ - GitHub PR enrichment (optional)
71
+ - Branch to project mapping
72
+ - YAML configuration with environment variable support
73
+ - Progress bars for long operations
74
+ - Anonymization support for reports
75
+
76
+ ### Configuration Features
77
+ - Repository definitions with project keys
78
+ - Story point extraction patterns
79
+ - Developer identity similarity threshold
80
+ - Manual identity mappings
81
+ - Default ticket platform specification
82
+ - Branch mapping rules
83
+ - Output format selection
84
+ - Cache TTL configuration
85
+
86
+ ### Developer Experience
87
+ - Clear CLI with helpful error messages
88
+ - Comprehensive documentation
89
+ - Sample configuration files
90
+ - Progress indicators during analysis
91
+ - Detailed logging of operations
92
+
93
+ [1.0.1]: https://github.com/bobmatnyc/gitflow-analytics/releases/tag/v1.0.1
94
+ [1.0.0]: https://github.com/bobmatnyc/gitflow-analytics/releases/tag/v1.0.0
@@ -42,9 +42,28 @@ The project uses SQLite for caching:
42
42
 
43
43
  Configuration uses YAML with environment variable support:
44
44
  - Variables use format: `${VARIABLE_NAME}`
45
+ - **Environment files**: Automatically loads `.env` file from same directory as config YAML
46
+ - **Organization support**: `github.organization` field enables automatic repository discovery
47
+ - **Directory defaults**: Cache and reports now default to config file directory (not current working directory)
45
48
  - Default ticket platform can be specified
46
49
  - Branch mapping rules for project inference
47
50
  - Manual identity mappings for consolidating developer identities
51
+ - Full backward compatibility with existing repository-based configurations
52
+
53
+ #### Using .env Files
54
+
55
+ The system automatically looks for a `.env` file in the same directory as your configuration YAML:
56
+ ```bash
57
+ # Example .env file
58
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
59
+ JIRA_ACCESS_USER=your.email@company.com
60
+ JIRA_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxx
61
+ ```
62
+
63
+ This approach is recommended for:
64
+ - Keeping credentials out of configuration files
65
+ - Easy credential management across environments
66
+ - Preventing accidental credential commits
48
67
 
49
68
  ### 5. Report Generation
50
69
 
@@ -87,6 +106,40 @@ When testing changes:
87
106
  3. Clear cache and re-run analysis
88
107
  4. Check for typos in email addresses
89
108
 
109
+ #### Working with Organization Support
110
+
111
+ 1. **Organization Discovery**: When `github.organization` is specified and no repositories are manually configured:
112
+ - All non-archived repositories are automatically discovered from the GitHub organization
113
+ - Repositories are cloned to local directories if they don't exist
114
+ - Uses the organization name as the project key prefix if not specified
115
+
116
+ 2. **Testing Organization Configs**:
117
+ ```bash
118
+ # Test with organization discovery
119
+ gitflow-analytics analyze -c config-org.yaml --weeks 4 --validate-only
120
+
121
+ # Run with discovered repositories
122
+ gitflow-analytics analyze -c config-org.yaml --weeks 4
123
+ ```
124
+
125
+ 3. **Directory Structure**: With organization support, the recommended directory structure is:
126
+ ```
127
+ /project/
128
+ ├── config-org.yaml # Organization config
129
+ ├── repos/ # Auto-cloned repositories
130
+ │ ├── repo1/
131
+ │ ├── repo2/
132
+ │ └── repo3/
133
+ ├── .gitflow-cache/ # Cache (relative to config)
134
+ └── reports/ # Reports (default output location)
135
+ ```
136
+
137
+ 4. **Debugging Organization Discovery**:
138
+ - Check GitHub token has organization read permissions
139
+ - Verify organization name is correct (case-sensitive)
140
+ - Use `--validate-only` to test configuration without full analysis
141
+ - Check for API rate limiting issues
142
+
90
143
  ### 8. Performance Considerations
91
144
 
92
145
  - **Batch processing**: Commits are processed in batches (default: 1000)
@@ -169,6 +222,8 @@ gitflow-analytics/
169
222
  3. **Memory usage**: Large repositories can consume significant memory
170
223
  4. **Identity resolution**: Manual mappings must be applied after initial analysis
171
224
  5. **Cache invalidation**: Some changes require clearing the cache
225
+ 6. **Directory defaults**: Cache and reports now default to config file directory, not current working directory
226
+ 7. **Organization permissions**: GitHub token must have organization read access for automatic repository discovery
172
227
 
173
228
  ## Quick Commands
174
229
 
@@ -0,0 +1,463 @@
1
+ Metadata-Version: 2.4
2
+ Name: gitflow-analytics
3
+ Version: 1.0.1
4
+ Summary: Analyze Git repositories for developer productivity insights
5
+ Author-email: Bob Matyas <bobmatnyc@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/bobmatnyc/gitflow-analytics
8
+ Project-URL: Documentation, https://github.com/bobmatnyc/gitflow-analytics/blob/main/README.md
9
+ Project-URL: Repository, https://github.com/bobmatnyc/gitflow-analytics
10
+ Project-URL: Issues, https://github.com/bobmatnyc/gitflow-analytics/issues
11
+ Keywords: git,analytics,productivity,metrics,development
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Version Control :: Git
21
+ Classifier: Topic :: Software Development :: Quality Assurance
22
+ Requires-Python: >=3.8
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: click>=8.1
26
+ Requires-Dist: gitpython>=3.1
27
+ Requires-Dist: tqdm>=4.65
28
+ Requires-Dist: sqlalchemy>=2.0
29
+ Requires-Dist: pandas>=2.0
30
+ Requires-Dist: pyyaml>=6.0
31
+ Requires-Dist: python-dateutil>=2.8
32
+ Requires-Dist: python-dotenv>=1.0
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0; extra == "dev"
35
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
36
+ Requires-Dist: pytest-mock>=3.0; extra == "dev"
37
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
38
+ Requires-Dist: mypy>=1.0; extra == "dev"
39
+ Requires-Dist: black>=23.0; extra == "dev"
40
+ Provides-Extra: github
41
+ Requires-Dist: pygithub>=1.58; extra == "github"
42
+ Provides-Extra: all
43
+ Requires-Dist: gitflow-analytics[github]; extra == "all"
44
+ Dynamic: license-file
45
+
46
+ # GitFlow Analytics
47
+
48
+ A Python package for analyzing Git repositories to generate comprehensive developer productivity reports. It extracts data directly from Git history and GitHub APIs, providing weekly summaries, productivity insights, and gap analysis.
49
+
50
+ ## Features
51
+
52
+ - 🚀 **Multi-repository analysis** with project grouping
53
+ - 🏢 **Organization-based repository discovery** from GitHub
54
+ - 👥 **Developer identity resolution** and normalization
55
+ - 📊 **Work volume analysis** (absolute vs relative effort)
56
+ - 🎯 **Story point extraction** from commit messages and PR descriptions
57
+ - 🎫 **Multi-platform ticket tracking** (JIRA, GitHub Issues, ClickUp, Linear)
58
+ - 📈 **Weekly CSV reports** with productivity metrics
59
+ - 🔒 **Data anonymization** for external sharing
60
+ - ⚡ **Smart caching** for fast repeated analyses
61
+ - 🔄 **Batch processing** for large repositories
62
+
63
+ ## Quick Start
64
+
65
+ ### Installation
66
+
67
+ ```bash
68
+ pip install gitflow-analytics
69
+ ```
70
+
71
+ ### Basic Usage
72
+
73
+ 1. Create a configuration file (`config.yaml`):
74
+
75
+ **Option A: Organization-based (Automatic Repository Discovery)**
76
+ ```yaml
77
+ version: "1.0"
78
+
79
+ github:
80
+ token: "${GITHUB_TOKEN}"
81
+ organization: "myorg" # Automatically discovers all repositories
82
+
83
+ analysis:
84
+ story_point_patterns:
85
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
86
+ - "\\[(\\d+)\\s*(?:sp|pts?)\\]"
87
+ ```
88
+
89
+ **Option B: Repository-based (Manual Configuration)**
90
+ ```yaml
91
+ version: "1.0"
92
+
93
+ github:
94
+ token: "${GITHUB_TOKEN}"
95
+ owner: "${GITHUB_OWNER}"
96
+
97
+ repositories:
98
+ - name: "frontend"
99
+ path: "~/repos/frontend"
100
+ github_repo: "myorg/frontend"
101
+ project_key: "FRONTEND"
102
+
103
+ - name: "backend"
104
+ path: "~/repos/backend"
105
+ github_repo: "myorg/backend"
106
+ project_key: "BACKEND"
107
+
108
+ analysis:
109
+ story_point_patterns:
110
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
111
+ - "\\[(\\d+)\\s*(?:sp|pts?)\\]"
112
+ ```
113
+
114
+ 2. Create a `.env` file in the same directory as your `config.yaml`:
115
+
116
+ ```bash
117
+ # .env
118
+ GITHUB_TOKEN=ghp_your_github_token_here
119
+ GITHUB_OWNER=your_github_org # Only for repository-based setup
120
+ ```
121
+
122
+ 3. Run the analysis:
123
+
124
+ ```bash
125
+ gitflow-analytics analyze -c config.yaml
126
+ ```
127
+
128
+ ## Configuration Options
129
+
130
+ ### Environment Variables and Credentials
131
+
132
+ GitFlow Analytics automatically loads environment variables from a `.env` file in the same directory as your configuration YAML. This is the recommended approach for managing credentials securely.
133
+
134
+ #### Step 1: Create a `.env` file
135
+
136
+ Create a `.env` file next to your configuration YAML:
137
+
138
+ ```bash
139
+ # .env file (same directory as your config.yaml)
140
+ # GitHub credentials (required)
141
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
142
+ GITHUB_OWNER=myorg # Optional: default owner for repositories
143
+
144
+ # JIRA credentials (optional - only if using JIRA integration)
145
+ JIRA_ACCESS_USER=your.email@company.com
146
+ JIRA_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxx
147
+
148
+ # Other optional tokens
149
+ CLICKUP_TOKEN=pk_xxxxxxxxxxxx
150
+ LINEAR_TOKEN=lin_api_xxxxxxxxxxxx
151
+ ```
152
+
153
+ #### Step 2: Reference in YAML configuration
154
+
155
+ Use `${VARIABLE_NAME}` syntax in your YAML to reference environment variables:
156
+
157
+ ```yaml
158
+ # config.yaml
159
+ version: "1.0"
160
+
161
+ github:
162
+ token: "${GITHUB_TOKEN}" # Required
163
+ owner: "${GITHUB_OWNER}" # Optional
164
+ organization: "${GITHUB_ORG}" # Optional (for org-based discovery)
165
+
166
+ # Optional: JIRA integration
167
+ jira:
168
+ access_user: "${JIRA_ACCESS_USER}"
169
+ access_token: "${JIRA_ACCESS_TOKEN}"
170
+ base_url: "https://yourcompany.atlassian.net"
171
+
172
+ # Optional: Configure which JIRA fields contain story points
173
+ jira_integration:
174
+ story_point_fields:
175
+ - "Story Points"
176
+ - "customfield_10016" # Your custom field ID
177
+ ```
178
+
179
+ #### Important Notes:
180
+
181
+ - **Never commit `.env` files** to version control (add to `.gitignore`)
182
+ - If credentials are not found in the `.env` file, the tool will exit with an informative error
183
+ - The `.env` file must be in the same directory as your YAML configuration
184
+ - All configured services must have corresponding environment variables set
185
+
186
+ ### Organization vs Repository-based Setup
187
+
188
+ GitFlow Analytics supports two main configuration approaches:
189
+
190
+ #### Organization-based Configuration (Recommended)
191
+
192
+ Automatically discovers all non-archived repositories from a GitHub organization:
193
+
194
+ ```yaml
195
+ version: "1.0"
196
+
197
+ github:
198
+ token: "${GITHUB_TOKEN}"
199
+ organization: "myorg" # Your GitHub organization name
200
+
201
+ # Optional: Customize analysis settings
202
+ analysis:
203
+ story_point_patterns:
204
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
205
+
206
+ exclude:
207
+ authors:
208
+ - "dependabot[bot]"
209
+ - "github-actions[bot]"
210
+ ```
211
+
212
+ **Benefits:**
213
+ - Automatically discovers new repositories as they're added to the organization
214
+ - No need to manually configure each repository
215
+ - Simplified configuration management
216
+ - Perfect for teams with many repositories
217
+
218
+ **Requirements:**
219
+ - Your GitHub token must have organization read access
220
+ - Repositories will be automatically cloned to local directories if they don't exist
221
+
222
+ #### Repository-based Configuration
223
+
224
+ Manually specify each repository to analyze:
225
+
226
+ ```yaml
227
+ version: "1.0"
228
+
229
+ github:
230
+ token: "${GITHUB_TOKEN}"
231
+ owner: "${GITHUB_OWNER}" # Default owner for repositories
232
+
233
+ repositories:
234
+ - name: "frontend"
235
+ path: "~/repos/frontend"
236
+ github_repo: "myorg/frontend"
237
+ project_key: "FRONTEND"
238
+
239
+ - name: "backend"
240
+ path: "~/repos/backend"
241
+ github_repo: "myorg/backend"
242
+ project_key: "BACKEND"
243
+
244
+ analysis:
245
+ story_point_patterns:
246
+ - "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
247
+ ```
248
+
249
+ **Benefits:**
250
+ - Fine-grained control over which repositories to analyze
251
+ - Custom project keys and local paths
252
+ - Works with mixed-ownership repositories
253
+ - Compatible with existing configurations
254
+
255
+ ### Directory Defaults
256
+
257
+ GitFlow Analytics now defaults cache and report directories to be relative to the configuration file location:
258
+
259
+ - **Reports**: Default to same directory as config file (unless overridden with `--output`)
260
+ - **Cache**: Default to `.gitflow-cache/` in config file directory
261
+ - **Backward compatibility**: Absolute paths in configuration continue to work as before
262
+
263
+ Example directory structure:
264
+ ```
265
+ /project/
266
+ ├── config.yaml # Configuration file
267
+ ├── weekly_metrics.csv # Reports generated here by default
268
+ ├── summary.csv
269
+ └── .gitflow-cache/ # Cache directory
270
+ ├── gitflow_cache.db
271
+ └── identities.db
272
+ ```
273
+
274
+ ## Command Line Interface
275
+
276
+ ### Main Commands
277
+
278
+ ```bash
279
+ # Analyze repositories
280
+ gitflow-analytics analyze -c config.yaml --weeks 12 --output ./reports
281
+
282
+ # Show cache statistics
283
+ gitflow-analytics cache-stats -c config.yaml
284
+
285
+ # List known developers
286
+ gitflow-analytics list-developers -c config.yaml
287
+
288
+ # Merge developer identities
289
+ gitflow-analytics merge-identity -c config.yaml dev1_id dev2_id
290
+
291
+ # Discover JIRA story point fields
292
+ gitflow-analytics discover-jira-fields -c config.yaml
293
+ ```
294
+
295
+ ### Options
296
+
297
+ - `--weeks, -w`: Number of weeks to analyze (default: 12)
298
+ - `--output, -o`: Output directory for reports (default: ./reports)
299
+ - `--anonymize`: Anonymize developer information
300
+ - `--no-cache`: Disable caching for fresh analysis
301
+ - `--clear-cache`: Clear cache before analysis
302
+ - `--validate-only`: Validate configuration without running
303
+
304
+ ## Complete Configuration Example
305
+
306
+ Here's a complete example showing `.env` file and corresponding YAML configuration:
307
+
308
+ ### `.env` file
309
+ ```bash
310
+ # GitHub Configuration
311
+ GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
312
+ GITHUB_ORG=EWTN-Global
313
+
314
+ # JIRA Configuration
315
+ JIRA_ACCESS_USER=developer@ewtn.com
316
+ JIRA_ACCESS_TOKEN=ATATT3xxxxxxxxxxx
317
+
318
+ # Optional: Other integrations
319
+ # CLICKUP_TOKEN=pk_xxxxxxxxxxxx
320
+ # LINEAR_TOKEN=lin_api_xxxxxxxxxxxx
321
+ ```
322
+
323
+ ### `config.yaml` file
324
+ ```yaml
325
+ version: "1.0"
326
+
327
+ # GitHub configuration with organization discovery
328
+ github:
329
+ token: "${GITHUB_TOKEN}"
330
+ organization: "${GITHUB_ORG}"
331
+
332
+ # JIRA integration for story points
333
+ jira:
334
+ access_user: "${JIRA_ACCESS_USER}"
335
+ access_token: "${JIRA_ACCESS_TOKEN}"
336
+ base_url: "https://ewtn.atlassian.net"
337
+
338
+ jira_integration:
339
+ enabled: true
340
+ fetch_story_points: true
341
+ story_point_fields:
342
+ - "Story point estimate" # Your field name
343
+ - "customfield_10016" # Fallback field ID
344
+
345
+ # Analysis configuration
346
+ analysis:
347
+ # Only track JIRA tickets (ignore GitHub issues, etc.)
348
+ ticket_platforms:
349
+ - jira
350
+
351
+ # Exclude bot commits and boilerplate files
352
+ exclude:
353
+ authors:
354
+ - "dependabot[bot]"
355
+ - "renovate[bot]"
356
+ paths:
357
+ - "**/node_modules/**"
358
+ - "**/*.min.js"
359
+ - "**/package-lock.json"
360
+
361
+ # Developer identity consolidation
362
+ identity:
363
+ similarity_threshold: 0.85
364
+ manual_mappings:
365
+ - primary_email: "john.doe@company.com"
366
+ aliases:
367
+ - "jdoe@oldcompany.com"
368
+ - "john@personal.com"
369
+
370
+ # Output configuration
371
+ output:
372
+ directory: "./reports"
373
+ formats:
374
+ - csv
375
+ - markdown
376
+ ```
377
+
378
+ ## Output Reports
379
+
380
+ The tool generates three CSV reports:
381
+
382
+ 1. **Weekly Metrics** (`weekly_metrics_YYYYMMDD.csv`)
383
+ - Week-by-week developer productivity
384
+ - Story points, commits, lines changed
385
+ - Ticket coverage percentages
386
+ - Per-project breakdown
387
+
388
+ 2. **Summary Statistics** (`summary_YYYYMMDD.csv`)
389
+ - Overall project statistics
390
+ - Platform-specific ticket counts
391
+ - Top contributors
392
+
393
+ 3. **Developer Report** (`developers_YYYYMMDD.csv`)
394
+ - Complete developer profiles
395
+ - Total contributions
396
+ - Identity aliases
397
+
398
+ ## Story Point Patterns
399
+
400
+ Configure custom regex patterns to match your team's story point format:
401
+
402
+ ```yaml
403
+ story_point_patterns:
404
+ - "SP: (\\d+)" # SP: 5
405
+ - "\\[([0-9]+) pts\\]" # [3 pts]
406
+ - "estimate: (\\d+)" # estimate: 8
407
+ ```
408
+
409
+ ## Ticket Platform Support
410
+
411
+ Automatically detects and tracks tickets from:
412
+ - **JIRA**: `PROJ-123`
413
+ - **GitHub**: `#123`, `GH-123`
414
+ - **ClickUp**: `CU-abc123`
415
+ - **Linear**: `ENG-123`
416
+
417
+ ### JIRA Integration
418
+
419
+ GitFlow Analytics can fetch story points directly from JIRA tickets. Configure your JIRA instance:
420
+
421
+ ```yaml
422
+ jira:
423
+ access_user: "${JIRA_ACCESS_USER}"
424
+ access_token: "${JIRA_ACCESS_TOKEN}"
425
+ base_url: "https://your-company.atlassian.net"
426
+
427
+ jira_integration:
428
+ enabled: true
429
+ story_point_fields:
430
+ - "Story point estimate" # Your custom field name
431
+ - "customfield_10016" # Or use field ID
432
+ ```
433
+
434
+ To discover your JIRA story point fields:
435
+ ```bash
436
+ gitflow-analytics discover-jira-fields -c config.yaml
437
+ ```
438
+
439
+ ## Caching
440
+
441
+ The tool uses SQLite for intelligent caching:
442
+ - Commit analysis results
443
+ - Developer identity mappings
444
+ - Pull request data
445
+
446
+ Cache is automatically managed with configurable TTL.
447
+
448
+ ## Developer Identity Resolution
449
+
450
+ Intelligently merges developer identities across:
451
+ - Different email addresses
452
+ - Name variations
453
+ - GitHub usernames
454
+
455
+ Manual overrides supported in configuration.
456
+
457
+ ## Contributing
458
+
459
+ Contributions are welcome! Please feel free to submit a Pull Request.
460
+
461
+ ## License
462
+
463
+ This project is licensed under the MIT License - see the LICENSE file for details.