-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: add archive label and active status to ReviewModel #242
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #242 +/- ##
==========================================
+ Coverage 74.06% 74.85% +0.78%
==========================================
Files 10 10
Lines 671 692 +21
Branches 82 84 +2
==========================================
+ Hits 497 518 +21
Misses 166 166
Partials 8 8 ☔ View full report in Codecov by Sentry. |
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.
@banesullivan this pr works well! let's do the following
✅ please add more detailed docstrings to overdocument our process here.
✅ please update the changelog in this pr
✅ make sure that we have full test coverage for this pr - there are a few gaps right now according to code cov output.
i'll then review again. essentially when this is good to go (it's really close!!) we can merge it and the website repo and the documentation updates to our peer review guide.
Separately (new work in a document) i think we should work together on a hackmd that documents this entire process a bit better. (this is a separate task but one i don't want to forget to do!)
@@ -69,6 +76,17 @@ class Labels(BaseModel): | |||
description: Optional[str] = None | |||
color: Optional[str] = None | |||
default: Optional[bool] = None | |||
type: Optional[LabelType] = None | |||
|
|||
@model_validator(mode="before") |
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.
It's been so long since i've dug into this code. let's flesh out the docstrings while this is still fresh.
can you please add a second "paragraph" that better describes what we are actually parsing here and why as a reminder (for me an our future selves)?
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.
I clarified the docstrings in b9868eb
src/pyosmeta/parse_issues.py
Outdated
@@ -221,6 +221,25 @@ def _postprocess_meta(self, meta: dict, body: List[str]) -> dict: | |||
|
|||
return meta | |||
|
|||
def _postprocess_labels(self, meta: dict) -> dict: | |||
""" | |||
Handle specific labels that are model properties |
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.
please be more specific with the docstrings. Essentially this package can be hard to "dig back into" so let's be specific about what this helper does since we don't have great docs for the package yet.
Let's be specific about it's purpose in the docstring
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.
I clarified the docstrings in b9868eb
src/pyosmeta/parse_issues.py
Outdated
Handle specific labels that are model properties | ||
""" | ||
|
||
def _is_archived(label: str) -> bool: |
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.
this is a super explicit name but i think for the purposes of documenting process, over-documenting via docstrings is a good idea here. so let's add numpy docstrings with very clear descriptions of intent to each of these.
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.
I added a docstring in b9868eb
# Now add an archive label | ||
label_inst = Labels( | ||
id=1196238794, | ||
node_id="MDU6TGFiZWwxMTk2MjM4Nzk0", |
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.
Codecov is noticing some test gaps - can you please ensure that we have full coverage via this pr?
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.
Full coverage achieved ✅
For pyOpenSci/pyopensci.github.io#320
This adds a new
active: bool = True
field to theReviewModel
class to track whether a package/review is archived or not. All reviews default to anactive=True
status and are only set toactive=False
if thearchived
label is applied to the original review.In tandem with these changes, I've added a new "archived" label in the software-submissions repository. You can view this label and currently archived packages here: https://github.com/pyOpenSci/software-submission/issues?q=label%3Aarchived
If that specific label is applied to a review, then each time the pyosMeta
update-reviews
routine is run, it will discover that and set theactive
status toFalse