Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Fix ping stale reviewers on subsequent reviews #293

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
New stale reviewers implies new reviewedAbbrOid
jablko committed Jan 18, 2021
commit 75440cb218b5fbd3a12db26978f9855cb08272d1
4 changes: 1 addition & 3 deletions src/comments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { sha256 } from "./util/util";

// use `deletedWhenNotPresent` for comments that should be removed if not in the actions
export const tagsToDeleteIfNotPosted: string[] = [];
const deletedWhenNotPresent = <T>(tag: string, f: (tag: string) => T) => {
@@ -59,7 +57,7 @@ ${names.map(n => `${n}`).join(" ")}
});

export const PingStaleReviewer = (reviewedAbbrOid: string, reviewers: string[]) => ({
tag: `stale-ping-${sha256(reviewers.join("-")).substr(0, 6)}-${reviewedAbbrOid}`,
tag: `stale-ping-${reviewedAbbrOid}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you dropping the reviewers' hash too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A change in reviewers implies a change in reviewedAbbrOid, which the tag already contains, because the only way to change the stale reviewers is for a new review to become stale.

status: `@${reviewers.join(", @")} Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?`
});