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

Commit

Permalink
Merge branch 'development' into dev-6
Browse files Browse the repository at this point in the history
  • Loading branch information
me505 authored Sep 18, 2023
2 parents 551d066 + 8166989 commit d72f646
Show file tree
Hide file tree
Showing 100 changed files with 4,307 additions and 1,393 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ ANALYTICS_MODE=
# Use `trace` to get verbose logging or `info` to show less
LOG_LEVEL=debug
LOGDNA_INGESTION_KEY=
OPENAI_API_HOST=https://api.openai.com
OPENAI_API_KEY=
CHATGPT_USER_PROMPT_FOR_IMPORTANT_WORDS="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='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=80
MEASURE_SIMILARITY_AI_TEMPERATURE=0
IMPORTANT_WORDS_AI_TEMPERATURE=0
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @0xcodercrane
* @0xcodercrane
15 changes: 12 additions & 3 deletions .github/ISSUE_TEMPLATE/bounty-template.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: "Bounty Proposal"
description: Have a suggestion for how to improve UbiquiBot? Let us know!
title: "Bounty Proposal:"
title: "Bounty Proposal: "

body:
- type: markdown
attributes:
value: |
## Feature Request Form
Thank you for taking the time to file a feature request! Please let us know what you're trying to do, and how UbiquiBot can help.
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
attributes:
label: Describe the background or context
description: Please let us know what inspired you to write this proposal. Backlinking to specific comments is usually sufficient context.
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

Expand All @@ -22,3 +24,10 @@ body:
description: A clear description of what you want to happen. Add any considered drawbacks.
validations:
required: true

- type: textarea
attributes:
label: Remarks
description: Any closing remarks?
validations:
required: false
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Telegram Group Chat
url: https://t.me/UbiquityDAO/29891
about: "Join us on Telegram!"
- name: UbiquiBot Development Group Chat
url: https://t.me/UbiquityDAO/31132
about: "Live chat with us on Telegram!"
14 changes: 9 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!-- RULES TO CONTRIBUTE TO UBIQUIBOT
1. You must link the issue number e.g. "Resolves #1234"
2. You must link proof that your code works from a test issue on your forked repo e.g. "Quality Assurance https://github.com/user/repo/issues/1#issuecomment-1"
3. Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

Resolves #

<!--
- You must link the issue number e.g. "Resolves #1234"
- You must link the QA issue on your forked repo e.g. "QA for #1234"
- Please do not replace the keyword "Resolves" https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
Quality Assurance:
35 changes: 1 addition & 34 deletions .github/ubiquibot-config.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
---
evm-network-id: 100
base-multiplier: 1500
time-labels:
- name: "Time: <1 Hour"
weight: 0.125
value: 3600
- name: "Time: <1 Day"
weight: 1
value: 86400
- name: "Time: <1 Week"
weight: 2
value: 604800
- name: "Time: <2 Weeks"
weight: 3
value: 1209600
- name: "Time: <1 Month"
weight: 4
value: 2592000
priority-labels:
- name: "Priority: 0 (Normal)"
weight: 1
- name: "Priority: 1 (Medium)"
weight: 2
- name: "Priority: 2 (High)"
weight: 3
- name: "Priority: 3 (Urgent)"
weight: 4
- name: "Priority: 4 (Emergency)"
weight: 5
auto-pay-mode: true
analytics-mode: true
max-concurrent-bounties: 2
promotion-comment: "\n<h6>If you enjoy the DevPool experience, please follow <a href='https://github.com/ubiquity'>Ubiquity on GitHub</a> and star <a href='https://github.com/ubiquity/devpool-directory'>this repo</a> to show your support. It helps a lot!</h6>"
price-multiplier: 1.5
2 changes: 1 addition & 1 deletion .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ jobs:
X25519_PRIVATE_KEY: 'QCDb30UHUkwJAGhLWC-R2N0PiEbd4vQY6qH2Wloybyo'
FOLLOW_UP_TIME: '4 days'
DISQUALIFY_TIME: '7 days'
run: yarn start:serverless
run: yarn start:serverless
37 changes: 37 additions & 0 deletions .github/workflows/deploy-logger-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Deploy Log Web App to Cloudflare Worker

on:
workflow_run:
workflows: ["Conventional Commits"]
types:
- completed

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Worker

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20.3.0"

- name: Build TypeScript
run: cd ./log-app && npm install && npm run build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: ${{ secrets.LOGGER_WEB_APP_DIRECTORY }}
# Enable Wrangler v3
wranglerVersion: "3"
1 change: 1 addition & 0 deletions .github/workflows/kebab-case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
"\.sql$"
"\.md$"
"\.d.ts$"
"^\.\/\log-app"
)
while read -r file; do
basefile=$(basename "$file")
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/update-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Pull Request Action
permissions: write-all
on:
workflow_dispatch:

env:
GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Check out repository
uses: actions/checkout@v3

- name: Install jq and yq
run: |
sudo apt-get -y install jq
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- name: Get UbiquiBot Token
uses: tibdex/[email protected]
id: get_installation_token
with:
app_id: ${{ secrets.UBIQUITY_BOUNTY_BOT_APP_ID }}
private_key: ${{ secrets.UBIQUITY_BOUNTY_BOT_PRIVATE_KEY }}

- name: Update Config Params and Create Pull Requests
run: |
urls=$(curl -sSL https://raw.githubusercontent.com/ubiquity/devpool-directory/development/projects.json | jq -r '.urls[]')
for url in $urls
do
repoName=$(basename $url)
ownerName=$(echo $url | awk -F/ '{print $(NF-1)}')
git clone $url $repoName
cd $repoName
defaultBranch=$(git branch --show-current)
# make a branch to update config #
git branch update
git checkout update
curl -sSL https://raw.githubusercontent.com/ubiquity/ubiquibot/development/ubiquibot-config-default.json > default.json
declare -A param_mapping=(
["evm-network-id"]="network-id chain-id"
["price-multiplier"]="base-multiplier"
#add more configs as needed
)
### update configs ###
# Iterate over the mapping and perform updates using sed
for new_param in "${!param_mapping[@]}"
do
old_params="${param_mapping[$new_param]}"
for old_param in $old_params
do
# only update param if the old ones exist
exist_old_param=$(yq "has(\"$old_param\")" .github/ubiquibot-config.yml)
if $exist_old_param; then
yq ".$new_param = .$old_param | del(.$old_param)" .github/ubiquibot-config.yml > temp.yml
mv temp.yml .github/ubiquibot-config.yml
fi
done
# if new param still doesent exist add default from ubiquibot-config-default.json
exist_new_param=$(yq "has(\"$new_param\")" .github/ubiquibot-config.yml)
if ! $exist_new_param; then
echo adding
def_val=$(jq -r ".[\"$new_param\"]" ubiquibot-config-default.json)
yq ".$new_param=$def_val" .github/ubiquibot-config.yml > temp.yml
mv temp.yml .github/ubiquibot-config.yml
fi
done
git config user.email "113181824+UbiquiBot[bot]@users.noreply.github.com"
git config user.name "UbiquiBot[bot]"
git add .github/ubiquibot-config.yml
git commit -m "build: use latest ubiquibot config setup"
git remote set-url origin https://${{ secrets.ADD_TO_PROJECT_PAT }}@github.com/$ownerName/$repoName.git
git push -f origin update
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ steps.get_installation_token.outputs.token }}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$ownerName/$repoName/pulls \
-d '{
"title": "build: use latest ubiquibot config setup",
"base": "'"$defaultBranch"'",
"head": "update"
}'
cd ..
done
Loading

0 comments on commit d72f646

Please sign in to comment.