-
Notifications
You must be signed in to change notification settings - Fork 78
feat: Status column #553
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
Merged
Merged
feat: Status column #553
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fb669c9
feat: add status column feature with configs to hide it
zkoppert 155da57
fix: add hide_status to the env class and fix tests
zkoppert 38ca291
feat: connect status up to actual api call
zkoppert f6ab3d4
test: fix tests and add test for hide status is true
zkoppert 354444a
docs: fix formatting
zkoppert 117b899
fix: pythonic logic
zkoppert 543e100
fix: pythonic logic
zkoppert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,8 @@ class EnvVars: | |
hide_time_to_close (bool): If true, the time to close metric is hidden in the output | ||
hide_time_to_first_response (bool): If true, the time to first response metric is hidden | ||
in the output | ||
hide_created_at (bool): If true, the created at timestamp is hidden in the output | ||
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. hide_created_at is not related to this change. I just noticed it wasn't properly documented. |
||
hide_status (bool): If true, the status column is hidden in the output | ||
ignore_users (List[str]): List of usernames to ignore when calculating metrics | ||
labels_to_measure (List[str]): List of labels to measure how much time the label is applied | ||
enable_mentor_count (bool): If set to TRUE, compute number of mentors | ||
|
@@ -73,6 +75,7 @@ def __init__( | |
hide_time_to_close: bool, | ||
hide_time_to_first_response: bool, | ||
hide_created_at: bool, | ||
hide_status: bool, | ||
ignore_user: List[str], | ||
labels_to_measure: List[str], | ||
enable_mentor_count: bool, | ||
|
@@ -102,6 +105,7 @@ def __init__( | |
self.hide_time_to_close = hide_time_to_close | ||
self.hide_time_to_first_response = hide_time_to_first_response | ||
self.hide_created_at = hide_created_at | ||
self.hide_status = hide_status | ||
self.enable_mentor_count = enable_mentor_count | ||
self.min_mentor_comments = min_mentor_comments | ||
self.max_comments_eval = max_comments_eval | ||
|
@@ -130,6 +134,7 @@ def __repr__(self): | |
f"{self.hide_time_to_close}," | ||
f"{self.hide_time_to_first_response}," | ||
f"{self.hide_created_at}," | ||
f"{self.hide_status}," | ||
f"{self.ignore_users}," | ||
f"{self.labels_to_measure}," | ||
f"{self.enable_mentor_count}," | ||
|
@@ -238,6 +243,7 @@ def get_env_vars(test: bool = False) -> EnvVars: | |
hide_time_to_close = get_bool_env_var("HIDE_TIME_TO_CLOSE", False) | ||
hide_time_to_first_response = get_bool_env_var("HIDE_TIME_TO_FIRST_RESPONSE", False) | ||
hide_created_at = get_bool_env_var("HIDE_CREATED_AT", True) | ||
hide_status = get_bool_env_var("HIDE_STATUS", True) | ||
enable_mentor_count = get_bool_env_var("ENABLE_MENTOR_COUNT", False) | ||
min_mentor_comments = os.getenv("MIN_MENTOR_COMMENTS", "10") | ||
max_comments_eval = os.getenv("MAX_COMMENTS_EVAL", "20") | ||
|
@@ -259,6 +265,7 @@ def get_env_vars(test: bool = False) -> EnvVars: | |
hide_time_to_close, | ||
hide_time_to_first_response, | ||
hide_created_at, | ||
hide_status, | ||
ignore_users_list, | ||
labels_to_measure_list, | ||
enable_mentor_count, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,8 +175,12 @@ def get_per_issue_metrics( | |
issue_with_metrics.time_to_close = measure_time_to_close( | ||
issue, None | ||
) | ||
if not env_vars.hide_status: | ||
issue_with_metrics.status = f"{issue.issue.state} as {issue.issue.state_reason}" # type: ignore | ||
elif issue.state == "open": # type: ignore | ||
num_issues_open += 1 | ||
if not env_vars.hide_status: | ||
issue_with_metrics.status = f"{issue.issue.state}" # type: ignore | ||
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. open issues don't have a |
||
if not env_vars.hide_created_at: | ||
if isinstance(issue, github3.search.IssueSearchResult): # type: ignore | ||
issue_with_metrics.created_at = issue.issue.created_at # type: ignore | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
HIDE_CREATED_AT is not related to this change. I just noticed it wasn't properly documented.