gitflow-analytics 1.0.0__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.
- gitflow_analytics-1.0.0/CHANGELOG.md +54 -0
- gitflow_analytics-1.0.0/CLAUDE.md +201 -0
- gitflow_analytics-1.0.0/LICENSE +21 -0
- gitflow_analytics-1.0.0/MANIFEST.in +11 -0
- gitflow_analytics-1.0.0/PKG-INFO +201 -0
- gitflow_analytics-1.0.0/README.md +156 -0
- gitflow_analytics-1.0.0/docs/DEPLOY.md +261 -0
- gitflow_analytics-1.0.0/docs/configuration.md +172 -0
- gitflow_analytics-1.0.0/docs/design/git_pm_correlation_design.md +1005 -0
- gitflow_analytics-1.0.0/pyproject.toml +116 -0
- gitflow_analytics-1.0.0/setup.cfg +4 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/__init__.py +22 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/_version.py +4 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/cli.py +441 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/config.py +215 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/core/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/core/analyzer.py +195 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/core/branch_mapper.py +221 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/core/cache.py +275 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/core/identity.py +402 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/extractors/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/extractors/base.py +41 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/extractors/story_points.py +128 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/extractors/tickets.py +157 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/integrations/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/integrations/github_integration.py +160 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/integrations/orchestrator.py +119 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/metrics/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/metrics/dora.py +327 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/models/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/models/database.py +171 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/reports/__init__.py +0 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/reports/analytics_writer.py +454 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/reports/csv_writer.py +311 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics/reports/narrative_writer.py +263 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/PKG-INFO +201 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/SOURCES.txt +39 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/dependency_links.txt +1 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/entry_points.txt +2 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/requires.txt +21 -0
- gitflow_analytics-1.0.0/src/gitflow_analytics.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
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.0] - 2025-07-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial release of GitFlow Analytics
|
|
12
|
+
- Core Git repository analysis with batch processing
|
|
13
|
+
- Developer identity resolution with fuzzy matching
|
|
14
|
+
- Manual identity mapping support
|
|
15
|
+
- Story point extraction from commit messages
|
|
16
|
+
- Multi-platform ticket tracking (GitHub, JIRA, Linear, ClickUp)
|
|
17
|
+
- Comprehensive caching system with SQLite
|
|
18
|
+
- CSV report generation:
|
|
19
|
+
- Weekly metrics
|
|
20
|
+
- Developer statistics
|
|
21
|
+
- Activity distribution
|
|
22
|
+
- Developer focus analysis
|
|
23
|
+
- Qualitative insights
|
|
24
|
+
- Markdown narrative reports with insights
|
|
25
|
+
- JSON export for API integration
|
|
26
|
+
- DORA metrics calculation:
|
|
27
|
+
- Deployment frequency
|
|
28
|
+
- Lead time for changes
|
|
29
|
+
- Mean time to recovery
|
|
30
|
+
- Change failure rate
|
|
31
|
+
- GitHub PR enrichment (optional)
|
|
32
|
+
- Branch to project mapping
|
|
33
|
+
- YAML configuration with environment variable support
|
|
34
|
+
- Progress bars for long operations
|
|
35
|
+
- Anonymization support for reports
|
|
36
|
+
|
|
37
|
+
### Configuration Features
|
|
38
|
+
- Repository definitions with project keys
|
|
39
|
+
- Story point extraction patterns
|
|
40
|
+
- Developer identity similarity threshold
|
|
41
|
+
- Manual identity mappings
|
|
42
|
+
- Default ticket platform specification
|
|
43
|
+
- Branch mapping rules
|
|
44
|
+
- Output format selection
|
|
45
|
+
- Cache TTL configuration
|
|
46
|
+
|
|
47
|
+
### Developer Experience
|
|
48
|
+
- Clear CLI with helpful error messages
|
|
49
|
+
- Comprehensive documentation
|
|
50
|
+
- Sample configuration files
|
|
51
|
+
- Progress indicators during analysis
|
|
52
|
+
- Detailed logging of operations
|
|
53
|
+
|
|
54
|
+
[1.0.0]: https://github.com/bobmatnyc/gitflow-analytics/releases/tag/v1.0.0
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Claude Developer Instructions for GitFlow Analytics
|
|
2
|
+
|
|
3
|
+
This document provides specific instructions for Claude (AI assistant) when working on the GitFlow Analytics project. It ensures consistent development practices and helps maintain code quality.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
GitFlow Analytics is a Python package that analyzes Git repositories to generate developer productivity insights without requiring external project management tools. It provides comprehensive metrics including commit patterns, developer focus, ticket tracking, and DORA metrics.
|
|
8
|
+
|
|
9
|
+
## Key Development Guidelines
|
|
10
|
+
|
|
11
|
+
### 1. Code Quality Standards
|
|
12
|
+
|
|
13
|
+
When modifying code:
|
|
14
|
+
- **Always run linting and type checking** before committing:
|
|
15
|
+
```bash
|
|
16
|
+
ruff check src/
|
|
17
|
+
mypy src/
|
|
18
|
+
black src/
|
|
19
|
+
```
|
|
20
|
+
- **Run tests** after making changes:
|
|
21
|
+
```bash
|
|
22
|
+
pytest tests/
|
|
23
|
+
```
|
|
24
|
+
- **Follow existing code patterns** - check neighboring files for conventions
|
|
25
|
+
|
|
26
|
+
### 2. Identity Resolution
|
|
27
|
+
|
|
28
|
+
The project has a sophisticated developer identity resolution system:
|
|
29
|
+
- Handles multiple email addresses per developer
|
|
30
|
+
- Supports manual identity mappings in configuration
|
|
31
|
+
- Uses fuzzy matching with configurable threshold (default: 0.85)
|
|
32
|
+
- **Important**: When debugging identity issues, check `.gitflow-cache/identities.db`
|
|
33
|
+
|
|
34
|
+
### 3. Caching System
|
|
35
|
+
|
|
36
|
+
The project uses SQLite for caching:
|
|
37
|
+
- Commit cache: `.gitflow-cache/gitflow_cache.db`
|
|
38
|
+
- Identity cache: `.gitflow-cache/identities.db`
|
|
39
|
+
- **Always provide `--clear-cache` option** when testing configuration changes
|
|
40
|
+
|
|
41
|
+
### 4. Configuration Management
|
|
42
|
+
|
|
43
|
+
Configuration uses YAML with environment variable support:
|
|
44
|
+
- Variables use format: `${VARIABLE_NAME}`
|
|
45
|
+
- Default ticket platform can be specified
|
|
46
|
+
- Branch mapping rules for project inference
|
|
47
|
+
- Manual identity mappings for consolidating developer identities
|
|
48
|
+
|
|
49
|
+
### 5. Report Generation
|
|
50
|
+
|
|
51
|
+
The system generates multiple report types:
|
|
52
|
+
- **CSV Reports**: Weekly metrics, developer stats, activity distribution
|
|
53
|
+
- **Markdown Reports**: Narrative summaries with insights
|
|
54
|
+
- **JSON Export**: Complete data export for API integration
|
|
55
|
+
|
|
56
|
+
### 6. Testing Workflow
|
|
57
|
+
|
|
58
|
+
When testing changes:
|
|
59
|
+
1. Use the recess-recreo repositories as test data
|
|
60
|
+
2. Run with `--weeks 8` for consistent test periods
|
|
61
|
+
3. Check all report outputs for correctness
|
|
62
|
+
4. Verify identity resolution is working properly
|
|
63
|
+
|
|
64
|
+
### 7. Common Tasks
|
|
65
|
+
|
|
66
|
+
#### Adding a New Report Type
|
|
67
|
+
|
|
68
|
+
1. Create report generator in `src/gitflow_analytics/reports/`
|
|
69
|
+
2. Add to report generation pipeline in `cli.py`
|
|
70
|
+
3. Update configuration to support format selection
|
|
71
|
+
4. Document the report format in README
|
|
72
|
+
|
|
73
|
+
#### Adding a New Ticket Platform
|
|
74
|
+
|
|
75
|
+
1. Update regex patterns in `TicketExtractor`
|
|
76
|
+
2. Add platform to ticket counting logic
|
|
77
|
+
3. Test with sample commit messages
|
|
78
|
+
4. Update documentation
|
|
79
|
+
|
|
80
|
+
#### Debugging Identity Issues
|
|
81
|
+
|
|
82
|
+
1. Check identity database:
|
|
83
|
+
```bash
|
|
84
|
+
sqlite3 .gitflow-cache/identities.db "SELECT * FROM developer_identities"
|
|
85
|
+
```
|
|
86
|
+
2. Review manual mappings in config
|
|
87
|
+
3. Clear cache and re-run analysis
|
|
88
|
+
4. Check for typos in email addresses
|
|
89
|
+
|
|
90
|
+
### 8. Performance Considerations
|
|
91
|
+
|
|
92
|
+
- **Batch processing**: Commits are processed in batches (default: 1000)
|
|
93
|
+
- **Progress bars**: Use tqdm for long operations
|
|
94
|
+
- **Caching**: Aggressive caching to avoid re-processing
|
|
95
|
+
- **Memory usage**: Be mindful with large repositories
|
|
96
|
+
|
|
97
|
+
### 9. Error Handling
|
|
98
|
+
|
|
99
|
+
- **GitHub API errors**: Handle rate limiting and authentication failures gracefully
|
|
100
|
+
- **File system errors**: Check permissions and paths
|
|
101
|
+
- **Database locks**: Use proper session management with SQLAlchemy
|
|
102
|
+
- **Configuration errors**: Provide helpful error messages
|
|
103
|
+
|
|
104
|
+
### 10. Documentation Updates
|
|
105
|
+
|
|
106
|
+
When adding features:
|
|
107
|
+
1. Update README.md with user-facing changes
|
|
108
|
+
2. Update this file (CLAUDE.md) with developer notes
|
|
109
|
+
3. Add docstrings to all new functions/classes
|
|
110
|
+
4. Update configuration examples if needed
|
|
111
|
+
|
|
112
|
+
## Project Structure
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
gitflow-analytics/
|
|
116
|
+
├── src/gitflow_analytics/
|
|
117
|
+
│ ├── __init__.py # Package initialization
|
|
118
|
+
│ ├── _version.py # Version information
|
|
119
|
+
│ ├── cli.py # CLI entry point
|
|
120
|
+
│ ├── config.py # Configuration handling
|
|
121
|
+
│ ├── core/ # Core analysis logic
|
|
122
|
+
│ │ ├── analyzer.py # Git analysis
|
|
123
|
+
│ │ ├── branch_mapper.py # Branch to project mapping
|
|
124
|
+
│ │ ├── cache.py # Caching system
|
|
125
|
+
│ │ └── identity.py # Developer identity resolution
|
|
126
|
+
│ ├── extractors/ # Data extraction
|
|
127
|
+
│ │ ├── story_points.py # Story point extraction
|
|
128
|
+
│ │ └── tickets.py # Ticket reference extraction
|
|
129
|
+
│ ├── integrations/ # External integrations
|
|
130
|
+
│ │ └── github_client.py # GitHub API client
|
|
131
|
+
│ ├── metrics/ # Metric calculations
|
|
132
|
+
│ │ └── dora.py # DORA metrics
|
|
133
|
+
│ ├── models/ # Data models
|
|
134
|
+
│ │ └── database.py # SQLAlchemy models
|
|
135
|
+
│ └── reports/ # Report generation
|
|
136
|
+
│ ├── analytics_writer.py
|
|
137
|
+
│ ├── csv_writer.py
|
|
138
|
+
│ └── narrative_writer.py
|
|
139
|
+
├── tests/ # Test suite
|
|
140
|
+
├── docs/ # Documentation
|
|
141
|
+
│ ├── design/ # Design documents
|
|
142
|
+
│ └── DEPLOY.md # Deployment guide
|
|
143
|
+
├── config-sample.yaml # Sample configuration
|
|
144
|
+
├── pyproject.toml # Project metadata
|
|
145
|
+
└── README.md # User documentation
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Version Management
|
|
149
|
+
|
|
150
|
+
- Version is stored in `src/gitflow_analytics/_version.py`
|
|
151
|
+
- Follow semantic versioning (MAJOR.MINOR.PATCH)
|
|
152
|
+
- Update version before releases
|
|
153
|
+
- Tag releases with `v` prefix (e.g., `v1.0.0`)
|
|
154
|
+
|
|
155
|
+
## Release Process
|
|
156
|
+
|
|
157
|
+
1. Update version in `_version.py`
|
|
158
|
+
2. Run full test suite
|
|
159
|
+
3. Update CHANGELOG.md
|
|
160
|
+
4. Commit with message: `chore: bump version to X.Y.Z`
|
|
161
|
+
5. Tag the release: `git tag -a vX.Y.Z -m "Release version X.Y.Z"`
|
|
162
|
+
6. Push tags: `git push origin main --tags`
|
|
163
|
+
7. Build and publish to PyPI (see DEPLOY.md)
|
|
164
|
+
|
|
165
|
+
## Common Gotchas
|
|
166
|
+
|
|
167
|
+
1. **Timezone issues**: GitHub API returns timezone-aware timestamps
|
|
168
|
+
2. **Branch detection**: Simplified branch detection may not work for all workflows
|
|
169
|
+
3. **Memory usage**: Large repositories can consume significant memory
|
|
170
|
+
4. **Identity resolution**: Manual mappings must be applied after initial analysis
|
|
171
|
+
5. **Cache invalidation**: Some changes require clearing the cache
|
|
172
|
+
|
|
173
|
+
## Quick Commands
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Install in development mode
|
|
177
|
+
pip install -e ".[dev]"
|
|
178
|
+
|
|
179
|
+
# Run analysis on test repos
|
|
180
|
+
gitflow-analytics analyze --config config-recess.yaml --weeks 8
|
|
181
|
+
|
|
182
|
+
# Clear cache and re-run
|
|
183
|
+
gitflow-analytics analyze --config config-recess.yaml --weeks 8 --clear-cache
|
|
184
|
+
|
|
185
|
+
# Run tests with coverage
|
|
186
|
+
pytest --cov=gitflow_analytics --cov-report=html
|
|
187
|
+
|
|
188
|
+
# Format code
|
|
189
|
+
black src/ tests/
|
|
190
|
+
|
|
191
|
+
# Check code quality
|
|
192
|
+
ruff check src/
|
|
193
|
+
mypy src/
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Contact
|
|
197
|
+
|
|
198
|
+
For questions about development practices or architecture decisions, refer to:
|
|
199
|
+
- Design documents in `docs/design/`
|
|
200
|
+
- GitHub issues for bug reports
|
|
201
|
+
- Pull request discussions for feature proposals
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Bob Matyas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include CLAUDE.md
|
|
5
|
+
include pyproject.toml
|
|
6
|
+
include config-sample.yaml
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
global-exclude __pycache__
|
|
10
|
+
global-exclude *.py[co]
|
|
11
|
+
global-exclude .DS_Store
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gitflow-analytics
|
|
3
|
+
Version: 1.0.0
|
|
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: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: click>=8.1
|
|
27
|
+
Requires-Dist: gitpython>=3.1
|
|
28
|
+
Requires-Dist: tqdm>=4.65
|
|
29
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
30
|
+
Requires-Dist: pandas>=2.0
|
|
31
|
+
Requires-Dist: pyyaml>=6.0
|
|
32
|
+
Requires-Dist: python-dateutil>=2.8
|
|
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
|
+
- 👥 **Developer identity resolution** and normalization
|
|
54
|
+
- 📊 **Work volume analysis** (absolute vs relative effort)
|
|
55
|
+
- 🎯 **Story point extraction** from commit messages and PR descriptions
|
|
56
|
+
- 🎫 **Multi-platform ticket tracking** (JIRA, GitHub Issues, ClickUp, Linear)
|
|
57
|
+
- 📈 **Weekly CSV reports** with productivity metrics
|
|
58
|
+
- 🔒 **Data anonymization** for external sharing
|
|
59
|
+
- âš¡ **Smart caching** for fast repeated analyses
|
|
60
|
+
- 🔄 **Batch processing** for large repositories
|
|
61
|
+
|
|
62
|
+
## Quick Start
|
|
63
|
+
|
|
64
|
+
### Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install gitflow-analytics
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Basic Usage
|
|
71
|
+
|
|
72
|
+
1. Create a configuration file (`config.yaml`):
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
version: "1.0"
|
|
76
|
+
|
|
77
|
+
github:
|
|
78
|
+
token: "${GITHUB_TOKEN}"
|
|
79
|
+
owner: "${GITHUB_OWNER}"
|
|
80
|
+
|
|
81
|
+
repositories:
|
|
82
|
+
- name: "frontend"
|
|
83
|
+
path: "~/repos/frontend"
|
|
84
|
+
github_repo: "myorg/frontend"
|
|
85
|
+
project_key: "FRONTEND"
|
|
86
|
+
|
|
87
|
+
- name: "backend"
|
|
88
|
+
path: "~/repos/backend"
|
|
89
|
+
github_repo: "myorg/backend"
|
|
90
|
+
project_key: "BACKEND"
|
|
91
|
+
|
|
92
|
+
analysis:
|
|
93
|
+
story_point_patterns:
|
|
94
|
+
- "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
|
|
95
|
+
- "\\[(\\d+)\\s*(?:sp|pts?)\\]"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
2. Set environment variables:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
export GITHUB_TOKEN=your_github_token
|
|
102
|
+
export GITHUB_OWNER=your_github_org
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
3. Run the analysis:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
gitflow-analytics analyze -c config.yaml
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Command Line Interface
|
|
112
|
+
|
|
113
|
+
### Main Commands
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Analyze repositories
|
|
117
|
+
gitflow-analytics analyze -c config.yaml --weeks 12 --output ./reports
|
|
118
|
+
|
|
119
|
+
# Show cache statistics
|
|
120
|
+
gitflow-analytics cache-stats -c config.yaml
|
|
121
|
+
|
|
122
|
+
# List known developers
|
|
123
|
+
gitflow-analytics list-developers -c config.yaml
|
|
124
|
+
|
|
125
|
+
# Merge developer identities
|
|
126
|
+
gitflow-analytics merge-identity -c config.yaml dev1_id dev2_id
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Options
|
|
130
|
+
|
|
131
|
+
- `--weeks, -w`: Number of weeks to analyze (default: 12)
|
|
132
|
+
- `--output, -o`: Output directory for reports (default: ./reports)
|
|
133
|
+
- `--anonymize`: Anonymize developer information
|
|
134
|
+
- `--no-cache`: Disable caching for fresh analysis
|
|
135
|
+
- `--clear-cache`: Clear cache before analysis
|
|
136
|
+
- `--validate-only`: Validate configuration without running
|
|
137
|
+
|
|
138
|
+
## Output Reports
|
|
139
|
+
|
|
140
|
+
The tool generates three CSV reports:
|
|
141
|
+
|
|
142
|
+
1. **Weekly Metrics** (`weekly_metrics_YYYYMMDD.csv`)
|
|
143
|
+
- Week-by-week developer productivity
|
|
144
|
+
- Story points, commits, lines changed
|
|
145
|
+
- Ticket coverage percentages
|
|
146
|
+
- Per-project breakdown
|
|
147
|
+
|
|
148
|
+
2. **Summary Statistics** (`summary_YYYYMMDD.csv`)
|
|
149
|
+
- Overall project statistics
|
|
150
|
+
- Platform-specific ticket counts
|
|
151
|
+
- Top contributors
|
|
152
|
+
|
|
153
|
+
3. **Developer Report** (`developers_YYYYMMDD.csv`)
|
|
154
|
+
- Complete developer profiles
|
|
155
|
+
- Total contributions
|
|
156
|
+
- Identity aliases
|
|
157
|
+
|
|
158
|
+
## Story Point Patterns
|
|
159
|
+
|
|
160
|
+
Configure custom regex patterns to match your team's story point format:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
story_point_patterns:
|
|
164
|
+
- "SP: (\\d+)" # SP: 5
|
|
165
|
+
- "\\[([0-9]+) pts\\]" # [3 pts]
|
|
166
|
+
- "estimate: (\\d+)" # estimate: 8
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Ticket Platform Support
|
|
170
|
+
|
|
171
|
+
Automatically detects and tracks tickets from:
|
|
172
|
+
- **JIRA**: `PROJ-123`
|
|
173
|
+
- **GitHub**: `#123`, `GH-123`
|
|
174
|
+
- **ClickUp**: `CU-abc123`
|
|
175
|
+
- **Linear**: `ENG-123`
|
|
176
|
+
|
|
177
|
+
## Caching
|
|
178
|
+
|
|
179
|
+
The tool uses SQLite for intelligent caching:
|
|
180
|
+
- Commit analysis results
|
|
181
|
+
- Developer identity mappings
|
|
182
|
+
- Pull request data
|
|
183
|
+
|
|
184
|
+
Cache is automatically managed with configurable TTL.
|
|
185
|
+
|
|
186
|
+
## Developer Identity Resolution
|
|
187
|
+
|
|
188
|
+
Intelligently merges developer identities across:
|
|
189
|
+
- Different email addresses
|
|
190
|
+
- Name variations
|
|
191
|
+
- GitHub usernames
|
|
192
|
+
|
|
193
|
+
Manual overrides supported in configuration.
|
|
194
|
+
|
|
195
|
+
## Contributing
|
|
196
|
+
|
|
197
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# GitFlow Analytics
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🚀 **Multi-repository analysis** with project grouping
|
|
8
|
+
- 👥 **Developer identity resolution** and normalization
|
|
9
|
+
- 📊 **Work volume analysis** (absolute vs relative effort)
|
|
10
|
+
- 🎯 **Story point extraction** from commit messages and PR descriptions
|
|
11
|
+
- 🎫 **Multi-platform ticket tracking** (JIRA, GitHub Issues, ClickUp, Linear)
|
|
12
|
+
- 📈 **Weekly CSV reports** with productivity metrics
|
|
13
|
+
- 🔒 **Data anonymization** for external sharing
|
|
14
|
+
- âš¡ **Smart caching** for fast repeated analyses
|
|
15
|
+
- 🔄 **Batch processing** for large repositories
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install gitflow-analytics
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Basic Usage
|
|
26
|
+
|
|
27
|
+
1. Create a configuration file (`config.yaml`):
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
version: "1.0"
|
|
31
|
+
|
|
32
|
+
github:
|
|
33
|
+
token: "${GITHUB_TOKEN}"
|
|
34
|
+
owner: "${GITHUB_OWNER}"
|
|
35
|
+
|
|
36
|
+
repositories:
|
|
37
|
+
- name: "frontend"
|
|
38
|
+
path: "~/repos/frontend"
|
|
39
|
+
github_repo: "myorg/frontend"
|
|
40
|
+
project_key: "FRONTEND"
|
|
41
|
+
|
|
42
|
+
- name: "backend"
|
|
43
|
+
path: "~/repos/backend"
|
|
44
|
+
github_repo: "myorg/backend"
|
|
45
|
+
project_key: "BACKEND"
|
|
46
|
+
|
|
47
|
+
analysis:
|
|
48
|
+
story_point_patterns:
|
|
49
|
+
- "(?:story\\s*points?|sp|pts?)\\s*[:=]\\s*(\\d+)"
|
|
50
|
+
- "\\[(\\d+)\\s*(?:sp|pts?)\\]"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. Set environment variables:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
export GITHUB_TOKEN=your_github_token
|
|
57
|
+
export GITHUB_OWNER=your_github_org
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
3. Run the analysis:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gitflow-analytics analyze -c config.yaml
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Command Line Interface
|
|
67
|
+
|
|
68
|
+
### Main Commands
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Analyze repositories
|
|
72
|
+
gitflow-analytics analyze -c config.yaml --weeks 12 --output ./reports
|
|
73
|
+
|
|
74
|
+
# Show cache statistics
|
|
75
|
+
gitflow-analytics cache-stats -c config.yaml
|
|
76
|
+
|
|
77
|
+
# List known developers
|
|
78
|
+
gitflow-analytics list-developers -c config.yaml
|
|
79
|
+
|
|
80
|
+
# Merge developer identities
|
|
81
|
+
gitflow-analytics merge-identity -c config.yaml dev1_id dev2_id
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Options
|
|
85
|
+
|
|
86
|
+
- `--weeks, -w`: Number of weeks to analyze (default: 12)
|
|
87
|
+
- `--output, -o`: Output directory for reports (default: ./reports)
|
|
88
|
+
- `--anonymize`: Anonymize developer information
|
|
89
|
+
- `--no-cache`: Disable caching for fresh analysis
|
|
90
|
+
- `--clear-cache`: Clear cache before analysis
|
|
91
|
+
- `--validate-only`: Validate configuration without running
|
|
92
|
+
|
|
93
|
+
## Output Reports
|
|
94
|
+
|
|
95
|
+
The tool generates three CSV reports:
|
|
96
|
+
|
|
97
|
+
1. **Weekly Metrics** (`weekly_metrics_YYYYMMDD.csv`)
|
|
98
|
+
- Week-by-week developer productivity
|
|
99
|
+
- Story points, commits, lines changed
|
|
100
|
+
- Ticket coverage percentages
|
|
101
|
+
- Per-project breakdown
|
|
102
|
+
|
|
103
|
+
2. **Summary Statistics** (`summary_YYYYMMDD.csv`)
|
|
104
|
+
- Overall project statistics
|
|
105
|
+
- Platform-specific ticket counts
|
|
106
|
+
- Top contributors
|
|
107
|
+
|
|
108
|
+
3. **Developer Report** (`developers_YYYYMMDD.csv`)
|
|
109
|
+
- Complete developer profiles
|
|
110
|
+
- Total contributions
|
|
111
|
+
- Identity aliases
|
|
112
|
+
|
|
113
|
+
## Story Point Patterns
|
|
114
|
+
|
|
115
|
+
Configure custom regex patterns to match your team's story point format:
|
|
116
|
+
|
|
117
|
+
```yaml
|
|
118
|
+
story_point_patterns:
|
|
119
|
+
- "SP: (\\d+)" # SP: 5
|
|
120
|
+
- "\\[([0-9]+) pts\\]" # [3 pts]
|
|
121
|
+
- "estimate: (\\d+)" # estimate: 8
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Ticket Platform Support
|
|
125
|
+
|
|
126
|
+
Automatically detects and tracks tickets from:
|
|
127
|
+
- **JIRA**: `PROJ-123`
|
|
128
|
+
- **GitHub**: `#123`, `GH-123`
|
|
129
|
+
- **ClickUp**: `CU-abc123`
|
|
130
|
+
- **Linear**: `ENG-123`
|
|
131
|
+
|
|
132
|
+
## Caching
|
|
133
|
+
|
|
134
|
+
The tool uses SQLite for intelligent caching:
|
|
135
|
+
- Commit analysis results
|
|
136
|
+
- Developer identity mappings
|
|
137
|
+
- Pull request data
|
|
138
|
+
|
|
139
|
+
Cache is automatically managed with configurable TTL.
|
|
140
|
+
|
|
141
|
+
## Developer Identity Resolution
|
|
142
|
+
|
|
143
|
+
Intelligently merges developer identities across:
|
|
144
|
+
- Different email addresses
|
|
145
|
+
- Name variations
|
|
146
|
+
- GitHub usernames
|
|
147
|
+
|
|
148
|
+
Manual overrides supported in configuration.
|
|
149
|
+
|
|
150
|
+
## Contributing
|
|
151
|
+
|
|
152
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|