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

Peer review: draft workflow, closing, invitation expirations #667

Merged
merged 23 commits into from
Oct 19, 2023

Conversation

sgfost
Copy link
Contributor

@sgfost sgfost commented Aug 18, 2023

Major changes

  • Force the peer review process to take place on unpublished releases by either creating a new copy draft release or converting an existing draft release into an under_review release
    • (resolves comses/planning#72)
  • add closed to peer reviews so they can be marked as inactive by the submitter or editor
    • (resolves comses/planning#32)

other bugfixes/refactors:

  • fix and refactor pr dashboard filtering
    • (resolves comses/planning#172)
  • refresh expiration date when re-sending an invite
    • (resolves comses/planning#141)
  • use the 'editing' editor when logging feedback actions instead of the editor stored on the invitation
    • (resolves comses/planning#176)

sgfost added 3 commits August 23, 2023 15:59
remove draft/live flags in favor of  a status field with under_review
as a choice to indicate editable, private releases for peer reviews

* missing tests and frontend work
redirect if there is an active review for a codebase, this shouldn't be
necessary now

additionally, set the "under review" release to automatically publish
once a peer review is complete, if that codebase is marked live
(releases have been published previously), this logic is somewhat
arbitrary..
- allow a choice of converting a draft or making a new release when
  requesting from a draft
- update peer review messaging/guidance to explain the new workflow
- minor misc frontend fixes
@sgfost
Copy link
Contributor Author

sgfost commented Aug 24, 2023

slightly underestimated the amt of consideration this needed. Tests are being worked on and will need to be fairly thoroughly tested on staging as well

sgfost added 2 commits August 24, 2023 16:35
squashme

[no ci]
this led to the permissions being handled in the wrong place for certain
requests

- fix remaining test issues
@sgfost
Copy link
Contributor Author

sgfost commented Sep 1, 2023

shouldn't provide an option for creating a new release when requesting from a draft -- only convert to 'under review'

@sgfost sgfost marked this pull request as ready for review September 7, 2023 21:56
last_published_on will never differ from first_published_at on a release
unless it was unpublished and republished by admin.

I believe we want to show last modified instead which indicates the last
time anything in the release (metadata/contributors/files/etc.) was
changed
keep platform and langs always but clear release notes and output url
when we are creating a new draft

- clean up create_release() and callers
- fix false negative in request peer review test
- fix draft/live flag -> status migration to avoid updating
  last_modified when reverting
when contributor name comes from a user rather than being explicitly set
on the contributor, codebase.authors_list would ignore these

- adjust wording on 'notify reviewers' button
…ivate

alternatively we could just always publish once a model passes peer
review
@sgfost
Copy link
Contributor Author

sgfost commented Sep 20, 2023

this seems all be working correctly now, just need to decide on what to do with a release after peer review completes.

Current strategy is to automatically publish if the codebase has live == True (codebase has at least 1 other release that is published), otherwise set to unpublished which is neither a draft nor live and prevents editing files but remains private until published

@alee
Copy link
Member

alee commented Sep 20, 2023

I think the strategy of keep it unpublished if unpublished, publish if there's already a live one is a reasonable one. It might be safest though to make all steps explicit, so we keep it unpublished until they explicitly publish it (e.g., the "congratulations, peer review passed" email might have a direct link to publish the model)

@sgfost
Copy link
Contributor Author

sgfost commented Sep 21, 2023

Yeah good idea, that reminds me, I should add a link to edit the release in the email that gets sent to the submitter after changes are requested

"review_complete" release status keeps the release unpublished but does
not allowing modifying files

- added a quick link to the publish modal which is given in the email
  after a review completes and on the detail page if the release is
  publishable + editable

- added link to edit release in the revisions requested email
analogous to closing on github

serves two purposes:
1. de-cluttering the dashboard, particularly in the case of legacy
   reviews on public releases that stall when changes are requested and
   a new release has to be made (resolves comses/planning#32)
2. allowing an author/requester to close inactive reviews since we now
   only allow one active review per codebase open at one time

also includes some small refactors/bugfixes (resolves comses/planning#172)
@sgfost sgfost changed the title Peer review: draft workflow and invitation expirations Peer review: draft workflow, closing, invitation expirations Sep 29, 2023
alee added 3 commits October 16, 2023 12:48
Codebase.author_list was skipping authors even if they had an associated
User because of order of operations / precedence

refactor logic in the Contributor class to make `Contributor.has_name`
return a truthy value if there's an associated User
- use f strings instead of format for simple interpolation
- adjust peer review success email, we really will get it done by Q2
  2024... really
- remove dead imports
@@ -13,6 +13,7 @@
>
<template #body>
<div class="alert alert-danger mb-4" role="alert">
<!-- FIXME: is there a way to deduplicate this + reminders.jinja -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

easiest way would be mounting a vue component in place of the template. Feels silly doing so for static markup but may beat duplicating it

Copy link
Member

@alee alee Oct 19, 2023

Choose a reason for hiding this comment

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

I suspected that might be the only way forward since we regularly embed frontend things into the backend but not vice versa easily.. I think it's not a blocker for this PR moving forward. I'm OK with having two sets of guidance, let's make an issue out of it maybe for a student dev to take on

@alee alee force-pushed the peer-review-improvements-1 branch from bbfc9d3 to 424cea6 Compare October 19, 2023 16:51
- to remove duplication of content across ReviewModal and
  reminders.jinja could create a Vue component and mount it wherever
  reminders are needed but seems a bit much
- fix test call site, should look into refactoring the fs module(s) at
  some point + add more test coverage
@alee alee force-pushed the peer-review-improvements-1 branch from 424cea6 to 2308e91 Compare October 19, 2023 20:08
@@ -1014,17 +1085,33 @@ class CodebaseRelease(index.Indexed, ClusterableModel):
* git repository in /repository/<codebase_identifier>/
"""

class Status(models.TextChoices):
Copy link
Member

Choose a reason for hiding this comment

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

good work unifying liveness, draft, and peer review status here

@@ -90,7 +91,7 @@ export const useReleaseEditorStore = defineStore("releaseEditor", () => {
isInitialized.value = false;
await fetchCodebaseRelease(identifier, versionNumber);
await fetchMediaFiles();
if (!release.value.live) {
if (release.value.canEditOriginals) {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@alee alee merged commit c32d2e1 into comses:main Oct 19, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants