@theihtisham/dev-pulse 1.0.0 → 1.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.
- package/.editorconfig +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +43 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +18 -0
- package/.github/dependabot.yml +16 -0
- package/.github/workflows/ci.yml +33 -0
- package/CODE_OF_CONDUCT.md +27 -0
- package/Dockerfile +8 -0
- package/LICENSE +21 -21
- package/README.md +135 -39
- package/SECURITY.md +22 -0
- package/devpulse/__init__.py +4 -4
- package/devpulse/api/__init__.py +1 -1
- package/devpulse/api/app.py +371 -371
- package/devpulse/cli/__init__.py +1 -1
- package/devpulse/cli/dashboard.py +131 -131
- package/devpulse/cli/main.py +678 -678
- package/devpulse/cli/render.py +175 -175
- package/devpulse/core/__init__.py +34 -34
- package/devpulse/core/analytics.py +487 -487
- package/devpulse/core/config.py +77 -77
- package/devpulse/core/database.py +612 -612
- package/devpulse/core/github_client.py +281 -281
- package/devpulse/core/models.py +142 -142
- package/devpulse/core/report_generator.py +454 -454
- package/devpulse/static/.gitkeep +1 -1
- package/devpulse/templates/report.html +64 -64
- package/package.json +35 -35
- package/pyproject.toml +80 -80
- package/requirements.txt +14 -14
- package/tests/__init__.py +1 -1
- package/tests/conftest.py +208 -208
- package/tests/test_analytics.py +284 -284
- package/tests/test_api.py +313 -313
- package/tests/test_cli.py +204 -204
- package/tests/test_config.py +47 -47
- package/tests/test_database.py +255 -255
- package/tests/test_models.py +107 -107
- package/tests/test_report_generator.py +173 -173
- package/jest.config.js +0 -7
package/devpulse/core/models.py
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
"""Pydantic models for DevPulse data structures."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime, date
|
|
4
|
-
from typing import Optional
|
|
5
|
-
|
|
6
|
-
from pydantic import BaseModel, Field
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class Commit(BaseModel):
|
|
10
|
-
sha: str
|
|
11
|
-
repo: str
|
|
12
|
-
author: str
|
|
13
|
-
author_date: str
|
|
14
|
-
message: str = ""
|
|
15
|
-
additions: int = 0
|
|
16
|
-
deletions: int = 0
|
|
17
|
-
url: str = ""
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class PullRequest(BaseModel):
|
|
21
|
-
number: int
|
|
22
|
-
repo: str
|
|
23
|
-
title: str = ""
|
|
24
|
-
author: str = ""
|
|
25
|
-
state: str = "open"
|
|
26
|
-
created_at: str = ""
|
|
27
|
-
merged_at: Optional[str] = None
|
|
28
|
-
closed_at: Optional[str] = None
|
|
29
|
-
additions: int = 0
|
|
30
|
-
deletions: int = 0
|
|
31
|
-
changed_files: int = 0
|
|
32
|
-
review_comments: int = 0
|
|
33
|
-
url: str = ""
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class Issue(BaseModel):
|
|
37
|
-
number: int
|
|
38
|
-
repo: str
|
|
39
|
-
title: str = ""
|
|
40
|
-
author: str = ""
|
|
41
|
-
state: str = "open"
|
|
42
|
-
labels: list[str] = Field(default_factory=list)
|
|
43
|
-
created_at: str = ""
|
|
44
|
-
closed_at: Optional[str] = None
|
|
45
|
-
url: str = ""
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class Review(BaseModel):
|
|
49
|
-
id: int
|
|
50
|
-
repo: str
|
|
51
|
-
pr_number: int
|
|
52
|
-
author: str = ""
|
|
53
|
-
state: str = ""
|
|
54
|
-
submitted_at: str = ""
|
|
55
|
-
body: str = ""
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class DeveloperMetrics(BaseModel):
|
|
59
|
-
author: str
|
|
60
|
-
commits_count: int = 0
|
|
61
|
-
prs_created: int = 0
|
|
62
|
-
prs_merged: int = 0
|
|
63
|
-
issues_opened: int = 0
|
|
64
|
-
issues_closed: int = 0
|
|
65
|
-
reviews_given: int = 0
|
|
66
|
-
avg_pr_merge_time_hours: float = 0.0
|
|
67
|
-
avg_review_turnaround_hours: float = 0.0
|
|
68
|
-
lines_added: int = 0
|
|
69
|
-
lines_removed: int = 0
|
|
70
|
-
commits_per_day: float = 0.0
|
|
71
|
-
active_days: int = 0
|
|
72
|
-
period_days: int = 30
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class SprintData(BaseModel):
|
|
76
|
-
name: str
|
|
77
|
-
total_points: float = 0
|
|
78
|
-
completed_points: float = 0
|
|
79
|
-
remaining_points: float = 0
|
|
80
|
-
added_points: float = 0
|
|
81
|
-
start_date: str = ""
|
|
82
|
-
end_date: str = ""
|
|
83
|
-
velocity: float = 0
|
|
84
|
-
scope_creep_pct: float = 0
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class TeamHealth(BaseModel):
|
|
88
|
-
team_name: str = "team"
|
|
89
|
-
overall_score: float = 0.0
|
|
90
|
-
workload_balance: float = 0.0
|
|
91
|
-
burnout_risk: dict[str, float] = Field(default_factory=dict)
|
|
92
|
-
collaboration_score: float = 0.0
|
|
93
|
-
velocity_trend: str = "stable"
|
|
94
|
-
recommendations: list[str] = Field(default_factory=list)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class CodeQuality(BaseModel):
|
|
98
|
-
repo: str
|
|
99
|
-
date: str = ""
|
|
100
|
-
test_coverage: float = 0.0
|
|
101
|
-
open_bugs: int = 0
|
|
102
|
-
tech_debt_score: float = 0.0
|
|
103
|
-
lines_added: int = 0
|
|
104
|
-
lines_removed: int = 0
|
|
105
|
-
files_changed: int = 0
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class Goal(BaseModel):
|
|
109
|
-
id: Optional[int] = None
|
|
110
|
-
title: str
|
|
111
|
-
description: str = ""
|
|
112
|
-
target_value: float
|
|
113
|
-
current_value: float = 0
|
|
114
|
-
metric: str
|
|
115
|
-
deadline: Optional[str] = None
|
|
116
|
-
status: str = "active"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class DailyReport(BaseModel):
|
|
120
|
-
date: str
|
|
121
|
-
author: str
|
|
122
|
-
commits: int = 0
|
|
123
|
-
prs_opened: int = 0
|
|
124
|
-
prs_merged: int = 0
|
|
125
|
-
issues_opened: int = 0
|
|
126
|
-
issues_closed: int = 0
|
|
127
|
-
reviews_given: int = 0
|
|
128
|
-
lines_changed: int = 0
|
|
129
|
-
summary: str = ""
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
class WeeklyReport(BaseModel):
|
|
133
|
-
week_start: str
|
|
134
|
-
week_end: str
|
|
135
|
-
authors: list[str] = Field(default_factory=list)
|
|
136
|
-
total_commits: int = 0
|
|
137
|
-
total_prs: int = 0
|
|
138
|
-
total_issues_closed: int = 0
|
|
139
|
-
avg_merge_time_hours: float = 0.0
|
|
140
|
-
top_contributors: list[dict[str, int]] = Field(default_factory=list)
|
|
141
|
-
insights: list[str] = Field(default_factory=list)
|
|
142
|
-
recommendations: list[str] = Field(default_factory=list)
|
|
1
|
+
"""Pydantic models for DevPulse data structures."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime, date
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Commit(BaseModel):
|
|
10
|
+
sha: str
|
|
11
|
+
repo: str
|
|
12
|
+
author: str
|
|
13
|
+
author_date: str
|
|
14
|
+
message: str = ""
|
|
15
|
+
additions: int = 0
|
|
16
|
+
deletions: int = 0
|
|
17
|
+
url: str = ""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class PullRequest(BaseModel):
|
|
21
|
+
number: int
|
|
22
|
+
repo: str
|
|
23
|
+
title: str = ""
|
|
24
|
+
author: str = ""
|
|
25
|
+
state: str = "open"
|
|
26
|
+
created_at: str = ""
|
|
27
|
+
merged_at: Optional[str] = None
|
|
28
|
+
closed_at: Optional[str] = None
|
|
29
|
+
additions: int = 0
|
|
30
|
+
deletions: int = 0
|
|
31
|
+
changed_files: int = 0
|
|
32
|
+
review_comments: int = 0
|
|
33
|
+
url: str = ""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Issue(BaseModel):
|
|
37
|
+
number: int
|
|
38
|
+
repo: str
|
|
39
|
+
title: str = ""
|
|
40
|
+
author: str = ""
|
|
41
|
+
state: str = "open"
|
|
42
|
+
labels: list[str] = Field(default_factory=list)
|
|
43
|
+
created_at: str = ""
|
|
44
|
+
closed_at: Optional[str] = None
|
|
45
|
+
url: str = ""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Review(BaseModel):
|
|
49
|
+
id: int
|
|
50
|
+
repo: str
|
|
51
|
+
pr_number: int
|
|
52
|
+
author: str = ""
|
|
53
|
+
state: str = ""
|
|
54
|
+
submitted_at: str = ""
|
|
55
|
+
body: str = ""
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class DeveloperMetrics(BaseModel):
|
|
59
|
+
author: str
|
|
60
|
+
commits_count: int = 0
|
|
61
|
+
prs_created: int = 0
|
|
62
|
+
prs_merged: int = 0
|
|
63
|
+
issues_opened: int = 0
|
|
64
|
+
issues_closed: int = 0
|
|
65
|
+
reviews_given: int = 0
|
|
66
|
+
avg_pr_merge_time_hours: float = 0.0
|
|
67
|
+
avg_review_turnaround_hours: float = 0.0
|
|
68
|
+
lines_added: int = 0
|
|
69
|
+
lines_removed: int = 0
|
|
70
|
+
commits_per_day: float = 0.0
|
|
71
|
+
active_days: int = 0
|
|
72
|
+
period_days: int = 30
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class SprintData(BaseModel):
|
|
76
|
+
name: str
|
|
77
|
+
total_points: float = 0
|
|
78
|
+
completed_points: float = 0
|
|
79
|
+
remaining_points: float = 0
|
|
80
|
+
added_points: float = 0
|
|
81
|
+
start_date: str = ""
|
|
82
|
+
end_date: str = ""
|
|
83
|
+
velocity: float = 0
|
|
84
|
+
scope_creep_pct: float = 0
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class TeamHealth(BaseModel):
|
|
88
|
+
team_name: str = "team"
|
|
89
|
+
overall_score: float = 0.0
|
|
90
|
+
workload_balance: float = 0.0
|
|
91
|
+
burnout_risk: dict[str, float] = Field(default_factory=dict)
|
|
92
|
+
collaboration_score: float = 0.0
|
|
93
|
+
velocity_trend: str = "stable"
|
|
94
|
+
recommendations: list[str] = Field(default_factory=list)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class CodeQuality(BaseModel):
|
|
98
|
+
repo: str
|
|
99
|
+
date: str = ""
|
|
100
|
+
test_coverage: float = 0.0
|
|
101
|
+
open_bugs: int = 0
|
|
102
|
+
tech_debt_score: float = 0.0
|
|
103
|
+
lines_added: int = 0
|
|
104
|
+
lines_removed: int = 0
|
|
105
|
+
files_changed: int = 0
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class Goal(BaseModel):
|
|
109
|
+
id: Optional[int] = None
|
|
110
|
+
title: str
|
|
111
|
+
description: str = ""
|
|
112
|
+
target_value: float
|
|
113
|
+
current_value: float = 0
|
|
114
|
+
metric: str
|
|
115
|
+
deadline: Optional[str] = None
|
|
116
|
+
status: str = "active"
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class DailyReport(BaseModel):
|
|
120
|
+
date: str
|
|
121
|
+
author: str
|
|
122
|
+
commits: int = 0
|
|
123
|
+
prs_opened: int = 0
|
|
124
|
+
prs_merged: int = 0
|
|
125
|
+
issues_opened: int = 0
|
|
126
|
+
issues_closed: int = 0
|
|
127
|
+
reviews_given: int = 0
|
|
128
|
+
lines_changed: int = 0
|
|
129
|
+
summary: str = ""
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class WeeklyReport(BaseModel):
|
|
133
|
+
week_start: str
|
|
134
|
+
week_end: str
|
|
135
|
+
authors: list[str] = Field(default_factory=list)
|
|
136
|
+
total_commits: int = 0
|
|
137
|
+
total_prs: int = 0
|
|
138
|
+
total_issues_closed: int = 0
|
|
139
|
+
avg_merge_time_hours: float = 0.0
|
|
140
|
+
top_contributors: list[dict[str, int]] = Field(default_factory=list)
|
|
141
|
+
insights: list[str] = Field(default_factory=list)
|
|
142
|
+
recommendations: list[str] = Field(default_factory=list)
|