Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Review upgrade #868

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
4 changes: 1 addition & 3 deletions src/bindings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
permitBaseUrl: process.env.PERMIT_BASE_URL || permitBaseUrl,
},
unassign: {
timeRangeForMaxIssue: process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE
? Number(process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE)
: timeRangeForMaxIssue,
timeRangeForMaxIssue: process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE ? Number(process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE) : timeRangeForMaxIssue,
timeRangeForMaxIssueEnabled: process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED
? process.env.DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED == "true"
: timeRangeForMaxIssueEnabled,
Expand Down
4 changes: 4 additions & 0 deletions src/configs/ubiquibot-config-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export const DefaultConfig: MergedConfig = {
name: "ask",
enabled: false,
},
{
name: "review",
enabled: false,
},
{
name: "allow",
enabled: false,
Expand Down
1 change: 1 addition & 0 deletions src/handlers/comment/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum IssueCommentCommands {
MULTIPLIER = "/multiplier", // set bounty multiplier (for treasury)
QUERY = "/query",
ASK = "/ask", // ask GPT a question
REVIEW = "/review", // GPT pull request review
// Access Controls

ALLOW = "/allow",
Expand Down
8 changes: 8 additions & 0 deletions src/handlers/comment/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { autoPay } from "./payout";
import { getTargetPriceLabel } from "../../shared";
import Decimal from "decimal.js";
import { ErrorDiff } from "../../../utils/helpers";
import { review } from "./review";

export * from "./assign";
export * from "./wallet";
Expand All @@ -47,6 +48,7 @@ export * from "./help";
export * from "./multiplier";
export * from "./query";
export * from "./ask";
export * from "./review";
export * from "./authorize";

export interface RewardsResponse {
Expand Down Expand Up @@ -295,6 +297,12 @@ export const userCommands = (): UserCommands[] => {
handler: ask,
callback: commandCallback,
},
{
id: IssueCommentCommands.REVIEW,
description: `Compares the pull request code diff with the linked issue's specification to perform a review of the current pull request. \n example usage: /review`,
handler: review,
callback: commandCallback,
},
{
id: IssueCommentCommands.MULTIPLIER,
description: `Set the bounty payout multiplier for a specific contributor, and provide the reason for why. \n example usage: "/wallet @user 0.5 'Multiplier reason'"`,
Expand Down
Loading
Loading