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

Commit

Permalink
Merge remote-tracking branch 'origin' into default-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Venoox committed Jul 6, 2023
2 parents bc35c3c + 48e006d commit 71d0b69
Show file tree
Hide file tree
Showing 79 changed files with 1,665 additions and 310,589 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
12 changes: 12 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"rules": {
"@typescript-eslint/no-floating-promises": "error"
}
}
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/bounty-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Bounty Proposal"
description: Have a suggestion for how to improve UbiquiBot? Let us know!
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.
- 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.
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
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Telegram Group Chat
url: https://t.me/UbiquityDAO/29891
about: "Join us on Telegram!"
2 changes: 1 addition & 1 deletion .github/ubiquibot-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ priority-labels:
- name: "Priority: 4 (Emergency)"
weight: 5
auto-pay-mode: true
analytics-mode: false
analytics-mode: true
max-concurrent-bounties: 2
12 changes: 6 additions & 6 deletions .github/workflows/bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
types:
- created
- edited
pull_request:
types:
- opened

jobs:
calculate_bounty_job:
Expand All @@ -33,15 +30,18 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "18.14.1"

- name: Install
run: yarn install

- name: Authenticate as UbiquiBot
uses: tibdex/[email protected]
id: get_installation_token
with:
app_id: 346074
# https://github.com/organizations/ubiquibot/settings/apps/ubiquibot-qa/installations
# https://github.com/apps/ubiquibot-qa/installations/new/permissions?target_id=4975670
# https://github.com/settings/installations/38790399
private_key: |
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA3QM8hM2PNtmZVDu9fMWCznTw4FefZ2JXe+3ong4TX4G/d3QD
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
RoF1Gt57QIS+TdRQFMkNgd7fyq4+kotQBjuRQIfDOPhKXVnopeFJOFJkAGRc4Saa
BGZvyfK5g8aSy8Wtg4Lj7/wL4pEde4cm8AF4K0wbb3AfbDBB0GQk6N8=
-----END RSA PRIVATE KEY-----
- name: Invoke the UbiquiBot
id: UbiquiBot
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ jobs:
- name: Local Build
run: yarn build

- name: Lint
run: yarn lint
50 changes: 50 additions & 0 deletions .github/workflows/kebab-case.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Enforce kebab-case

on: [push, pull_request]

jobs:
check-filenames:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Check For Non Kebab-Cased File Names
run: |
non_compliant_files=()
ignoreList=(
"^\.\/\..*\/" # Ignore hidden flies
"^\.\/[^\/]*$" # Ignore files in root project directory
"^\.\/node_modules"
"^\.\/\.git"
"^\.\/dist"
"^\.\/build"
"^\.\/vendor"
"^\.\/\.next"
"\.sql$"
"\.md$"
"\.d.ts$"
)
while read -r file; do
basefile=$(basename "$file")
ignoreFile=false
for pattern in "${ignoreList[@]}"; do
if echo "$file" | grep -q -E "$pattern"; then
ignoreFile=true
break
fi
done
if $ignoreFile; then
continue
elif ! echo "$basefile" | grep -q -E "^([a-z0-9]+-)*[a-z0-9]+(\.[a-zA-Z0-9]+)?$|^([a-z0-9]+_)*[a-z0-9]+(\.[a-zA-Z0-9]+)?$"; then
non_compliant_files+=("$file")
echo "::warning file=$file::This file is not in kebab-case or snake_case"
fi
done < <(find . -type f)
if [ ${#non_compliant_files[@]} -ne 0 ]; then
echo "The following files are not in kebab-case or snake_case:"
for file in "${non_compliant_files[@]}"; do
echo " - $file"
done
exit 1
fi
35 changes: 35 additions & 0 deletions .github/workflows/qa-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Automate QA

on:
pull_request_target:
types:
- review_requested
branches: [development, main]

jobs:
add-to-project:
env:
ADD_TO_PROJECT_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }}
name: Add issue to project
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Add PR to QA project
if: contains(github.event.pull_request.requested_reviewers.*.login, 'Draeieg')
uses: actions/[email protected]
with:
project-url: https://github.com/orgs/ubiquity/projects/23
github-token: ${{ env.ADD_TO_PROJECT_PAT }}

- name: Create QA Issue
if: contains(github.event.pull_request.requested_reviewers.*.login, 'Draeieg')
uses: dacbd/create-issue-action@v1
with:
token: ${{ env.ADD_TO_PROJECT_PAT }}
owner: ubiquibot
repo: staging
title: QA for ${{ github.event.pull_request.title }}
body: |
Testing pr <a href="${{ github.event.pull_request.html_url }}">${{ github.event.pull_request.number }}</a>
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ supabase/.branches
supabase/temp
# Local Netlify folder
.netlify
bin
.yarn
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.0
v20.3.0
Binary file removed .yarn/install-state.gz
Binary file not shown.
30 changes: 18 additions & 12 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
ISC License
MIT License

Copyright (c) 2022, Ubiquity DAO

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The "UbiquiBot"
# The UbiquiBot

Ubiquity DAO's GitHub Bot to automate DevPool management.

Expand Down Expand Up @@ -119,8 +119,31 @@ When using as a github app the flow is the following:
3. Push tags: `git push origin v"x.x.x"`
4. The Github action will create a release by recognizing the version tag

![ubiquibot-pfp-1](https://user-images.githubusercontent.com/4975670/208798502-0ac27adc-ab19-4148-82b8-8538040cf3b6.png)

```
```
## Architecture Overview

Bounty bot is built using the [probot](https://probot.github.io/) framework so initially the bot is a github app

<pre>
&lt;root&gt;
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/bin">bin</a>: Binary file and action file compiled by `@vercel/ncc`
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/docs">docs</a>: Documentations
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src">src </a>: Main source code
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/supabase">supabase</a>: Supabase migrations and configuration file
</pre>

## `/src`

<pre>
&lt;src&gt;
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/adapters">adapters</a>: A set of interaces to interact with 3rd party libraries such as <a href="https://www.npmjs.com/package/telegraf">Telegraf</a>, <a href="https://www.npmjs.com/package/@supabase/supabase-js">supabase-js</a>.<br> It consists of a set of small functions bulit on top of a specific library.<br> Every adapter needs to be for calling a specific method of the library.
|
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/bindings">bindings</a>: A set of listeners to bind/process requests emitted by GitHub.<br> It also has a function to load a project configuration.
|
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/configs">configs</a>: Constants and default config values used to create a bot configuration<br> in case we're missing any needed configuration parameters from both .env and config file.
|
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/handlers">handlers</a>: A set of event-based processors.<br> Each handler processes a specific request and it may consist of pre, action and post handlers.<br> A pre handler would be running in prior to the main action which needs to be shorter not to affect the main handler's process.<br> A post handler would be running as soon as the main handler gets completed. <br>It has no limitation on its completion time.<br> For example, it could be an example of pre-handler to create missing price labels <br> because if we don't have necessary labels created already on the repo, labeling non-exists labels would definitely throw.
|
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/types">types</a> A set of schema and type definitions.<br> Why do we need schema? because we want to validate the unknown input and throw the error before the main execution.
|
├── <a href="https://github.com/ubiquity/ubiquibot/tree/development/src/utils">utils</a> A set of utility functions
</pre>
5 changes: 0 additions & 5 deletions action.yml

This file was deleted.

2 changes: 0 additions & 2 deletions api/github/webhooks/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions bin/action.yml

This file was deleted.

Loading

0 comments on commit 71d0b69

Please sign in to comment.