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

Refactor/general #644

Merged
merged 536 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
536 commits
Select commit Hold shift + click to select a range
5d73a89
refactor: cleanup
0x4007 Oct 27, 2023
a5eac54
fix: filepath
0x4007 Oct 27, 2023
6cf0f77
chore: init refactor bot config
0x4007 Oct 27, 2023
69a29b7
refactor(config): ajv broken cant figure out what the error message m…
0x4007 Oct 28, 2023
bcb35cd
chore(ajv): had to disable strict validation no idea what the origin …
0x4007 Oct 28, 2023
b414d45
fix(ajv): loading default config is stable
0x4007 Oct 28, 2023
bdf0ba4
chore: this is all broken
0x4007 Oct 28, 2023
90ce391
Merge remote-tracking branch 'pavlovcik/refactor/general' into custom…
whilefoo Oct 29, 2023
51d069f
Merge pull request #29 from ubiquity-whilefoo/custom-context
0x4007 Oct 30, 2023
369d885
feat: contributor incentives
0x4007 Oct 31, 2023
6161872
feat: contributor incentives
0x4007 Oct 31, 2023
24bf782
Merge remote-tracking branch 'pavlovcik/refactor/general' into feat/c…
0x4007 Oct 31, 2023
0d66ce5
revert: undo context merges
0x4007 Oct 31, 2023
da5bebe
chore: add context and hold off on full incentives scoring
0x4007 Oct 31, 2023
6d00852
chore: add context and hold off on full incentives scoring
0x4007 Oct 31, 2023
2710fcb
refactor: try and calculate main scores
0x4007 Oct 31, 2023
c55e93c
refactor(scoring): trying to consolidate into single normalization an…
0x4007 Oct 31, 2023
0222f5a
chore: create permit comment mockup and interfaces
0x4007 Nov 1, 2023
37b3e2a
fix(ms): safe ms wrapper because does not support months
0x4007 Nov 2, 2023
b0035a6
feat: aggregate errors
0x4007 Nov 2, 2023
326a2b7
Delete .github/ISSUE_TEMPLATE/sweep-template.yml
0x4007 Nov 2, 2023
d6414c2
fix: wildcard unassigns
0x4007 Nov 2, 2023
bf8f20a
feat: allow setting price label only
0x4007 Nov 2, 2023
f6e23eb
feat: tried zod
whilefoo Nov 2, 2023
f5da0ab
Merge remote-tracking branch 'pavlovcik/refactor/general' into refact…
whilefoo Nov 2, 2023
85a3bf4
feat: new config
whilefoo Nov 3, 2023
3e939d5
fix: circular dependencies
whilefoo Nov 4, 2023
4926daf
fix: schema and decode
whilefoo Nov 5, 2023
776938a
fix: payload user type
whilefoo Nov 5, 2023
85f43ca
feat: contributor incentives total scoring (unstable)
0x4007 Nov 5, 2023
79347a7
fix: main type errors
0x4007 Nov 6, 2023
0693854
refactor: generalizing the contribution scoring schema
0x4007 Nov 7, 2023
0287185
feat: comment scoring cleaned up and includes more information
0x4007 Nov 7, 2023
28d67cd
fix: almost at the end of making better types for scoring
0x4007 Nov 8, 2023
3c67919
fix: transform/decode, config validation at the start
whilefoo Nov 8, 2023
53d899b
fix: got to permit generation
0x4007 Nov 8, 2023
dd465d2
fix: type errors
0x4007 Nov 8, 2023
db35021
fix: permit type errors
0x4007 Nov 8, 2023
666a072
fix: type errors almost completed
0x4007 Nov 8, 2023
e8aa4c6
fix: all type errors fixed
0x4007 Nov 9, 2023
ba91015
feat(start): works with only price set
0x4007 Nov 9, 2023
33b955c
feat: error messages, probot context in adapters
whilefoo Nov 10, 2023
2ef0cdb
feat: initialize
wannacfuture Nov 10, 2023
a8391c8
fix: some runtime bugs
0x4007 Nov 11, 2023
047998b
Merge remote-tracking branch 'pavlovcik/feat/contributor-incentives-t…
0x4007 Nov 11, 2023
d0f62e0
refactor: cleanup
0x4007 Nov 11, 2023
8897087
fix: tests
whilefoo Nov 12, 2023
1100888
fix: added comment
whilefoo Nov 13, 2023
1e1fe26
refactor: small adjustments
0x4007 Nov 13, 2023
d057dc6
Merge branch 'refactor/bot-config' of https://github.com/ubiquity-whi…
0x4007 Nov 13, 2023
528b8c6
refactor: organize imports
0x4007 Nov 13, 2023
54a7066
Merge branch 'ubiquity-whilefoo-refactor/bot-config' into feat/contri…
0x4007 Nov 13, 2023
a0e488e
fix: build errors
0x4007 Nov 13, 2023
53428a5
fix(config): token limit moved to misc
0x4007 Nov 14, 2023
bcdd53f
Delete .github/ubiquibot-config.yml
0x4007 Nov 14, 2023
e1be6a8
fix(config): loader still not stable
0x4007 Nov 14, 2023
d8fd54c
refactor: cleanup
0x4007 Nov 14, 2023
232cecd
feat: remove zod
whilefoo Nov 14, 2023
4cc7866
fix: merge before validation/defaults
whilefoo Nov 14, 2023
ca1d827
feat: custom merge for arrays and change commands to disabledCommands
whilefoo Nov 16, 2023
62cb0c6
Merge pull request #45 from ubiquity-whilefoo/fix-config
0x4007 Nov 16, 2023
4ccce56
feat: logs do not render in console or comment if filtered out based …
0x4007 Nov 16, 2023
2949f7e
feat: logs do not render in comment if filtered out and if bubbled to…
0x4007 Nov 16, 2023
3806a89
fix: refactored 'ubiquibot-config.yml' and redesigned logger statements
0x4007 Nov 17, 2023
6253435
feat: comment on commit
0x4007 Nov 17, 2023
5dfc27e
feat: improved comment posting and structured metadata util
0x4007 Nov 17, 2023
af772be
feat: duplication fix
wannacfuture Nov 17, 2023
ad8e068
feat: minor fix
wannacfuture Nov 17, 2023
880281c
feat: minor fix
wannacfuture Nov 17, 2023
d00946c
Merge pull request #48 from pavlovcik/feat/contributor-incentives-tot…
0x4007 Nov 17, 2023
82450db
refactor: type property to className
0x4007 Nov 17, 2023
1d6da4b
Merge branch 'feat/contributor-incentives-total-scoring' of https://g…
0x4007 Nov 17, 2023
951449c
feat: duplication collaborator
wannacfuture Nov 18, 2023
f5a5c5c
Merge pull request #50 from wannacfuture/feat/contributor-incentives-…
0x4007 Nov 19, 2023
40005e6
feat: remove context from addapters and pass it by parameter
whilefoo Nov 19, 2023
db19706
fix: change to undefined
whilefoo Nov 19, 2023
df8bc59
fix: initialize only once
whilefoo Nov 19, 2023
4713afa
feat: logger inside context
whilefoo Nov 20, 2023
4cbbf38
chore: delete ubiquibot-config-default.ts and modify
0x4007 Nov 21, 2023
1d7f061
Merge pull request #51 from ubiquity-whilefoo/runtime-fix
0x4007 Nov 21, 2023
0724395
fix: logs constructor arguments order
0x4007 Nov 21, 2023
e36fe96
feat: integrate infrastructure
wannacfuture Nov 22, 2023
684a97c
Merge branch 'feat/contributor-incentives-total-scoring' into feat/co…
wannacfuture Nov 22, 2023
10a7557
feat: update
wannacfuture Nov 22, 2023
edfc1f5
feat: update
wannacfuture Nov 22, 2023
f90fc56
feat: removep package lock
wannacfuture Nov 22, 2023
c6a07bd
fix: await promise
0x4007 Nov 23, 2023
23ef147
feat: replace issue helpers with paginate
whilefoo Nov 23, 2023
f6fa2ad
feat: minor fix
wannacfuture Nov 24, 2023
d4a8794
Merge branch 'feat/contributor-incentives-total-scoring-duplicate-fix…
wannacfuture Nov 24, 2023
be2baae
fix: linting issues and improve code readability
0x4007 Nov 25, 2023
950300b
fix: linting issues and improve code readability
0x4007 Nov 25, 2023
06dd7b8
fix: linter issues
0x4007 Nov 25, 2023
9151881
fix: lint staged
0x4007 Nov 25, 2023
c427d09
fix: import paths in files
0x4007 Nov 25, 2023
87e56aa
refactor: remove unnecessary barrelling
0x4007 Nov 25, 2023
8277400
feat: kebab-case check in pre-commit
0x4007 Nov 25, 2023
b700ce5
feat: add paginate and catch everywhere
whilefoo Nov 25, 2023
5e99029
Merge pull request #53 from ubiquity-whilefoo/paginate-fix
0x4007 Nov 26, 2023
55c68b7
refactor: remove unused exports and functions
0x4007 Nov 26, 2023
5cd3d6d
Merge branch 'feat/contributor-incentives-total-scoring-duplicate-fix…
0x4007 Nov 26, 2023
609b15f
Merge remote-tracking branch 'pavlovcik/feat/contributor-incentives-t…
0x4007 Nov 26, 2023
761fdd2
Merge branch 'refactor/type-locations' into feat/contributor-incentiv…
0x4007 Nov 26, 2023
bcd04c0
Merge branch 'feat/contributor-incentives-total-scoring' into refacto…
0x4007 Nov 26, 2023
10f14f8
chore: sync readme
0x4007 Nov 26, 2023
1ee033c
Merge branch 'development' into refactor/general
0x4007 Nov 26, 2023
d83f8c5
fix: add jest types again
0x4007 Nov 26, 2023
5e22ebb
fix: kebab case
0x4007 Nov 26, 2023
c1e4852
fix: logger
0x4007 Nov 26, 2023
13e3b88
feat: convert errors to fatal and warn to errors because seems less a…
0x4007 Nov 26, 2023
bdcfb73
chore: update push event logging messages
0x4007 Nov 27, 2023
ac2534e
fix: log level and error handling
0x4007 Nov 27, 2023
b1cc46f
revert: this needs type information
0x4007 Nov 27, 2023
db5ee8f
fix: default branch in dispatchWorkflow
0x4007 Nov 27, 2023
2cc0052
chore: kebab case
0x4007 Nov 27, 2023
933cdcd
refactor: issueNumber
0x4007 Nov 27, 2023
5f3c94e
chore: add knip ci workflow
gitcoindev Nov 28, 2023
72f5fe2
chore: add knip.ts configuration skeleton
gitcoindev Nov 28, 2023
f5d45bc
Update event.ts
0x4007 Dec 2, 2023
c37115b
feat: update
wannacfuture Dec 5, 2023
96aebdd
Update webhooks.ts
wannacfuture Dec 5, 2023
d478166
feat: update
wannacfuture Dec 5, 2023
ea077a0
Merge branch 'refactor/general' of https://github.com/wannacfuture/ub…
wannacfuture Dec 5, 2023
daa134a
feat: update
wannacfuture Dec 5, 2023
5e2500f
feat: update
wannacfuture Dec 5, 2023
8b92e0c
feat: update
wannacfuture Dec 5, 2023
a83b91e
feat: update
wannacfuture Dec 5, 2023
570f63b
feat: update
wannacfuture Dec 5, 2023
8d1def4
feat: add app deploy documentation
wannacfuture Dec 5, 2023
7346df1
feat: delete
wannacfuture Dec 5, 2023
f65270a
feat: update
wannacfuture Dec 5, 2023
8678be9
Apply suggestions from code review
0x4007 Dec 6, 2023
705238b
Merge pull request #58 from wannacfuture/refactor/general-deploy
0x4007 Dec 6, 2023
5a0787c
fix: dispatch params
0x4007 Dec 6, 2023
3b4be73
Revert "Refactor/general deploy"
0x4007 Dec 6, 2023
9f89bfd
fix: netlify commit hash
0x4007 Dec 6, 2023
16ae0af
Merge pull request #59 from pavlovcik/revert-58-refactor/general-deploy
0x4007 Dec 6, 2023
12cd2c7
fix: load env
0x4007 Dec 6, 2023
8c74da7
fix: netlify commit hash
0x4007 Dec 6, 2023
a7fa474
fix(build): fix some build errors
0x4007 Dec 6, 2023
212f6e9
chore: hack to get this into production faster
0x4007 Dec 6, 2023
00f6113
fix: commit hash render on build
0x4007 Dec 6, 2023
5313a61
fix: commit command
0x4007 Dec 6, 2023
7ab24dc
Update knip.yml to use knip-reporter v2.1.2 and node 20.x
gitcoindev Dec 6, 2023
8afedb2
Merge branch 'feat/logger-fatal' into refactor/general
0x4007 Dec 7, 2023
203ef5a
fix: delegate compute message level
0x4007 Dec 7, 2023
5b9bfe4
fix: ok log level to info level
0x4007 Dec 7, 2023
537880f
fix: minor missing info
0x4007 Dec 7, 2023
f266af9
chore: webhook cleaning
0x4007 Dec 7, 2023
4422df2
fix: build hash
0x4007 Dec 7, 2023
46175c7
fix: lint-staged
0x4007 Dec 7, 2023
4272ef5
fix: compute repo name
0x4007 Dec 7, 2023
7961254
fix(logs): always log to supabase
0x4007 Dec 8, 2023
3bdad28
refactor: remove unused log levels
0x4007 Dec 8, 2023
e984244
chore: debug validation error
0x4007 Dec 8, 2023
07ce845
fix: unassign handler but root cause not diagnosed
0x4007 Dec 8, 2023
678dcb9
feat: switch logging to ubiquibot-logging NPM module
gitcoindev Dec 8, 2023
c4c5986
feat: enable pretty logs import with ubiquity-logger v0.3.0
gitcoindev Dec 8, 2023
3ca8fad
Merge pull request #60 from gitcoindev/refactor-general-with-npm-logging
0x4007 Dec 9, 2023
dbb5d58
refactor: move to delegated compute
0x4007 Dec 10, 2023
579c447
refactor: prefix types with github to avoid typename collisions
0x4007 Dec 11, 2023
1a9e668
chore: switch knip-reporter to latest upstream release
gitcoindev Dec 11, 2023
ac3c2a4
chore: set node LTS and knip v2 tag
gitcoindev Dec 11, 2023
db96aca
feat: nft rewards
whilefoo Dec 11, 2023
06b3981
fix: remove console log
whilefoo Dec 11, 2023
2243c38
chore: use Codex-/knip-reporter
gitcoindev Dec 11, 2023
684b16c
refactor: cleanup
0x4007 Dec 11, 2023
5f18483
fix: app permissions used instead of personal access token
0x4007 Dec 11, 2023
ee51fb8
refactor: remove unnecessary code
0x4007 Dec 13, 2023
e23ccee
chore: add debugging logs
0x4007 Dec 13, 2023
05a143c
refactor: rename assign to start and unassign to stop
0x4007 Dec 13, 2023
6e33815
chore: debugging
0x4007 Dec 13, 2023
f81336a
chore: debugging
0x4007 Dec 13, 2023
ae4e785
chore: debugging
0x4007 Dec 13, 2023
fb9bf8e
chore: debugging
0x4007 Dec 13, 2023
0d664be
chore: debugging add netlify cli
0x4007 Dec 13, 2023
4fe47ba
chore: debugging
0x4007 Dec 13, 2023
056bb8c
feat(deps): add netlify logs
0x4007 Dec 13, 2023
613ec72
chore(logs): add metadata always
0x4007 Dec 13, 2023
a7def78
chore: enable source maps for netlify webhook for debugging
0x4007 Dec 13, 2023
41d8f72
chore: remove huge log
0x4007 Dec 13, 2023
115a103
fix: type error for build
0x4007 Dec 13, 2023
3ee39e0
chore: check necessary environment variables
0x4007 Dec 14, 2023
970419c
chore: upgrade knip to v3.7 with dev depencies typescript 5.0.4 and
gitcoindev Dec 14, 2023
1b38997
refactor: break apart unassign logic
0x4007 Dec 15, 2023
ef47ed8
fix: continue searching for assignees to disqualify
0x4007 Dec 15, 2023
ddd452f
refactor: rename files
0x4007 Dec 15, 2023
7d3e75c
refactor: move functions to where they are used
0x4007 Dec 15, 2023
2f117c4
chore: add penalty placeholder for issue reopened
0x4007 Dec 15, 2023
75c3cc9
feat: check if wallet is set before allowing start
0x4007 Dec 15, 2023
42cced8
feat: add more github events to enum
0x4007 Dec 15, 2023
f8f6b52
fix: build error
0x4007 Dec 15, 2023
4f15f0f
feat: extracted every github webhook type from probot
0x4007 Dec 15, 2023
0aef637
fix: build errors
0x4007 Dec 15, 2023
98699d4
feat: pass less info
wannacfuture Dec 18, 2023
437d144
refactor: move github events
0x4007 Dec 20, 2023
84ceea8
Merge branch 'refactor/general-deploy' into refactor/move-to-delegate…
0x4007 Dec 20, 2023
5e75f9d
chore: hack for probot to authenticate
0x4007 Dec 21, 2023
02ac3b0
chore: rename APP_PRIVATE_KEY to PRIVATE_KEY for probot
0x4007 Dec 21, 2023
b253789
fix: dispatcher use current organization
0x4007 Dec 21, 2023
920a334
chore: debugging duplicate events
0x4007 Dec 21, 2023
2d9dd4a
fix: debugging duplicate events
0x4007 Dec 21, 2023
4e888c7
fix: double events
0x4007 Dec 21, 2023
3006a9a
fix: build
0x4007 Dec 21, 2023
a274d53
fix: build
0x4007 Dec 21, 2023
7670cbd
chore: upgrade yarn
0x4007 Dec 23, 2023
4aaf216
fix: ping assignees for deadline
0x4007 Dec 23, 2023
37ee2d3
refactor: remove redundant value organization
0x4007 Dec 23, 2023
4c15837
feat: dedicated plugin stored at ubiquibot org
0x4007 Dec 23, 2023
62ed94a
feat: enable repository authentication from remote via github app
0x4007 Dec 23, 2023
abf320c
refactor: type casting for installation id
0x4007 Dec 23, 2023
99408aa
Merge remote-tracking branch 'pavlovcik/refactor/general' into nft-re…
whilefoo Dec 30, 2023
a703491
feat: update ubiquibot logger and fix start command
whilefoo Dec 31, 2023
95bcbdc
Merge pull request #57 from gitcoindev/knip-ci
0x4007 Jan 6, 2024
30fafc9
feat: fix pricing issue
wannacfuture Jan 9, 2024
714ea60
Merge pull request #63 from pavlovcik/refactor/general-deploy-pricing…
0x4007 Jan 15, 2024
0e4efb0
feat: remove private key from netlify env
wannacfuture Jan 16, 2024
85177d0
Merge pull request #64 from wannacfuture/refactor/remove-25519key-fro…
0x4007 Jan 16, 2024
626cae8
chore: almost done merging
0x4007 Jan 16, 2024
3014776
chore: merge
0x4007 Jan 16, 2024
841b18c
Merge branch 'ubiquity-whilefoo-nft-rewards' into refactor/move-to-de…
0x4007 Jan 16, 2024
eefbee9
feat: fix duplication price label issue
wannacfuture Jan 19, 2024
1060f00
Merge pull request #65 from wannacfuture/feat/fix-label-issues
0x4007 Jan 19, 2024
8aaf055
feat: fix build errors
wannacfuture Jan 22, 2024
19ec41c
feat: fix CI erros
wannacfuture Jan 23, 2024
f87a896
Update build.yml
wannacfuture Jan 23, 2024
136b11d
Update build.yml
wannacfuture Jan 23, 2024
73c5781
feat: minor change
wannacfuture Jan 23, 2024
fa4c9b9
Update build.yml
wannacfuture Jan 23, 2024
f16bf6d
feat: update build.yml
wannacfuture Jan 23, 2024
7fbd280
Update build.yml
wannacfuture Jan 23, 2024
d0d4230
feat: update build.yml
wannacfuture Jan 23, 2024
6b29125
Update build.yml
wannacfuture Jan 23, 2024
9d3c91c
feat: update
wannacfuture Jan 23, 2024
ed835da
Merge pull request #67 from wannacfuture/feat/fix-label-issues
0x4007 Jan 23, 2024
663138c
feat: remove axios call
wannacfuture Jan 29, 2024
beb5c9f
Merge pull request #68 from wannacfuture/refactor/remove-axios-call
0x4007 Jan 29, 2024
9bc1583
Revert "feat: remove axios call"
0x4007 Feb 2, 2024
e402d16
Merge pull request #69 from pavlovcik/revert-68-refactor/remove-axios…
0x4007 Feb 2, 2024
b85d27a
Merge branch 'refactor/move-to-delegated-compute' into development
0x4007 Feb 17, 2024
56a30fd
Merge remote-tracking branch 'upstream/development' into HEAD
0x4007 Feb 17, 2024
223c998
Merge branch 'development' into refactor/general
0x4007 Feb 17, 2024
5990267
chore: migrate to bun
0x4007 Feb 17, 2024
17e3cdb
fix: bun version
0x4007 Feb 17, 2024
3e7d129
fix: build command
0x4007 Feb 17, 2024
5687aa1
fix: build command
0x4007 Feb 17, 2024
29de0ee
fix: install toolchain
0x4007 Feb 17, 2024
32db575
chore: lint errors
0x4007 Feb 17, 2024
7e5e6ec
chore: try to fix knip
0x4007 Feb 17, 2024
0c3a364
chore: adjustments
0x4007 Feb 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"useGitignore": true,
"version": "0.2",
"language": "en",
"words": [
"autodetection",
"autopay",
"AUTOPAY",
"bucketid",
"bucketname",
"demilestoned",
"devpool",
"ensname",
"fkey",
"gelato",
"Gelato",
"gollum",
"keccak",
"libsodium",
"logdna",
"LOGDNA",
"mdast",
"Mdast",
"mergeable",
"micromark",
"milestoned",
"Numberish",
"orgname",
"pavlovcik",
"permisson",
"prereleased",
"probot",
"Probot",
"ratelimit",
"rebaseable",
"rerequested",
"scalarmult",
"signoff",
"sortcolumn",
"sortorder",
"supabase",
"Supabase",
"SUPABASE",
"svgs",
"timelabel",
"TURL",
"typebox",
"Ubiqui",
"ubiquibot",
"unarchived",
"Unassigning",
"Upserting",
"URLSAFE",
"vitalik",
"WXDAI"
]
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"start:serverless": "tsx src/adapters/github/github-actions.ts",
"start:watch": "nodemon --exec 'yarn start'",
"start": "probot run ./lib/src/index.js",
"prepare": "husky install"
"prepare": "husky install",
"utils:cspell": "cspell --config .cspell.json 'src/**/*.{js,ts,json,md,yml}'"
},
"dependencies": {
"@actions/core": "^1.10.0",
Expand All @@ -42,6 +43,7 @@
"ajv-formats": "^2.1.1",
"axios": "^1.3.2",
"copyfiles": "^2.4.1",
"cspell": "^7.0.0",
"decimal.js": "^10.4.3",
"ethers": "^5.7.2",
"exponential-backoff": "^3.1.1",
Expand Down Expand Up @@ -85,6 +87,9 @@
"lint-staged": {
"*.{ts,json}": [
"prettier --write"
],
"src/**.{ts,json}": [
"cspell"
]
},
"nodemonConfig": {
Expand Down
16 changes: 8 additions & 8 deletions src/adapters/supabase/helpers/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,15 @@ export const getWalletInfo = async (username: string, org_id: string): Promise<{
} else return { multiplier: multiplier?.value, address: wallet?.wallet_address };
};

export const addPenalty = async (username: string, repoName: string, tokenAddress: string, networkId: string, penalty: BigNumberish): Promise<void> => {
export const addPenalty = async (username: string, repoName: string, tokenAddress: string, evmNetworkId: string, penalty: BigNumberish): Promise<void> => {
const { supabase } = getAdapters();
const logger = getLogger();

const { error } = await supabase.rpc("add_penalty", {
_username: username,
_repository_name: repoName,
_token_address: tokenAddress,
_network_id: networkId,
_network_id: evmNetworkId,
_penalty_amount: penalty.toString(),
});
logger.debug(`Adding penalty done, { data: ${JSON.stringify(error)}, error: ${JSON.stringify(error)} }`);
Expand All @@ -426,7 +426,7 @@ export const addPenalty = async (username: string, repoName: string, tokenAddres
}
};

export const getPenalty = async (username: string, repoName: string, tokenAddress: string, networkId: string): Promise<BigNumber> => {
export const getPenalty = async (username: string, repoName: string, tokenAddress: string, evmNetworkId: string): Promise<BigNumber> => {
const { supabase } = getAdapters();
const logger = getLogger();

Expand All @@ -435,7 +435,7 @@ export const getPenalty = async (username: string, repoName: string, tokenAddres
.select("amount")
.eq("username", username)
.eq("repository_name", repoName)
.eq("network_id", networkId)
.eq("network_id", evmNetworkId)
.eq("token_address", tokenAddress);
logger.debug(`Getting penalty done, { data: ${JSON.stringify(error)}, error: ${JSON.stringify(error)} }`);

Expand All @@ -449,14 +449,14 @@ export const getPenalty = async (username: string, repoName: string, tokenAddres
return BigNumber.from(data[0].amount);
};

export const removePenalty = async (username: string, repoName: string, tokenAddress: string, networkId: string, penalty: BigNumberish): Promise<void> => {
export const removePenalty = async (username: string, repoName: string, tokenAddress: string, evmNetworkId: string, penalty: BigNumberish): Promise<void> => {
const { supabase } = getAdapters();
const logger = getLogger();

const { error } = await supabase.rpc("remove_penalty", {
_username: username,
_repository_name: repoName,
_network_id: networkId,
_network_id: evmNetworkId,
_token_address: tokenAddress,
_penalty_amount: penalty.toString(),
});
Expand All @@ -472,7 +472,7 @@ const getDbDataFromPermit = (permit: InsertPermit): Record<string, unknown> => {
organization_id: permit.organizationId,
repository_id: permit.repositoryId,
issue_id: permit.issueId,
network_id: permit.networkId,
network_id: permit.evmNetworkId,
bounty_hunter_id: permit.bountyHunterId,
token_address: permit.tokenAddress,
payout_amount: permit.payoutAmount,
Expand All @@ -491,7 +491,7 @@ const getPermitFromDbData = (data: Record<string, unknown>): Permit => {
organizationId: data.organization_id,
repositoryId: data.repository_i,
issueId: data.issue_id,
networkId: data.network_id,
evmNetworkId: data.network_id,
bountyHunterId: data.bounty_hunter_id,
tokenAddress: data.token_address,
payoutAmount: data.payout_amount,
Expand Down
1 change: 1 addition & 0 deletions src/assets/fonts/proxima-nova-regular-b64.ts

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/bindings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { getPayoutConfigByNetworkId } from "../helpers";
import { ajv } from "../utils";
import { Context } from "probot";
import { getScalarKey, getWideConfig } from "../utils/private";
import { getScalarKey, getWideConfig as getConfig } from "../utils/private";

export const loadConfig = async (context: Context): Promise<BotConfig> => {
const {
Expand All @@ -23,9 +23,9 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
incentives,
paymentPermitMaxPrice,
disableAnalytics,
bountyHunterMax,
maxConcurrentBounties,
incentiveMode,
networkId,
evmNetworkId,
issueCreatorMultiplier,
defaultLabels,
promotionComment,
Expand All @@ -34,10 +34,10 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
registerWalletWithVerification,
staleBountyTime,
enableAccessControl,
} = await getWideConfig(context);
} = await getConfig(context);

const publicKey = await getScalarKey(process.env.X25519_PRIVATE_KEY);
const { rpc, paymentToken } = getPayoutConfigByNetworkId(networkId);
const { rpc, paymentToken } = getPayoutConfigByNetworkId(evmNetworkId);

const botConfig: BotConfig = {
log: {
Expand All @@ -57,7 +57,7 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
promotionComment: promotionComment,
},
payout: {
networkId: networkId,
evmNetworkId: evmNetworkId,
rpc: rpc,
privateKey: privateKey,
paymentToken: paymentToken,
Expand Down Expand Up @@ -89,7 +89,7 @@ export const loadConfig = async (context: Context): Promise<BotConfig> => {
},
command: commandSettings,
assign: {
bountyHunterMax: bountyHunterMax,
maxConcurrentBounties: maxConcurrentBounties,
staleBountyTime: ms(staleBountyTime),
},
sodium: {
Expand Down
12 changes: 2 additions & 10 deletions src/bindings/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,7 @@ export const bindEvents = async (context: Context): Promise<void> => {
// Create adapters for telegram, supabase, twitter, discord, etc
logger.info("Creating adapters for supabase, telegram, twitter, etc...");

logger.info(
`Config loaded! config: ${JSON.stringify({
price: botConfig.price,
unassign: botConfig.unassign,
mode: botConfig.mode,
log: botConfig.log,
wallet: botConfig.wallet,
})}`
);
logger.info(`Config loaded! config: ${JSON.stringify(botConfig)}`);

logger.info(`Started binding events... id: ${id}, name: ${eventName}, allowedEvents: ${allowedEvents}`);

Expand All @@ -96,7 +88,7 @@ export const bindEvents = async (context: Context): Promise<void> => {
const validate = ajv.compile(PayloadSchema);
const valid = validate(payload);
if (!valid) {
logger.info("Payload schema validation failed!!!", payload);
logger.info("Payload schema validation failed!", payload);
if (validate.errors) logger.warn(validate.errors);
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/configs/shared.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// cspell:disable
export const COLORS = {
default: "ededed",
price: "1f883d",
};
// cspell:enable
export const DEFAULT_BOT_DELAY = 100; // 100ms
export const DEFAULT_TIME_RANGE_FOR_MAX_ISSUE = 24;
export const DEFAULT_TIME_RANGE_FOR_MAX_ISSUE_ENABLED = true;
Expand Down
12 changes: 6 additions & 6 deletions src/handlers/assign/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export const commentWithAssignMessage = async (): Promise<void> => {
return;
}

const curDate = new Date();
const curDateInMillisecs = curDate.getTime();
const endDate = new Date(curDateInMillisecs + duration * 1000);
const commit_msg = `${flattened_assignees} ${deadLinePrefix} ${endDate.toUTCString().replace("GMT", "UTC")}`;
logger.debug(`Creating an issue comment, commit_msg: ${commit_msg}`);
const currentDate = new Date();
const currentDateInMilliseconds = currentDate.getTime();
const endDate = new Date(currentDateInMilliseconds + duration * 1000);
const commitMessage = `${flattened_assignees} ${deadLinePrefix} ${endDate.toUTCString().replace("GMT", "UTC")}`;
logger.debug(`Creating an issue comment, commit_msg: ${commitMessage}`);

await addCommentToIssue(commit_msg, payload.issue?.number);
await addCommentToIssue(commitMessage, payload.issue?.number);
};

export const closePullRequestForAnIssue = async (): Promise<void> => {
Expand Down
6 changes: 3 additions & 3 deletions src/handlers/comment/handlers/assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export const assign = async (body: string) => {
logger.info(`Opened Pull Requests with approved reviews or with no reviews but over 24 hours have passed: ${JSON.stringify(openedPullRequests)}`);

const assignedIssues = await getAssignedIssues(payload.sender.login);
logger.info(`Max issue allowed is ${config.assign.bountyHunterMax}`);
logger.info(`Max issue allowed is ${config.assign.maxConcurrentBounties}`);

// check for max and enforce max
if (assignedIssues.length - openedPullRequests.length >= config.assign.bountyHunterMax) {
return `Too many assigned issues, you have reached your max of ${config.assign.bountyHunterMax}`;
if (assignedIssues.length - openedPullRequests.length >= config.assign.maxConcurrentBounties) {
return `Too many assigned issues, you have reached your max of ${config.assign.maxConcurrentBounties}`;
}

if (issue.state == IssueType.CLOSED) {
Expand Down
7 changes: 4 additions & 3 deletions src/handlers/comment/handlers/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const listAvailableCommands = async (body: string) => {
};

export const generateHelpMenu = () => {
let helpMenu = "### Available commands\n```";
let helpMenu = "### Available Commands\n```";
const commands = userCommands();
commands.map((command) => {
// if first command, add a new line
Expand All @@ -42,7 +42,8 @@ export const generateHelpMenu = () => {
helpMenu += `\n`;
}
});

if (!ASSIGN_COMMAND_ENABLED) helpMenu += "```\n***_To assign yourself to an issue, please open a draft pull request that is linked to it._***";
if (!ASSIGN_COMMAND_ENABLED) {
helpMenu += "\n***_To assign yourself to an issue, please open a draft pull request that is linked to it._***";
}
return helpMenu;
};
14 changes: 5 additions & 9 deletions src/handlers/comment/handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,16 @@ const commandCallback = async (issue_number: number, comment: string, action: st
};

export const userCommands = (): UserCommands[] => {
const config = getBotConfig();

return [
{
id: IssueCommentCommands.START,
description: "Assign the origin sender to the issue automatically.",
description: "Assign yourself to the issue.",
handler: assign,
callback: commandCallback,
},
{
id: IssueCommentCommands.STOP,
description: "Unassign the origin sender from the issue automatically.",
description: "Unassign yourself from the issue.",
handler: unassign,
callback: commandCallback,
},
Expand Down Expand Up @@ -253,21 +251,19 @@ export const userCommands = (): UserCommands[] => {
},
{
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'"`,
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"'`,
handler: multiplier,
callback: commandCallback,
},
{
id: IssueCommentCommands.ALLOW,
description: `Set access control. (Admin Only)`,
description: `Set access control. Superuser only.`,
handler: setAccess,
callback: commandCallback,
},
{
id: IssueCommentCommands.WALLET,
description: config.wallet.registerWalletWithVerification
? `<WALLET_ADDRESS | ENS_NAME> <SIGNATURE_HASH>: Register the hunter's wallet address. \n Your message to sign is: DevPool\n You can generate SIGNATURE_HASH at https://etherscan.io/verifiedSignatures\n ex1: /wallet 0x0000000000000000000000000000000000000000 0xe2a3e34a63f3def2c29605de82225b79e1398190b542be917ef88a8e93ff9dc91bdc3ef9b12ed711550f6d2cbbb50671aa3f14a665b709ec391f3e603d0899a41b\n ex2: /wallet vitalik.eth 0x75329f883590507e581cd6dfca62680b6cd12e1f1665db8097f9e642ed70025146b5cf9f777dde90c4a9cbd41500a6bf76bc394fd0b0cae2aab09f7a6f30e3b31b\n`
: `<WALLET_ADDRESS | ENS_NAME>: Register the hunter's wallet address. \n ex1: /wallet 0x0000000000000000000000000000000000000000\n ex2: /wallet vitalik.eth\n`,
description: `<WALLET_ADDRESS | ENS_NAME> <SIGNATURE_HASH>: Register your wallet address for payments.\n\tYour message to sign is: "DevPool"\n\tYou can generate SIGNATURE_HASH at https://etherscan.io/verifiedSignatures\n\te.g. "/wallet 0x16ce4d863eD687455137576da2A0cbaf4f1E8f76 0xe2a3e34a63f3def2c29605de82225b79e1398190b542be917ef88a8e93ff9dc91bdc3ef9b12ed711550f6d2cbbb50671aa3f14a665b709ec391f3e603d0899a41b"`,
handler: registerWallet,
callback: commandCallback,
},
Expand Down
Loading
Loading