1- # GitHub Analyzer
1+ # DevAnalyzer ( GitHub Analyzer)
22
33[ ![ Tests] ( https://github.com/Oltrematica/github_analyzer/actions/workflows/tests.yml/badge.svg )] ( https://github.com/Oltrematica/github_analyzer/actions/workflows/tests.yml )
44[ ![ codecov] ( https://codecov.io/gh/Oltrematica/github_analyzer/branch/main/graph/badge.svg )] ( https://codecov.io/gh/Oltrematica/github_analyzer )
55[ ![ Python 3.9+] ( https://img.shields.io/badge/python-3.9+-blue.svg )] ( https://www.python.org/downloads/ )
66[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
77
8- A powerful Python command-line tool for analyzing GitHub repositories and extracting comprehensive metrics about commits, pull requests, issues, and contributor activity. Generate detailed CSV reports for productivity analysis and code quality assessment.
8+ A powerful Python command-line tool for analyzing GitHub repositories and Jira projects, extracting comprehensive metrics about commits, pull requests, issues, and contributor activity. Generate detailed CSV reports for productivity analysis and code quality assessment.
99
1010![ GitHub Analyzer Banner] ( screens/screen1.png )
1111
1212## Features
1313
14+ ### GitHub Analysis
1415- ** Commit Analysis** - Track commits with detailed statistics including additions, deletions, merge detection, and revert identification
1516- ** Pull Request Metrics** - Monitor PR workflow, merge times, review coverage, and approval rates
1617- ** Issue Tracking** - Analyze issue resolution times, categorization (bugs vs enhancements), and closure rates
1718- ** Contributor Insights** - Identify top contributors with activity metrics and productivity scoring
1819- ** Multi-Repository Support** - Analyze multiple repositories in a single run with aggregated statistics
1920- ** Quality Metrics** - Assess code quality through revert ratios, review coverage, and commit message analysis
2021- ** Productivity Scoring** - Calculate composite productivity scores for contributors across repositories
22+
23+ ### Jira Integration (NEW)
24+ - ** Jira Issue Extraction** - Extract issues and comments from Jira Cloud and Server/Data Center
25+ - ** Multi-Project Support** - Analyze multiple Jira projects with interactive project selection
26+ - ** Time-Based Filtering** - Filter issues by update date using JQL queries
27+ - ** Comment Tracking** - Export all issue comments with author and timestamp
28+ - ** ADF Support** - Automatically converts Atlassian Document Format to plain text
29+
30+ ### Core Features
31+ - ** Multi-Source CLI** - Use ` --sources ` flag to select GitHub, Jira, or both
32+ - ** Auto-Detection** - Automatically detects available sources from environment credentials
2133- ** Zero Dependencies** - Works with Python standard library only (optional ` requests ` for better performance)
22- - ** Secure Token Handling** - Token loaded from environment variable , never exposed in logs or error messages
34+ - ** Secure Token Handling** - Tokens loaded from environment variables , never exposed in logs or error messages
2335
2436## Requirements
2537
@@ -123,14 +135,40 @@ The tool shows real-time progress with detailed information for each repository:
123135
124136### Environment Variables
125137
138+ ** GitHub Configuration:**
139+
126140| Variable | Required | Default | Description |
127141| ----------| ----------| ---------| -------------|
128- | ` GITHUB_TOKEN ` | ** Yes** | - | GitHub Personal Access Token |
142+ | ` GITHUB_TOKEN ` | ** Yes*** | - | GitHub Personal Access Token |
129143| ` GITHUB_ANALYZER_DAYS ` | No | 30 | Number of days to analyze |
130144| ` GITHUB_ANALYZER_OUTPUT_DIR ` | No | ` github_export ` | Output directory for CSV files |
131145| ` GITHUB_ANALYZER_REPOS_FILE ` | No | ` repos.txt ` | Repository list file |
132146| ` GITHUB_ANALYZER_VERBOSE ` | No | ` true ` | Enable detailed logging |
133147
148+ ** Jira Configuration:**
149+
150+ | Variable | Required | Default | Description |
151+ | ----------| ----------| ---------| -------------|
152+ | ` JIRA_URL ` | ** Yes*** | - | Jira instance URL (e.g., ` https://company.atlassian.net ` ) |
153+ | ` JIRA_EMAIL ` | ** Yes*** | - | Jira account email |
154+ | ` JIRA_API_TOKEN ` | ** Yes*** | - | Jira API token |
155+
156+ * Required only if using that source. Auto-detection skips sources without credentials.
157+
158+ ### How to Generate a Jira API Token
159+
160+ ** For Jira Cloud (Atlassian Cloud):**
161+ 1 . Go to https://id.atlassian.com/manage-profile/security/api-tokens
162+ 2 . Click ** "Create API token"**
163+ 3 . Give it a descriptive name (e.g., "dev-analyzer")
164+ 4 . Click ** "Create"** and copy the token immediately (shown only once!)
165+
166+ ** For Jira Server / Data Center:**
167+ 1 . Go to ** Profile** → ** Personal Access Tokens**
168+ 2 . Click ** "Create token"**
169+ 3 . Select appropriate permissions and create
170+ 4 . Copy the generated token
171+
134172** Note:** CLI arguments override environment variables.
135173
136174### repos.txt Format
@@ -149,9 +187,28 @@ astral-sh/ruff
149187# Duplicates are automatically removed
150188```
151189
190+ ### jira_projects.txt Format
191+
192+ ``` txt
193+ # Add Jira project keys to analyze (one per line)
194+ # Project keys are case-sensitive (usually uppercase)
195+
196+ PROJ
197+ DEV
198+ OPS
199+
200+ # Lines starting with # are comments
201+ # Empty lines are ignored
202+ # Duplicates are automatically removed
203+ ```
204+
205+ If this file is missing, the tool will prompt you interactively to select from available projects.
206+
152207## Output Files
153208
154- The analyzer generates 7 CSV files in the output directory:
209+ The analyzer generates CSV files in the output directory. GitHub outputs are always generated when analyzing GitHub, and Jira outputs when analyzing Jira:
210+
211+ ** GitHub outputs (7 files):**
155212
156213![ Analysis Summary] ( screens/screen3.png )
157214
@@ -165,6 +222,13 @@ The analyzer generates 7 CSV files in the output directory:
165222| ` productivity_analysis.csv ` | Per-contributor productivity metrics and scores |
166223| ` contributors_summary.csv ` | Contributor overview with commit and PR statistics |
167224
225+ ** Jira outputs (2 files):**
226+
227+ | File | Description |
228+ | ------| -------------|
229+ | ` jira_issues_export.csv ` | Jira issues with key, summary, status, type, priority, assignee, reporter, dates |
230+ | ` jira_comments_export.csv ` | Jira issue comments with issue key, author, date, body |
231+
168232### CSV Field Details
169233
170234#### commits_export.csv
@@ -341,6 +405,39 @@ export GITHUB_TOKEN=ghp_your_token_here
341405- Verify repository names in ` repos.txt ` are correct
342406- Ensure the token has read access to the repositories
343407
408+ ### "JIRA_URL environment variable not set"
409+ ``` bash
410+ export JIRA_URL=" https://yourcompany.atlassian.net"
411+ export JIRA_EMAIL=" your.email@company.com"
412+ export JIRA_API_TOKEN=" your-api-token"
413+ ```
414+
415+ ### "Jira authentication failed"
416+ - Verify your email matches your Jira account exactly
417+ - Check that the API token is valid and not expired
418+ - For Jira Cloud, ensure you're using the correct email (not username)
419+ - For Jira Server/Data Center, verify the token has appropriate permissions
420+
421+ ### "Jira project not found: PROJ"
422+ - Project keys are case-sensitive (usually uppercase)
423+ - Verify you have access to the project with your account
424+ - Check the project key in Jira (visible in issue keys like PROJ-123)
425+
426+ ### "Jira rate limit exceeded"
427+ - The tool automatically retries with exponential backoff
428+ - If persistent, wait a few minutes and retry
429+ - Reduce the number of projects in ` jira_projects.txt `
430+ - Use a shorter analysis period with ` --days `
431+
432+ ### Jira skipped (no credentials)
433+ - This is expected if you only have GitHub configured
434+ - To use Jira, set all three required environment variables: ` JIRA_URL ` , ` JIRA_EMAIL ` , ` JIRA_API_TOKEN `
435+
436+ ### Empty Jira CSV files
437+ - Check if projects have issues updated in the specified period
438+ - Verify project keys in ` jira_projects.txt ` are correct
439+ - Ensure your account has permission to view the projects
440+
344441## Security
345442
346443- ** Token Security** : The GitHub token is loaded from the ` GITHUB_TOKEN ` environment variable and is never stored, logged, or exposed in error messages
@@ -373,7 +470,7 @@ pytest tests/ -v
373470ruff check src/github_analyzer/
374471```
375472
376- We aim for ** ≥95 % test coverage** . Open an issue for discussion before starting major changes.
473+ We aim for ** ≥90 % test coverage** . Open an issue for discussion before starting major changes.
377474
378475## License
379476
0 commit comments