From 487c863d1bba529d091cc9b1194946d2b8fe60e9 Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Sat, 23 Sep 2023 18:08:35 +0100 Subject: [PATCH 1/2] Delete .github/ubiquibot-config.yml --- .github/ubiquibot-config.yml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .github/ubiquibot-config.yml diff --git a/.github/ubiquibot-config.yml b/.github/ubiquibot-config.yml deleted file mode 100644 index 3658a5818..000000000 --- a/.github/ubiquibot-config.yml +++ /dev/null @@ -1,6 +0,0 @@ -priceMultiplier: 1.5 -# newContributorGreeting: -# enabled: true -# header: "Thank you for contributing to UbiquiBot! Please be sure to set your wallet address before completing your first bounty so that the automatic payout upon task completion will work for you." -# helpMenu: true -# footer: "###### Also please star this repository and [@ubiquity/devpool-directory](https://github.com/ubiquity/devpool-directory/) to show your support. It helps a lot!" \ No newline at end of file From 1f8686f0fc8c17beb32fd8e6446f8009d9f96dfb Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Thu, 26 Oct 2023 01:17:43 +0100 Subject: [PATCH 2/2] feat: label fat fingerer added warning for double labels --- src/handlers/pricing/action.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/handlers/pricing/action.ts b/src/handlers/pricing/action.ts index 7e9673c6f..640b19eb6 100644 --- a/src/handlers/pricing/action.ts +++ b/src/handlers/pricing/action.ts @@ -2,6 +2,7 @@ import { getBotConfig, getBotContext, getLogger } from "../../bindings"; import { GLOBAL_STRINGS } from "../../configs"; import { addCommentToIssue, addLabelToIssue, clearAllPriceLabelsOnIssue, createLabel, getLabel, calculateWeight, getAllLabeledEvents } from "../../helpers"; import { Payload, UserType } from "../../types"; +import { ErrorDiff } from "../../utils/helpers"; import { handleLabelsAccess } from "../access"; import { getTargetPriceLabel } from "../shared"; @@ -12,6 +13,18 @@ export const pricingLabelLogic = async (): Promise => { const payload = context.payload as Payload; if (!payload.issue) return; const labels = payload.issue.labels; + + const doubleTimePrefix = labels.filter((label) => label.name.toString().startsWith("Time:")).length > 1; + const doublePriorityPrefix = labels.filter((label) => label.name.toString().startsWith("Priority:")).length > 1; + const doublePrefix = doubleTimePrefix || doublePriorityPrefix; + + if (doublePrefix) { + await addCommentToIssue( + ErrorDiff("Be careful not to add two labels of the same catergory or issue pricing will default to the lowest value."), + payload.issue.number + ); + } + const labelNames = labels.map((i) => i.name); logger.info(`Checking if the issue is a parent issue.`); if (payload.issue.body && isParentIssue(payload.issue.body)) {