-
-
Notifications
You must be signed in to change notification settings - Fork 102
Implement charts for health metrics #1633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4a21f5d
81baa6a
22b36f7
1db50ba
7194a0b
34e4b8f
7aa9581
97cf9bd
65a61f6
88768dc
132ba71
76c3c72
b7a2430
79106bb
eb335ae
d905a12
edbc445
4be8514
d2dfbdc
4765aa5
a206505
b225179
0f253ef
9c34bc2
633b9a6
d6cbc7a
4850a0c
af37662
972b2bf
2e93833
b921ad1
b19b7cb
71bb30e
cca414a
49d054a
6d01dbf
441e029
4b20d03
de264f7
f5c0a13
2a32bb1
a2233b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||||||||||||||||
"""OWASP Project Health Metrics Node.""" | ||||||||||||||||||||
|
||||||||||||||||||||
from datetime import datetime | ||||||||||||||||||||
|
||||||||||||||||||||
import strawberry | ||||||||||||||||||||
import strawberry_django | ||||||||||||||||||||
|
||||||||||||||||||||
|
@@ -30,11 +32,21 @@ def age_days(self) -> int: | |||||||||||||||||||
"""Resolve project age in days.""" | ||||||||||||||||||||
return self.age_days | ||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def created_at(self) -> datetime: | ||||||||||||||||||||
"""Resolve metrics creation date.""" | ||||||||||||||||||||
return self.nest_created_at | ||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def last_commit_days(self) -> int: | ||||||||||||||||||||
"""Resolve last commit age in days.""" | ||||||||||||||||||||
return self.last_commit_days | ||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def last_commit_days_requirement(self) -> int: | ||||||||||||||||||||
"""Resolve last commit age requirement in days.""" | ||||||||||||||||||||
return self.last_commit_days_requirement | ||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def last_pull_request_days(self) -> int: | ||||||||||||||||||||
"""Resolve last pull request age in days.""" | ||||||||||||||||||||
|
@@ -45,6 +57,11 @@ def last_release_days(self) -> int: | |||||||||||||||||||
"""Resolve last release age in days.""" | ||||||||||||||||||||
return self.last_release_days | ||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def last_release_days_requirement(self) -> int: | ||||||||||||||||||||
"""Resolve last release age requirement in days.""" | ||||||||||||||||||||
return self.last_release_days_requirement | ||||||||||||||||||||
Comment on lines
+60
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical issue: Incorrect resolver implementation. This new field follows the same problematic pattern, returning the method object instead of the actual integer value. Apply this fix: - @strawberry.field
- def last_release_days_requirement(self) -> int:
- """Resolve last release age requirement in days."""
- return self.last_release_days_requirement
+ @strawberry.field(name="lastReleaseDaysRequirement")
+ def resolve_last_release_days_requirement(self) -> int:
+ """Last release age requirement in days."""
+ from typing import cast
+ return cast(ProjectHealthMetrics, self).last_release_days_requirement 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||
|
||||||||||||||||||||
@strawberry.field | ||||||||||||||||||||
def owasp_page_last_update_days(self) -> int: | ||||||||||||||||||||
"""Resolve OWASP page last update age in days.""" | ||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ a2eeef | |
ahmedxgouda | ||
algoliasearch | ||
ansa | ||
apexcharts | ||
apk | ||
arithmatex | ||
arkid15r | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical issue: Incorrect resolver implementation.
This new field follows the same problematic pattern as the existing resolvers, returning the method object instead of the actual integer value.
Apply this fix:
📝 Committable suggestion
🤖 Prompt for AI Agents