From 5f6d28dea430d669fdc1412bcd46de0dc778961a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Tue, 26 Sep 2023 04:38:48 +0900 Subject: [PATCH 1/2] refactor: bounty to task --- .github/workflows/bot.yml | 2 +- README.md | 10 +++---- src/adapters/supabase/helpers/client.ts | 8 ++--- src/bindings/config.ts | 4 +-- src/configs/ubiquibot-config-default.ts | 2 +- src/handlers/comment/handlers/assign.ts | 24 +++++++-------- src/handlers/comment/handlers/index.ts | 2 +- src/handlers/comment/handlers/multiplier.ts | 16 +++++----- src/handlers/comment/handlers/table.ts | 12 ++++---- src/handlers/payout/action.ts | 30 +++++++++---------- src/handlers/payout/post.ts | 10 +++---- src/handlers/pricing/pre.ts | 4 +-- src/handlers/shared/pricing.ts | 6 ++-- src/handlers/wildcard/analytics.ts | 16 +++++----- src/handlers/wildcard/unassign.ts | 4 +-- src/handlers/wildcard/weekly/action.ts | 4 +-- src/helpers/label.ts | 6 ++-- src/helpers/permit.ts | 10 +++---- src/types/config.ts | 6 ++-- src/utils/private.ts | 2 +- supabase/migrations/20230730153700_permit.sql | 4 +-- 21 files changed, 91 insertions(+), 91 deletions(-) diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index fa5fedab5..c2f8fefa8 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -14,7 +14,7 @@ on: - edited jobs: - calculate_bounty_job: + calculate_task_job: # ignore events invoked by bots if: >- github.event.pull_request.payload.sender.type != 'Bot' && github.repository != 'ubiquity/ubiquibot' diff --git a/README.md b/README.md index e8d09c845..4899c52ed 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ yarn start:watch - `DISQUALIFY_TIME`: (optional) Set a custom disqualify time (default: 7 days). - `OPENAI_API_HOST`: (optional) Set OpenAI host url (default: https://api.openai.com). - `OPENAI_API_KEY`: Set OpenAI key. -- `CHATGPT_USER_PROMPT_FOR_IMPORTANT_WORDS`: (optional) Set a custom user prompt for finding important words +- `CHATGPT_USER_PROMPT_FOR_IMPORTANT_WORDS`: (optional) Set a custom user prompt for finding important words (default: "I need your help to find important words (e.g. unique adjectives) from github issue below and I want to parse them easily so please separate them using #(No other contexts needed). Please separate the words by # so I can parse them easily. Please answer simply as I only need the important words. Here is the issue content.\n"). -- `CHATGPT_USER_PROMPT_FOR_MEASURE_SIMILARITY`: (optional) Set a custom user prompt for measuring similarity +- `CHATGPT_USER_PROMPT_FOR_MEASURE_SIMILARITY`: (optional) Set a custom user prompt for measuring similarity (default: 'I have two github issues and I need to measure the possibility of the 2 issues are the same content (No other contents needed and give me only the number in %).\n Give me in number format and add % after the number.\nDo not tell other things since I only need the number (e.g. 85%). Here are two issues:\n 1. "%first%"\n2. "%second%"'). - `SIMILARITY_THRESHOLD`: (optional) Set similarity threshold (default: 80). - `MEASURE_SIMILARITY_AI_TEMPERATURE`: (optional) Set ChatGPT temperature for measuring similarity (default: 0). @@ -63,12 +63,12 @@ To test the bot, you can: `price-multiplier` is a base number that will be used to calculate bounty price based on the following formula: `price = price-multiplier * time-label-weight * priority-label-weight * 100` -`time-labels` are labels for marking the time limit of the bounty: +`time-labels` are labels for marking the time limit of the task: - `name` is a human-readable name - `value` is number of seconds that corresponds to the time limit of the bounty -`priority-labels` are labels for marking the priority of the bounty: +`priority-labels` are labels for marking the priority of the task: - `name` is a human-readable name @@ -139,7 +139,7 @@ DISQUALIFY_TIME="7 days" // 7 days 6. Open `localhost:3000` and follow instructions to add the bot to one of your repositories. At this point the `.env` files auto-fill the empty fields (`PRIVATE_KEY` and `APP_ID`) if it is not previously filled. -Now you can make changes to the repository on GitHub (e.g. add a bounty) and the bot should react. +Now you can make changes to the repository on GitHub (e.g. add a task) and the bot should react. You can, for example: diff --git a/src/adapters/supabase/helpers/client.ts b/src/adapters/supabase/helpers/client.ts index da6db7d0b..a295979ea 100644 --- a/src/adapters/supabase/helpers/client.ts +++ b/src/adapters/supabase/helpers/client.ts @@ -473,10 +473,10 @@ const getDbDataFromPermit = (permit: InsertPermit): Record => { repository_id: permit.repositoryId, issue_id: permit.issueId, network_id: permit.evmNetworkId, - bounty_hunter_id: permit.bountyHunterId, + task_hunter_id: permit.taskHunterId, token_address: permit.tokenAddress, payout_amount: permit.payoutAmount, - bounty_hunter_address: permit.bountyHunterAddress, + task_hunter_address: permit.taskHunterAddress, nonce: permit.nonce, deadline: permit.deadline, signature: permit.signature, @@ -492,10 +492,10 @@ const getPermitFromDbData = (data: Record): Permit => { repositoryId: data.repository_i, issueId: data.issue_id, evmNetworkId: data.network_id, - bountyHunterId: data.bounty_hunter_id, + taskHunterId: data.task_hunter_id, tokenAddress: data.token_address, payoutAmount: data.payout_amount, - bountyHunterAddress: data.bounty_hunter_address, + taskHunterAddress: data.task_hunter_address, nonce: data.nonce, deadline: data.deadline, signature: data.signature, diff --git a/src/bindings/config.ts b/src/bindings/config.ts index 5034252b7..65bf11a8a 100644 --- a/src/bindings/config.ts +++ b/src/bindings/config.ts @@ -32,7 +32,7 @@ export const loadConfig = async (context: Context): Promise => { commandSettings, assistivePricing, registerWalletWithVerification, - staleBountyTime, + staleTaskTime, publicAccessControl, openAIKey, openAITokenLimit, @@ -93,7 +93,7 @@ export const loadConfig = async (context: Context): Promise => { command: commandSettings, assign: { maxConcurrentTasks: maxConcurrentTasks, - staleBountyTime: ms(staleBountyTime), + staleTaskTime: ms(staleTaskTime), }, sodium: { privateKey: process.env.X25519_PRIVATE_KEY ?? "", diff --git a/src/configs/ubiquibot-config-default.ts b/src/configs/ubiquibot-config-default.ts index ab0e9b3fe..75f97eb59 100644 --- a/src/configs/ubiquibot-config-default.ts +++ b/src/configs/ubiquibot-config-default.ts @@ -97,7 +97,7 @@ export const DefaultConfig: MergedConfig = { setLabel: true, fundExternalClosedIssue: true, }, - staleBountyTime: "0d", + staleTaskTime: "0d", newContributorGreeting: { enabled: false, header: diff --git a/src/handlers/comment/handlers/assign.ts b/src/handlers/comment/handlers/assign.ts index 5fda242f0..a7a4c6fa0 100644 --- a/src/handlers/comment/handlers/assign.ts +++ b/src/handlers/comment/handlers/assign.ts @@ -4,7 +4,7 @@ import { Payload, LabelItem, Comment, IssueType, Issue } from "../../../types"; import { deadLinePrefix } from "../../shared"; import { getWalletAddress, getWalletMultiplier } from "../../../adapters/supabase"; import { tableComment } from "./table"; -import { bountyInfo } from "../../wildcard"; +import { taskInfo } from "../../wildcard"; import { ASSIGN_COMMAND_ENABLED, GLOBAL_STRINGS } from "../../../configs"; import { isParentIssue } from "../../pricing"; @@ -18,7 +18,7 @@ export const assign = async (body: string) => { const id = organization?.id || repository?.id; // repository?.id as fallback - const staleBounty = config.assign.staleBountyTime; + const staleBounty = config.assign.staleTaskTime; logger.info(`Received '/start' command from user: ${payload.sender.login}, body: ${body}`); const issue = (_payload as Payload).issue; @@ -103,7 +103,7 @@ export const assign = async (body: string) => {
  • Use /wallet 0x0000...0000 if you want to update your registered payment wallet address @${payload.sender.login}.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • -
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the bounty.
  • +
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the task.
    • `, }; @@ -114,12 +114,12 @@ export const assign = async (body: string) => { let days: number | undefined; let staleToDays: number | undefined; - let isBountyStale = false; + let isTaskStale = false; if (staleBounty !== 0) { days = Math.floor((new Date().getTime() - new Date(issue.created_at).getTime()) / (1000 * 60 * 60 * 24)); staleToDays = Math.floor(staleBounty / (1000 * 60 * 60 * 24)); - isBountyStale = days >= staleToDays; + isTaskStale = days >= staleToDays; } // double check whether the assign message has been already posted or not @@ -128,8 +128,8 @@ export const assign = async (body: string) => { const comments = issueComments.sort((a: Comment, b: Comment) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()); const latestComment = comments.length > 0 ? comments[0].body : undefined; if (latestComment && comment.commit != latestComment) { - const { multiplier, reason, bounty } = await getMultiplierInfoToDisplay(payload.sender.login, id?.toString(), issue); - return tableComment({ ...comment, multiplier, reason, bounty, isBountyStale, days }) + comment.tips; + const { multiplier, reason, task } = await getMultiplierInfoToDisplay(payload.sender.login, id?.toString(), issue); + return tableComment({ ...comment, multiplier, reason, task, isTaskStale, days }) + comment.tips; } return; }; @@ -139,7 +139,7 @@ const getMultiplierInfoToDisplay = async (senderLogin: string, org_id: string, i const multiplier = value?.toFixed(2) || "1.00"; - let _multiplierToDisplay, _reasonToDisplay, _bountyToDisplay; + let _multiplierToDisplay, _reasonToDisplay, _taskToDisplay; if (value == 1) { if (reason) { @@ -152,11 +152,11 @@ const getMultiplierInfoToDisplay = async (senderLogin: string, org_id: string, i } else { _multiplierToDisplay = multiplier; _reasonToDisplay = reason; - _bountyToDisplay = `Permit generation disabled because price label is not set.`; - const issueDetailed = bountyInfo(issue); + _taskToDisplay = `Permit generation disabled because price label is not set.`; + const issueDetailed = taskInfo(issue); if (issueDetailed.priceLabel) { - _bountyToDisplay = (+issueDetailed.priceLabel.substring(7, issueDetailed.priceLabel.length - 4) * value).toString() + " USD"; + _taskToDisplay = (+issueDetailed.priceLabel.substring(7, issueDetailed.priceLabel.length - 4) * value).toString() + " USD"; } } - return { multiplier: _multiplierToDisplay, reason: _reasonToDisplay, bounty: _bountyToDisplay }; + return { multiplier: _multiplierToDisplay, reason: _reasonToDisplay, task: _taskToDisplay }; }; diff --git a/src/handlers/comment/handlers/index.ts b/src/handlers/comment/handlers/index.ts index 6d91e20d9..9b603aebd 100644 --- a/src/handlers/comment/handlers/index.ts +++ b/src/handlers/comment/handlers/index.ts @@ -222,7 +222,7 @@ export const issueReopenedCallback = async (): Promise => { } await addCommentToIssue( - `@${assignee} please be sure to review this conversation and implement any necessary fixes. Unless this is closed as completed, its payment of **${formattedAmount} ${tokenSymbol}** will be deducted from your next bounty.`, + `@${assignee} please be sure to review this conversation and implement any necessary fixes. Unless this is closed as completed, its payment of **${formattedAmount} ${tokenSymbol}** will be deducted from your next task.`, issue.number ); } else { diff --git a/src/handlers/comment/handlers/multiplier.ts b/src/handlers/comment/handlers/multiplier.ts index a7cc674eb..d09a984b5 100644 --- a/src/handlers/comment/handlers/multiplier.ts +++ b/src/handlers/comment/handlers/multiplier.ts @@ -39,13 +39,13 @@ export const multiplier = async (body: string) => { matches?.shift(); if (matches) { - let bountyMultiplier = 1; + let taskMultiplier = 1; let username = ""; let reason = ""; for (const part of matches) { if (!isNaN(parseFloat(part))) { - bountyMultiplier = parseFloat(part); + taskMultiplier = parseFloat(part); } else if (part.startsWith("@")) { username = part.substring(1); } else { @@ -68,20 +68,20 @@ export const multiplier = async (body: string) => { return "Insufficient permissions to update the payout multiplier. You are not an `admin` or `billing_manager`"; } } - logger.info(`Upserting to the wallet table, username: ${username}, bountyMultiplier: ${bountyMultiplier}, reason: ${reason}}`); + logger.info(`Upserting to the wallet table, username: ${username}, taskMultiplier: ${taskMultiplier}, reason: ${reason}}`); - await upsertWalletMultiplier(username, bountyMultiplier?.toString(), reason, id?.toString()); - if (bountyMultiplier > 1) { - return `Successfully changed the payout multiplier for @${username} to ${bountyMultiplier}. The reason ${ + await upsertWalletMultiplier(username, taskMultiplier?.toString(), reason, id?.toString()); + if (taskMultiplier > 1) { + return `Successfully changed the payout multiplier for @${username} to ${taskMultiplier}. The reason ${ reason ? `provided is "${reason}"` : "is not provided" }. This feature is designed to limit the contributor's compensation for any bounty on the current repository due to other compensation structures (i.e. salary.) are you sure you want to use a bounty multiplier above 1?`; } else { - return `Successfully changed the payout multiplier for @${username} to ${bountyMultiplier}. The reason ${ + return `Successfully changed the payout multiplier for @${username} to ${taskMultiplier}. The reason ${ reason ? `provided is "${reason}"` : "is not provided" }.`; } } else { - logger.error("Invalid body for bountyMultiplier command"); + logger.error("Invalid body for taskMultiplier command"); return `Invalid syntax for wallet command \n example usage: "/multiplier @user 0.5 'Multiplier reason'"`; } }; diff --git a/src/handlers/comment/handlers/table.ts b/src/handlers/comment/handlers/table.ts index 97f154e0b..19dd04f8d 100644 --- a/src/handlers/comment/handlers/table.ts +++ b/src/handlers/comment/handlers/table.ts @@ -3,23 +3,23 @@ export const tableComment = ({ wallet, multiplier, reason, - bounty, - isBountyStale, + task, + isTaskStale, days, }: { deadline: string; wallet: string; multiplier?: string; reason?: string; - bounty?: string; - isBountyStale?: boolean; + task?: string; + isTaskStale?: boolean; days?: number; }) => { return ` ${ - isBountyStale + isTaskStale ? `` : `` } @@ -33,6 +33,6 @@ ${ ${multiplier ? `` : ``} ${reason ? `` : ``} -${bounty ? `` : ``} +${task ? `` : ``}
      Warning! This task was created over ${days} days ago. Please confirm that this issue specification is accurate before starting.
      Payment Multiplier${multiplier}
      Multiplier Reason${reason}
      Total Bounty${bounty}
      Total Task${task}
      `; }; diff --git a/src/handlers/payout/action.ts b/src/handlers/payout/action.ts index 553ad0151..327368e29 100644 --- a/src/handlers/payout/action.ts +++ b/src/handlers/payout/action.ts @@ -16,7 +16,7 @@ import { } from "../../helpers"; import { UserType, Payload, StateReason, Comment, User, Incentives, Issue } from "../../types"; import { shortenEthAddress } from "../../utils"; -import { bountyInfo } from "../wildcard"; +import { taskInfo } from "../wildcard"; import Decimal from "decimal.js"; import { GLOBAL_STRINGS } from "../../configs"; import { isParentIssue } from "../pricing"; @@ -38,7 +38,7 @@ export interface IncentivesCalculationResult { payload: Payload; comments: Comment[]; issueDetailed: { - isBounty: boolean; + isTask: boolean; timelabel: string; priorityLabel: string; priceLabel: string; @@ -183,15 +183,15 @@ export const incentivesCalculation = async (): Promise => { const aiLabels: string[] = []; for (const timeLabel of config.price.timeLabels) { for (const priorityLabel of config.price.priorityLabels) { - const targetPrice = calculateBountyPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), config.price.baseMultiplier); + const targetPrice = calculateTaskPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), config.price.baseMultiplier); const targetPriceLabel = `Price: ${targetPrice} USD`; aiLabels.push(targetPriceLabel); } diff --git a/src/handlers/shared/pricing.ts b/src/handlers/shared/pricing.ts index 0a543bc7c..f5cbd9c60 100644 --- a/src/handlers/shared/pricing.ts +++ b/src/handlers/shared/pricing.ts @@ -1,7 +1,7 @@ import { getBotConfig } from "../../bindings"; import { calculateWeight } from "../../helpers"; -export const calculateBountyPrice = (timeValue: number, priorityValue: number, baseValue?: number): number => { +export const calculateTaskPrice = (timeValue: number, priorityValue: number, baseValue?: number): number => { const botConfig = getBotConfig(); const base = baseValue ?? botConfig.price.baseMultiplier; const priority = priorityValue / 10; // floats cause bad math @@ -16,8 +16,8 @@ export const getTargetPriceLabel = (timeLabel: string | undefined, priorityLabel const timeWeight = calculateWeight(botConfig.price.timeLabels.find((item) => item.name === timeLabel)); const priorityWeight = calculateWeight(botConfig.price.priorityLabels.find((item) => item.name === priorityLabel)); if (timeWeight && priorityWeight) { - const bountyPrice = calculateBountyPrice(timeWeight, priorityWeight); - targetPriceLabel = `Price: ${bountyPrice} USD`; + const taskPrice = calculateTaskPrice(timeWeight, priorityWeight); + targetPriceLabel = `Price: ${taskPrice} USD`; } } return targetPriceLabel; diff --git a/src/handlers/wildcard/analytics.ts b/src/handlers/wildcard/analytics.ts index 62f24edf9..e69003b4a 100644 --- a/src/handlers/wildcard/analytics.ts +++ b/src/handlers/wildcard/analytics.ts @@ -9,10 +9,10 @@ import { getTargetPriceLabel } from "../shared"; * @param issue - The issue object * @returns If bounty - true, If issue - false */ -export const bountyInfo = ( +export const taskInfo = ( issue: Issue ): { - isBounty: boolean; + isTask: boolean; timelabel: string | undefined; priorityLabel: string | undefined; priceLabel: string | undefined; @@ -22,7 +22,7 @@ export const bountyInfo = ( const timeLabels = config.price.timeLabels.filter((item) => labels.map((i) => i.name).includes(item.name)); const priorityLabels = config.price.priorityLabels.filter((item) => labels.map((i) => i.name).includes(item.name)); - const isBounty = timeLabels.length > 0 && priorityLabels.length > 0; + const isTask = timeLabels.length > 0 && priorityLabels.length > 0; const minTimeLabel = timeLabels.length > 0 ? timeLabels.reduce((a, b) => (calculateWeight(a) < calculateWeight(b) ? a : b)).name : undefined; const minPriorityLabel = priorityLabels.length > 0 ? priorityLabels.reduce((a, b) => (calculateWeight(a) < calculateWeight(b) ? a : b)).name : undefined; @@ -30,7 +30,7 @@ export const bountyInfo = ( const priceLabel = getTargetPriceLabel(minTimeLabel, minPriorityLabel); return { - isBounty, + isTask, timelabel: minTimeLabel, priorityLabel: minPriorityLabel, priceLabel, @@ -61,10 +61,10 @@ export const collectAnalytics = async (): Promise => { // need to skip checking the closed issues already stored in the db and filter them by doing a sanitation checks. // sanitation checks would be basically checking labels of the issue // whether the issue has both `priority` label and `timeline` label - const bounties = issues.filter((issue) => bountyInfo(issue as Issue).isBounty); + const bounties = issues.filter((issue) => taskInfo(issue as Issue).isTask); // collect assignees from both type of issues (opened/closed) - const assignees = bounties.filter((bounty) => bounty.assignee).map((bounty) => bounty.assignee as User); + const assignees = bounties.filter((task) => task.assignee).map((task) => task.assignee as User); // remove duplication by assignee const tmp = assignees.map((i) => i.login); @@ -86,11 +86,11 @@ export const collectAnalytics = async (): Promise => { await Promise.all(userProfilesToUpsert.map((i) => upsertUser(i))); // No need to update the record for the bounties already closed - const bountiesToUpsert = bounties.filter((bounty) => (bounty.state === IssueType.CLOSED ? bounty.number > maximumIssueNumber : true)); + const bountiesToUpsert = bounties.filter((task) => (task.state === IssueType.CLOSED ? task.number > maximumIssueNumber : true)); logger.info(`Upserting bounties: ${bountiesToUpsert.map((i) => i.title).toString()}`); await Promise.all( bountiesToUpsert.map((i) => { - const additions = bountyInfo(i as Issue); + const additions = taskInfo(i as Issue); if (additions.timelabel && additions.priorityLabel && additions.priceLabel) return upsertIssue(i as Issue, { labels: { diff --git a/src/handlers/wildcard/unassign.ts b/src/handlers/wildcard/unassign.ts index ec057ce73..23bd6c1d1 100644 --- a/src/handlers/wildcard/unassign.ts +++ b/src/handlers/wildcard/unassign.ts @@ -27,11 +27,11 @@ export const checkBountiesToUnassign = async () => { const assigned_issues = issues_opened.filter((issue) => issue.assignee); // Checking the bounties in parallel - const res = await Promise.all(assigned_issues.map(async (issue) => checkBountyToUnassign(issue as Issue))); + const res = await Promise.all(assigned_issues.map(async (issue) => checkTaskToUnassign(issue as Issue))); logger.info(`Checking expired bounties done! total: ${res.length}, unassigned: ${res.filter((i) => i).length}`); }; -const checkBountyToUnassign = async (issue: Issue): Promise => { +const checkTaskToUnassign = async (issue: Issue): Promise => { const context = getBotContext(); const payload = context.payload as Payload; const logger = getLogger(); diff --git a/src/handlers/wildcard/weekly/action.ts b/src/handlers/wildcard/weekly/action.ts index 09e06e878..058865cd4 100644 --- a/src/handlers/wildcard/weekly/action.ts +++ b/src/handlers/wildcard/weekly/action.ts @@ -104,13 +104,13 @@ const processEvents = (JSONList: any[]): SummaryType => { closedIssues++; elem.payload.issue?.labels.forEach((elem: any) => { if (elem.name.includes("Price")) { - const bountyUSD = parseInt( + const taskUSD = parseInt( elem.name .toString() .match(/\b\d+\b/) .join("") ); - bountiesUSD += bountyUSD; + bountiesUSD += taskUSD; } }); break; diff --git a/src/helpers/label.ts b/src/helpers/label.ts index a02d6c5eb..c9bba061f 100644 --- a/src/helpers/label.ts +++ b/src/helpers/label.ts @@ -1,7 +1,7 @@ import { Context } from "probot"; import { getBotConfig, getBotContext, getLogger } from "../bindings"; import { COLORS } from "../configs"; -import { calculateBountyPrice } from "../handlers"; +import { calculateTaskPrice } from "../handlers"; import { Label, Payload } from "../types"; import { deleteLabel } from "./issue"; import { calculateWeight } from "../helpers"; @@ -68,11 +68,11 @@ export const updateLabelsFromBaseRate = async (owner: string, repo: string, cont for (const timeLabel of config.price.timeLabels) { for (const priorityLabel of config.price.priorityLabels) { - const targetPrice = calculateBountyPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), config.price.baseMultiplier); + const targetPrice = calculateTaskPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), config.price.baseMultiplier); const targetPriceLabel = `Price: ${targetPrice} USD`; newLabels.push(targetPriceLabel); - const previousTargetPrice = calculateBountyPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), previousBaseRate); + const previousTargetPrice = calculateTaskPrice(calculateWeight(timeLabel), calculateWeight(priorityLabel), previousBaseRate); const previousTargetPriceLabel = `Price: ${previousTargetPrice} USD`; previousLabels.push(previousTargetPriceLabel); } diff --git a/src/helpers/permit.ts b/src/helpers/permit.ts index 0a6a9ac1a..86818c5d1 100644 --- a/src/helpers/permit.ts +++ b/src/helpers/permit.ts @@ -15,8 +15,8 @@ export type Permit = { repositoryId: number; issueId: number; evmNetworkId: number; - bountyHunterId: number; - bountyHunterAddress: string; + taskHunterId: number; + taskHunterAddress: string; tokenAddress: string; payoutAmount: string; nonce: string; @@ -106,7 +106,7 @@ export const generatePermit2Signature = async ( return { txData, payoutUrl }; }; -export const savePermitToDB = async (bountyHunterId: number, txData: TxData): Promise => { +export const savePermitToDB = async (taskHunterId: number, txData: TxData): Promise => { const logger = getLogger(); const context = getBotContext(); @@ -127,10 +127,10 @@ export const savePermitToDB = async (bountyHunterId: number, txData: TxData): Pr repositoryId: repository?.id, issueId: issue?.id, evmNetworkId: evmNetworkId, - bountyHunterId: bountyHunterId, + taskHunterId: taskHunterId, tokenAddress: txData.permit.permitted.token, payoutAmount: txData.permit.permitted.amount, - bountyHunterAddress: txData.transferDetails.to, + taskHunterAddress: txData.transferDetails.to, nonce: txData.permit.nonce, deadline: txData.permit.deadline, signature: txData.signature, diff --git a/src/types/config.ts b/src/types/config.ts index 59bb42e11..e143c80eb 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -87,7 +87,7 @@ export const ModeSchema = Type.Object({ export const AssignSchema = Type.Object({ maxConcurrentTasks: Type.Number(), - staleBountyTime: Type.Number(), + staleTaskTime: Type.Number(), }); export const LogConfigSchema = Type.Object({ @@ -190,7 +190,7 @@ export const ConfigSchema = Type.Object( enableAccessControl: Type.Optional(PublicAccessControlSchema), openAIKey: Type.Optional(Type.String()), openAITokenLimit: Type.Optional(Type.Number()), - staleBountyTime: Type.Optional(Type.String()), + staleTaskTime: Type.Optional(Type.String()), privateKeyEncrypted: Type.Optional(Type.String()), newContributorGreeting: Type.Optional(NewContributorGreetingSchema), }, @@ -223,7 +223,7 @@ export const MergedConfigSchema = Type.Object({ publicAccessControl: PublicAccessControlSchema, openAIKey: Type.Optional(Type.String()), openAITokenLimit: Type.Optional(Type.Number()), - staleBountyTime: Type.String(), + staleTaskTime: Type.String(), newContributorGreeting: NewContributorGreetingSchema, }); diff --git a/src/utils/private.ts b/src/utils/private.ts index 29b2b10fd..9c856168e 100644 --- a/src/utils/private.ts +++ b/src/utils/private.ts @@ -160,7 +160,7 @@ export const getConfig = async (context: Context) => { publicAccessControl: mergedConfigData.publicAccessControl, openAIKey: mergedConfigData.openAIKey, openAITokenLimit: mergedConfigData.openAITokenLimit, - staleBountyTime: mergedConfigData.staleBountyTime, + staleTaskTime: mergedConfigData.staleTaskTime, newContributorGreeting: mergedConfigData.newContributorGreeting, }; diff --git a/supabase/migrations/20230730153700_permit.sql b/supabase/migrations/20230730153700_permit.sql index 8fbfb87ed..03c5e2edd 100644 --- a/supabase/migrations/20230730153700_permit.sql +++ b/supabase/migrations/20230730153700_permit.sql @@ -6,8 +6,8 @@ CREATE TABLE IF NOT EXISTS permits ( repository_id bigint NOT NULL, issue_id bigint NOT NULL, network_id int NOT NULL, - bounty_hunter_id bigint NOT NULL, - bounty_hunter_address text NOT NULL, + task_hunter_id bigint NOT NULL, + task_hunter_address text NOT NULL, token_address text NOT NULL, payout_amount text NOT NULL, nonce text NOT NULL, From 840620d4548f3420851d3ba29b07cf3c27c1b9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= Date: Tue, 26 Sep 2023 04:46:50 +0900 Subject: [PATCH 2/2] refactor: bounties to tasks --- .../{bounty-template.yml => task-template.yml} | 12 ++++++------ .github/ubiquibot-config.yml | 2 +- .github/workflows/bot.yml | 4 ++-- README.md | 18 +++++++++--------- src/configs/strings.ts | 2 +- src/configs/ubiquibot-config-default.ts | 2 +- src/handlers/comment/commands.ts | 2 +- src/handlers/comment/handlers/assign.ts | 8 ++++---- src/handlers/comment/handlers/index.ts | 2 +- src/handlers/comment/handlers/multiplier.ts | 2 +- src/handlers/comment/handlers/unassign.ts | 2 +- src/handlers/payout/action.ts | 12 ++++++------ src/handlers/processors.ts | 4 ++-- src/handlers/shared/index.ts | 2 +- src/handlers/wildcard/analytics.ts | 16 ++++++++-------- src/handlers/wildcard/unassign.ts | 14 +++++++------- src/handlers/wildcard/weekly/action.ts | 6 +++--- supabase/README.md | 2 +- 18 files changed, 56 insertions(+), 56 deletions(-) rename .github/ISSUE_TEMPLATE/{bounty-template.yml => task-template.yml} (91%) diff --git a/.github/ISSUE_TEMPLATE/bounty-template.yml b/.github/ISSUE_TEMPLATE/task-template.yml similarity index 91% rename from .github/ISSUE_TEMPLATE/bounty-template.yml rename to .github/ISSUE_TEMPLATE/task-template.yml index 7e81ebf0c..35eb1a763 100644 --- a/.github/ISSUE_TEMPLATE/bounty-template.yml +++ b/.github/ISSUE_TEMPLATE/task-template.yml @@ -1,14 +1,14 @@ -name: "Bounty Proposal" +name: "Task Proposal" description: Have a suggestion for how to improve UbiquiBot? Let us know! -title: "Bounty Proposal: " +title: "Task Proposal: " body: - type: markdown attributes: value: | ## Feature Request Form - Thank you for taking the time to file a feature request. - If you register your wallet address, you will be eligible for compensation if this is accepted! + Thank you for taking the time to file a feature request. + If you register your wallet address, you will be eligible for compensation if this is accepted! Please let us know how we can improve the bot. - type: textarea @@ -17,14 +17,14 @@ body: description: Please let us know what inspired you to write this proposal. Backlinking to specific comments on GitHub, and leaving a remark about how the bot should have interacted with it is usually sufficient context. validations: required: false - + - type: textarea attributes: label: Describe the solution description: A clear description of what you want to happen. Add any considered drawbacks. validations: required: true - + - type: textarea attributes: label: Remarks diff --git a/.github/ubiquibot-config.yml b/.github/ubiquibot-config.yml index 3658a5818..0682d9102 100644 --- a/.github/ubiquibot-config.yml +++ b/.github/ubiquibot-config.yml @@ -1,6 +1,6 @@ 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." +# header: "Thank you for contributing to UbiquiBot! Please be sure to set your wallet address before completing your first task 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 diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml index c2f8fefa8..03eaeaa41 100644 --- a/.github/workflows/bot.yml +++ b/.github/workflows/bot.yml @@ -1,4 +1,4 @@ -name: Calculate Bounty Based on Events +name: Calculate Task Price Based on Events on: push: issues: @@ -19,7 +19,7 @@ jobs: if: >- github.event.pull_request.payload.sender.type != 'Bot' && github.repository != 'ubiquity/ubiquibot' runs-on: ubuntu-latest - name: Calculate Bounty with UbiquiBot + name: Calculate Task Price with UbiquiBot steps: # To use this repository's private action, # you must check out the repository diff --git a/README.md b/README.md index 4899c52ed..d2766dfd5 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Instead, it is recommended to make a copy of the `.env.example` file and replace 1. Go to the [UbiquiBot App Marketplace](https://github.com/marketplace/ubiquibot) 2. Choose a plan and install UbiquiBot on your repository -3. Congratulations! You can now use the UbiquiBot to manage your bounties. +3. Congratulations! You can now use the UbiquiBot to manage your tasks. To test the bot, you can: @@ -61,12 +61,12 @@ To test the bot, you can: `evm-network-id` is ID of the EVM-compatible network that will be used for payouts. -`price-multiplier` is a base number that will be used to calculate bounty price based on the following formula: `price = price-multiplier * time-label-weight * priority-label-weight * 100` +`price-multiplier` is a base number that will be used to calculate task price based on the following formula: `price = price-multiplier * time-label-weight * priority-label-weight * 100` `time-labels` are labels for marking the time limit of the task: - `name` is a human-readable name -- `value` is number of seconds that corresponds to the time limit of the bounty +- `value` is number of seconds that corresponds to the time limit of the task `priority-labels` are labels for marking the priority of the task: @@ -83,7 +83,7 @@ To test the bot, you can: `disable-analytics` can be `true` or `false` that disables or enables weekly analytics collection by Ubiquity. -`payment-permit-max-price` sets the max amount for automatic payout of bounties when the issue is closed. +`payment-permit-max-price` sets the max amount for automatic payout of tasks when the issue is closed. `comment-incentives` can be `true` or `false` that enable or disable comment incentives. These are payments generated for comments in the issue by contributors, excluding the assignee. @@ -98,7 +98,7 @@ To test the bot, you can: - `totals`: - `word` defines reward for each word in the comment -`max-concurrent-assigns` is the maximum number of bounties that can be assigned to a bounty hunter at once. This excludes bounties with delayed or approved pull request reviews. +`max-concurrent-assigns` is the maximum number of tasks that can be assigned to an assignee at once. This excludes tasks with delayed or approved pull request reviews. `register-wallet-with-verification` can be `true` or `false`. If enabled, it requires a signed message to set wallet address. This prevents users from setting wallet address from centralized exchanges, which would make payments impossible to claim. @@ -150,13 +150,13 @@ You can, for example: ## How it works -Bounty bot is built using the [probot](https://probot.github.io/) framework so initially the bot is a github app. But thanks to the [probot/adapter-github-actions](https://github.com/probot/adapter-github-actions) you can also use the bot as a github action. +Task bot is built using the [probot](https://probot.github.io/) framework so initially the bot is a github app. But thanks to the [probot/adapter-github-actions](https://github.com/probot/adapter-github-actions) you can also use the bot as a github action. -You can use the bounty bot as a [github app](https://github.com/marketplace/ubiquibot). +You can use the task bot as a [github app](https://github.com/marketplace/ubiquibot). When using as a github app the flow is the following: -1. Bounty bot is added to a repository as a github app +1. Task bot is added to a repository as a github app 2. You run the bot "backend" (for example on your local machine) 3. Some event happens in a repository and the bot should react somehow (for example: on adding a time label to an issue the bot should add a price label) 4. Event details are sent to your deployed bot instance (to a webhook URL that was set in github app's settings) @@ -197,7 +197,7 @@ Make sure you have your local instance of ubiquibot running. ## Architecture Overview -Bounty bot is built using the [probot](https://probot.github.io/) framework so initially the bot is a github app +Task bot is built using the [probot](https://probot.github.io/) framework so initially the bot is a github app
       <root>
      diff --git a/src/configs/strings.ts b/src/configs/strings.ts
      index 3f3128920..fe3543631 100644
      --- a/src/configs/strings.ts
      +++ b/src/configs/strings.ts
      @@ -1,5 +1,5 @@
       export const GLOBAL_STRINGS = {
      -  unassignComment: "Releasing the bounty back to dev pool because the allocated duration already ended!",
      +  unassignComment: "Releasing the task due to lack of updates.",
         askUpdate: "Do you have any updates",
         assignCommandDisabledComment: "The `/assign` command is disabled for this repository.",
         skipPriceLabelGenerationComment: "Pricing is disabled on parent issues.",
      diff --git a/src/configs/ubiquibot-config-default.ts b/src/configs/ubiquibot-config-default.ts
      index 75f97eb59..b2306faff 100644
      --- a/src/configs/ubiquibot-config-default.ts
      +++ b/src/configs/ubiquibot-config-default.ts
      @@ -101,7 +101,7 @@ export const DefaultConfig: MergedConfig = {
         newContributorGreeting: {
           enabled: false,
           header:
      -      "Thank you for contributing! 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.",
      +      "Thank you for contributing! Please be sure to set your wallet address before completing your first task 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!",
      diff --git a/src/handlers/comment/commands.ts b/src/handlers/comment/commands.ts
      index d009972d8..bed9a17f5 100644
      --- a/src/handlers/comment/commands.ts
      +++ b/src/handlers/comment/commands.ts
      @@ -4,7 +4,7 @@ export enum IssueCommentCommands {
         STOP = "/stop", // unassign to default
         WALLET = "/wallet", // register wallet address
         PAYOUT = "/payout", // request permit payout
      -  MULTIPLIER = "/multiplier", // set bounty multiplier (for treasury)
      +  MULTIPLIER = "/multiplier", // set task multiplier (for contributor)
         QUERY = "/query",
         ASK = "/ask", // ask GPT a question
         // Access Controls
      diff --git a/src/handlers/comment/handlers/assign.ts b/src/handlers/comment/handlers/assign.ts
      index a7a4c6fa0..652e5406f 100644
      --- a/src/handlers/comment/handlers/assign.ts
      +++ b/src/handlers/comment/handlers/assign.ts
      @@ -18,7 +18,7 @@ export const assign = async (body: string) => {
       
         const id = organization?.id || repository?.id; // repository?.id as fallback
       
      -  const staleBounty = config.assign.staleTaskTime;
      +  const staleTask = config.assign.staleTaskTime;
       
         logger.info(`Received '/start' command from user: ${payload.sender.login}, body: ${body}`);
         const issue = (_payload as Payload).issue;
      @@ -116,9 +116,9 @@ export const assign = async (body: string) => {
         let staleToDays: number | undefined;
         let isTaskStale = false;
       
      -  if (staleBounty !== 0) {
      +  if (staleTask !== 0) {
           days = Math.floor((new Date().getTime() - new Date(issue.created_at).getTime()) / (1000 * 60 * 60 * 24));
      -    staleToDays = Math.floor(staleBounty / (1000 * 60 * 60 * 24));
      +    staleToDays = Math.floor(staleTask / (1000 * 60 * 60 * 24));
           isTaskStale = days >= staleToDays;
         }
       
      @@ -146,7 +146,7 @@ const getMultiplierInfoToDisplay = async (senderLogin: string, org_id: string, i
             _multiplierToDisplay = multiplier;
             _reasonToDisplay = reason;
           } else {
      -      // default mode: normal bounty hunter with default multiplier 1 and no reason
      +      // default mode: normal contributor with default multiplier 1 and no reason
             // nothing to show about multiplier
           }
         } else {
      diff --git a/src/handlers/comment/handlers/index.ts b/src/handlers/comment/handlers/index.ts
      index 9b603aebd..bb2147a01 100644
      --- a/src/handlers/comment/handlers/index.ts
      +++ b/src/handlers/comment/handlers/index.ts
      @@ -292,7 +292,7 @@ export const userCommands = (): UserCommands[] => {
           },
           {
             id: IssueCommentCommands.MULTIPLIER,
      -      description: `Set the bounty payout multiplier for a specific contributor, and provide a reason for why.\n\te.g. '/wallet @user 0.5 "Multiplier reason"'`,
      +      description: `Set the task payout multiplier for a specific contributor, and provide a reason for why.\n\te.g. '/wallet @user 0.5 "Multiplier reason"'`,
             handler: multiplier,
             callback: commandCallback,
           },
      diff --git a/src/handlers/comment/handlers/multiplier.ts b/src/handlers/comment/handlers/multiplier.ts
      index d09a984b5..cc28ee83b 100644
      --- a/src/handlers/comment/handlers/multiplier.ts
      +++ b/src/handlers/comment/handlers/multiplier.ts
      @@ -74,7 +74,7 @@ export const multiplier = async (body: string) => {
           if (taskMultiplier > 1) {
             return `Successfully changed the payout multiplier for @${username} to ${taskMultiplier}. The reason ${
               reason ? `provided is "${reason}"` : "is not provided"
      -      }. This feature is designed to limit the contributor's compensation for any bounty on the current repository due to other compensation structures (i.e. salary.) are you sure you want to use a bounty multiplier above 1?`;
      +      }. This feature is designed to limit the contributor's compensation for any task on the current repository due to other compensation structures (i.e. salary.) are you sure you want to use a price multiplier above 1?`;
           } else {
             return `Successfully changed the payout multiplier for @${username} to ${taskMultiplier}. The reason ${
               reason ? `provided is "${reason}"` : "is not provided"
      diff --git a/src/handlers/comment/handlers/unassign.ts b/src/handlers/comment/handlers/unassign.ts
      index 91aae184e..9bd9ea1ef 100644
      --- a/src/handlers/comment/handlers/unassign.ts
      +++ b/src/handlers/comment/handlers/unassign.ts
      @@ -33,7 +33,7 @@ export const unassign = async (body: string) => {
             issue_number,
             assignees.map((i) => i.login)
           );
      -    return `You have been unassigned from the bounty @${payload.sender.login}`;
      +    return `You have been unassigned from the task @${payload.sender.login}`;
         }
         return;
       };
      diff --git a/src/handlers/payout/action.ts b/src/handlers/payout/action.ts
      index 327368e29..53ff44f40 100644
      --- a/src/handlers/payout/action.ts
      +++ b/src/handlers/payout/action.ts
      @@ -260,11 +260,11 @@ export const calculateIssueAssigneeReward = async (incentivesCalculation: Incent
           incentivesCalculation.multiplier
         );
         if (priceInEth.gt(incentivesCalculation.permitMaxPrice)) {
      -    logger.info("Skipping to proceed the payment because bounty payout is higher than permitMaxPrice.");
      -    return { error: `Permit generation disabled because issue's bounty is higher than ${incentivesCalculation.permitMaxPrice}` };
      +    logger.info("Skipping to proceed the payment because task payout is higher than permitMaxPrice.");
      +    return { error: `Permit generation disabled because issue's task is higher than ${incentivesCalculation.permitMaxPrice}` };
         }
       
      -  // if bounty hunter has any penalty then deduct it from the bounty
      +  // if contributor has any penalty then deduct it from the task
         const penaltyAmount = await getPenalty(
           assigneeLogin,
           incentivesCalculation.payload.repository.full_name,
      @@ -283,7 +283,7 @@ export const calculateIssueAssigneeReward = async (incentivesCalculation: Incent
               incentivesCalculation.evmNetworkId.toString(),
               taskAmount
             );
      -      const msg = `Permit generation disabled because bounty amount after penalty is 0.`;
      +      const msg = `Permit generation disabled because task amount after penalty is 0.`;
             logger.info(msg);
             return { error: msg };
           }
      @@ -337,8 +337,8 @@ export const handleIssueClosed = async (
           incentivesCalculation.multiplier
         );
         if (priceInEth.gt(incentivesCalculation.permitMaxPrice)) {
      -    logger.info("Skipping to proceed the payment because bounty payout is higher than permitMaxPrice");
      -    return { error: `Permit generation skipped since issue's bounty is higher than ${incentivesCalculation.permitMaxPrice}` };
      +    logger.info("Skipping to proceed the payment because task payout is higher than permitMaxPrice");
      +    return { error: `Permit generation skipped since issue's task is higher than ${incentivesCalculation.permitMaxPrice}` };
         }
       
         // COMMENTERS REWARD HANDLER
      diff --git a/src/handlers/processors.ts b/src/handlers/processors.ts
      index 94a0ff93a..663965fcb 100644
      --- a/src/handlers/processors.ts
      +++ b/src/handlers/processors.ts
      @@ -1,7 +1,7 @@
       import { GithubEvent, Handler, ActionHandler } from "../types";
       import { closePullRequestForAnIssue, commentWithAssignMessage } from "./assign";
       import { pricingLabelLogic, validatePriceLabels } from "./pricing";
      -import { checkBountiesToUnassign, collectAnalytics, checkWeeklyUpdate } from "./wildcard";
      +import { checkTasksToUnassign, collectAnalytics, checkWeeklyUpdate } from "./wildcard";
       import { nullHandler } from "./shared";
       import { handleComment, issueClosedCallback, issueCreatedCallback, issueReopenedCallback } from "./comment";
       import { checkPullRequests } from "./assign/auto";
      @@ -75,4 +75,4 @@ export const processors: Record = {
       /**
        * @dev The handlers which will run on every event hooked
        */
      -export const wildcardProcessors: ActionHandler[] = [checkBountiesToUnassign, collectAnalytics, checkWeeklyUpdate];
      +export const wildcardProcessors: ActionHandler[] = [checkTasksToUnassign, collectAnalytics, checkWeeklyUpdate];
      diff --git a/src/handlers/shared/index.ts b/src/handlers/shared/index.ts
      index a0c9d7fd7..c50fe5031 100644
      --- a/src/handlers/shared/index.ts
      +++ b/src/handlers/shared/index.ts
      @@ -1,4 +1,4 @@
       export * from "./handler";
       export * from "./pricing";
       
      -export const deadLinePrefix = "The time limit for this bounty is on";
      +export const deadLinePrefix = "The time limit for this task is on";
      diff --git a/src/handlers/wildcard/analytics.ts b/src/handlers/wildcard/analytics.ts
      index e69003b4a..bc0f227f5 100644
      --- a/src/handlers/wildcard/analytics.ts
      +++ b/src/handlers/wildcard/analytics.ts
      @@ -5,9 +5,9 @@ import { Issue, IssueType, User, UserProfile } from "../../types";
       import { getTargetPriceLabel } from "../shared";
       
       /**
      - * Checks the issue whether it's a bounty for hunters or an issue for not
      + * Checks the issue whether it's a task for hunters or an issue for not
        * @param issue - The issue object
      - * @returns If bounty - true, If issue - false
      + * @returns If task - true, If issue - false
        */
       export const taskInfo = (
         issue: Issue
      @@ -61,10 +61,10 @@ export const collectAnalytics = async (): Promise => {
           // need to skip checking the closed issues already stored in the db and filter them by doing a sanitation checks.
           // sanitation checks would be basically checking labels of the issue
           // whether the issue has both `priority` label and `timeline` label
      -    const bounties = issues.filter((issue) => taskInfo(issue as Issue).isTask);
      +    const tasks = issues.filter((issue) => taskInfo(issue as Issue).isTask);
       
           // collect assignees from both type of issues (opened/closed)
      -    const assignees = bounties.filter((task) => task.assignee).map((task) => task.assignee as User);
      +    const assignees = tasks.filter((task) => task.assignee).map((task) => task.assignee as User);
       
           // remove duplication by assignee
           const tmp = assignees.map((i) => i.login);
      @@ -85,11 +85,11 @@ export const collectAnalytics = async (): Promise => {
       
           await Promise.all(userProfilesToUpsert.map((i) => upsertUser(i)));
       
      -    // No need to update the record for the bounties already closed
      -    const bountiesToUpsert = bounties.filter((task) => (task.state === IssueType.CLOSED ? task.number > maximumIssueNumber : true));
      -    logger.info(`Upserting bounties: ${bountiesToUpsert.map((i) => i.title).toString()}`);
      +    // No need to update the record for the tasks already closed
      +    const tasksToUpsert = tasks.filter((task) => (task.state === IssueType.CLOSED ? task.number > maximumIssueNumber : true));
      +    logger.info(`Upserting tasks: ${tasksToUpsert.map((i) => i.title).toString()}`);
           await Promise.all(
      -      bountiesToUpsert.map((i) => {
      +      tasksToUpsert.map((i) => {
               const additions = taskInfo(i as Issue);
               if (additions.timelabel && additions.priorityLabel && additions.priceLabel)
                 return upsertIssue(i as Issue, {
      diff --git a/src/handlers/wildcard/unassign.ts b/src/handlers/wildcard/unassign.ts
      index 23bd6c1d1..285adaf51 100644
      --- a/src/handlers/wildcard/unassign.ts
      +++ b/src/handlers/wildcard/unassign.ts
      @@ -13,10 +13,10 @@ import { Comment, Issue, IssueType, Payload, UserType } from "../../types";
       import { deadLinePrefix } from "../shared";
       
       /**
      - * @dev Check out the bounties which haven't been completed within the initial timeline
      - *  and try to release the bounty back to dev pool
      + * @dev Check out the tasks which haven't been completed within the initial timeline
      + *  and try to release the task back to dev pool
        */
      -export const checkBountiesToUnassign = async () => {
      +export const checkTasksToUnassign = async () => {
         const logger = getLogger();
         logger.info(`Getting all the issues...`);
       
      @@ -26,9 +26,9 @@ export const checkBountiesToUnassign = async () => {
       
         const assigned_issues = issues_opened.filter((issue) => issue.assignee);
       
      -  // Checking the bounties in parallel
      +  // Checking the tasks in parallel
         const res = await Promise.all(assigned_issues.map(async (issue) => checkTaskToUnassign(issue as Issue)));
      -  logger.info(`Checking expired bounties done! total: ${res.length}, unassigned: ${res.filter((i) => i).length}`);
      +  logger.info(`Checking expired tasks done! total: ${res.length}, unassigned: ${res.filter((i) => i).length}`);
       };
       
       const checkTaskToUnassign = async (issue: Issue): Promise => {
      @@ -38,7 +38,7 @@ const checkTaskToUnassign = async (issue: Issue): Promise => {
         const {
           unassign: { followUpTime, disqualifyTime },
         } = getBotConfig();
      -  logger.info(`Checking the bounty to unassign, issue_number: ${issue.number}`);
      +  logger.info(`Checking the task to unassign, issue_number: ${issue.number}`);
         const { unassignComment, askUpdate } = GLOBAL_STRINGS;
         const assignees = issue.assignees.map((i) => i.login);
         const comments = await getAllIssueComments(issue.number);
      @@ -82,7 +82,7 @@ const checkTaskToUnassign = async (issue: Issue): Promise => {
               );
             } else {
               await addCommentToIssue(
      -          `${askUpdate} @${assignees[0]}? If you would like to release the bounty back to the DevPool, please comment \`/stop\` \nLast activity time: ${lastActivity}`,
      +          `${askUpdate} @${assignees[0]}? If you would like to release the task back to the DevPool, please comment \`/stop\` \nLast activity time: ${lastActivity}`,
                 issue.number
               );
             }
      diff --git a/src/handlers/wildcard/weekly/action.ts b/src/handlers/wildcard/weekly/action.ts
      index 058865cd4..ea599b55f 100644
      --- a/src/handlers/wildcard/weekly/action.ts
      +++ b/src/handlers/wildcard/weekly/action.ts
      @@ -87,7 +87,7 @@ const processEvents = (JSONList: any[]): SummaryType => {
         let openedIssues = 0;
         let closedIssues = 0;
         let comments = 0;
      -  let bountiesUSD = 0;
      +  let tasksUSD = 0;
         let openedPRs = 0;
         let closedPRs = 0;
         let mergedPRs = 0;
      @@ -110,7 +110,7 @@ const processEvents = (JSONList: any[]): SummaryType => {
                           .match(/\b\d+\b/)
                           .join("")
                       );
      -                bountiesUSD += taskUSD;
      +                tasksUSD += taskUSD;
                     }
                   });
                   break;
      @@ -156,7 +156,7 @@ const processEvents = (JSONList: any[]): SummaryType => {
           `new issues: ${openedIssues}\n` +
           `issues resolved: ${closedIssues}\n` +
           `total user interactions count: ${comments}\n` +
      -    `bounties given: ${bountiesUSD} USD\n` +
      +    `tasks given: ${tasksUSD} USD\n` +
           `new pulls: ${openedPRs}\n` +
           `closed pulls: ${closedPRs}\n` +
           `merged pulls: ${mergedPRs}\n` +
      diff --git a/supabase/README.md b/supabase/README.md
      index 397affb3f..b1669af15 100644
      --- a/supabase/README.md
      +++ b/supabase/README.md
      @@ -1,6 +1,6 @@
       # Supabase Database Adapter
       
      -[Supabase](https://supabase.com/) is used to store bounty hunters profiles and bounties information.
      +[Supabase](https://supabase.com/) is used to store contributor profiles and task information.
       
       ### How to setup supabase project locally