Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

banesullivan
Copy link

For pyOpenSci/pyopensci.github.io#320

This adds a new active: bool = True field to the ReviewModel class to track whether a package/review is archived or not. All reviews default to an active=True status and are only set to active=False if the archived 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 the active status to False

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.85%. Comparing base (b6179f3) to head (1266995).

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@lwasser lwasser left a 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")
Copy link
Member

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)?

Copy link
Author

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

@@ -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
Copy link
Member

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

Copy link
Author

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

Handle specific labels that are model properties
"""

def _is_archived(label: str) -> bool:
Copy link
Member

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.

Copy link
Author

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",
Copy link
Member

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full coverage achieved ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants