-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: change to draft only on changes requested #65
base: development
Are you sure you want to change the base?
Changes from all commits
4dcdfc0
133894e
a7757c9
506ac28
4d7cf46
714ed56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
export function formatMillisecondsToDaysAndHours(milliseconds: number): string { | ||
export function formatMillisecondsToHumanReadable(milliseconds: number): string { | ||
if (milliseconds <= 0) { | ||
return "0 days and 0 hours"; | ||
return "0 days, 0 hours, and 0 minutes"; | ||
} | ||
const days = Math.floor(milliseconds / (1000 * 60 * 60 * 24)); | ||
const hours = Math.floor((milliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | ||
if (days === 0) { | ||
return `${hours} ${hours === 1 ? "hour" : "hours"}`; | ||
} else if (hours === 0) { | ||
return `${days} ${days === 1 ? "day" : "days"}`; | ||
const minutes = Math.floor((milliseconds % (1000 * 60 * 60)) / (1000 * 60)); | ||
const components: string[] = []; | ||
|
||
if (days > 0) { | ||
components.push(`${days} ${days === 1 ? "day" : "days"}`); | ||
} | ||
|
||
if (hours > 0) { | ||
components.push(`${hours} ${hours === 1 ? "hour" : "hours"}`); | ||
} | ||
|
||
if (minutes > 0) { | ||
components.push(`${minutes} ${minutes === 1 ? "minute" : "minutes"}`); | ||
} | ||
|
||
if (components.length === 0) { | ||
return "< 1 minute"; | ||
} | ||
|
||
if (components.length === 1) { | ||
return components[0]; | ||
} else if (components.length === 2) { | ||
return `${components[0]} and ${components[1]}`; | ||
} else { | ||
return `${days} ${days === 1 ? "day" : "days"} and ${hours} ${hours === 1 ? "hour" : "hours"}`; | ||
return `${components[0]}, ${components[1]}, and ${components[2]}`; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import { PullRequest, validate } from "@octokit/graphql-schema"; | |
import { ContextPlugin } from "../types/plugin-input"; | ||
|
||
type ClosedByPullRequestsReferences = { | ||
node: Pick<PullRequest, "url" | "title" | "number" | "state" | "body" | "id"> & { author: { login: string; id: number } }; | ||
node: Pick<PullRequest, "url" | "title" | "number" | "state" | "body" | "id" | "reviewDecision"> & { author: { login: string; id: number } }; | ||
}; | ||
|
||
type IssueWithClosedByPrs = { | ||
|
@@ -34,6 +34,7 @@ const query = /* GraphQL */ ` | |
id: databaseId | ||
} | ||
} | ||
reviewDecision | ||
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. I guess this is based on the last review? 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. According to the docs it contains the last global state of the review: https://docs.github.com/en/graphql/reference/enums#pullrequestreviewdecision |
||
} | ||
} | ||
} | ||
|
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.
What happens on priority 0?
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 will be considered as
1
for deadlines, is that ok?Example with 0 prio: Meniole#7 (comment)
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.
That or infinity. Let's try 1 for now then. I'm just considering the ability to set float levels like priority 0.5 and the system acting predictably. So 0 should predictably be infinity but it's also sort of rarely used so we'll see.
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.
Even when the priority is
0
we still want the disqualifier to run right? If so I don't think infinity makes sense, it should use the same timers as a priority1
.