diff --git a/.github/workflows/jest-testing.yml b/.github/workflows/jest-testing.yml index 6a0e98e..cfb71e2 100644 --- a/.github/workflows/jest-testing.yml +++ b/.github/workflows/jest-testing.yml @@ -17,10 +17,11 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} SUPABASE_URL: ${{ secrets.SUPABASE_URL }} SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} - X25519_PRIVATE_KEY: ${{ secrets.X25519_PRIVATE_KEY }} + # Dummy values, not production ones! + X25519_PRIVATE_KEY: "wrQ9wTI1bwdAHbxk2dfsvoK1yRwDc0CEenmMXFvGYgY" + EVM_PRIVATE_ENCRYPTED: "kmpTKq5Wh9r9x5j3U9GqZr3NYnjK2g0HtbzeUBOuLC2y3x8ja_SKBNlB2AZ6LigXHP_HeMitftVUtzmoj8CFfVP9SqjWoL6IPku1hVTWkdTn97g1IxzmjydFxjdcf0wuDW1hvVtoq3Uw5yALABqxcQ" NFT_MINTER_PRIVATE_KEY: ${{ secrets.NFT_MINTER_PRIVATE_KEY }} NFT_CONTRACT_ADDRESS: ${{ secrets.NFT_CONTRACT_ADDRESS }} - EVM_PRIVATE_ENCRYPTED: ${{ secrets.EVM_PRIVATE_ENCRYPTED }} steps: - name: Checkout code diff --git a/src/parser/permit-generation-module.ts b/src/parser/permit-generation-module.ts index ad54628..7ab350e 100644 --- a/src/parser/permit-generation-module.ts +++ b/src/parser/permit-generation-module.ts @@ -7,6 +7,7 @@ import { Database, encodePermits, generatePayoutPermit, + Permit, SupportedEvents, TokenType, } from "@ubiquibot/permit-generation/core"; @@ -17,6 +18,7 @@ import { } from "../configuration/permit-generation-configuration"; import { getOctokitInstance } from "../get-authentication-token"; import { IssueActivity } from "../issue-activity"; +import { getRepo, parseGitHubUrl } from "../start"; import envConfigSchema, { EnvConfigType } from "../types/env-type"; import program from "./command-line"; import { Module, Result } from "./processor"; @@ -39,7 +41,7 @@ export class PermitGenerationModule implements Module { evmPrivateEncrypted: configuration.evmPrivateEncrypted, evmNetworkId: configuration.evmNetworkId, }; - const issueId = Number(payload.issueUrl.match(/[0-9]+$/)?.[1]); + const issueId = Number(payload.issueUrl.match(/[0-9]+$/)?.[0]); payload.issue = { id: issueId, }; @@ -100,6 +102,7 @@ export class PermitGenerationModule implements Module { config.permitRequests ); result[key].permitUrl = `https://pay.ubq.fi?claim=${encodePermits(permits)}`; + await this._savePermitsToDatabase(result[key].userId, { issueUrl: payload.issueUrl, issueId }, permits); } catch (e) { console.error(e); } @@ -107,6 +110,69 @@ export class PermitGenerationModule implements Module { return result; } + async _getOrCreateIssueLocation(issue: { issueId: number; issueUrl: string }) { + let locationId: number | null = null; + + const { data: locationData } = await this._supabase + .from("locations") + .select("id") + .eq("issue_id", issue.issueId) + .eq("node_url", issue.issueUrl) + .single(); + + if (!locationData) { + const issueItem = await getRepo(parseGitHubUrl(issue.issueUrl)); + const { data: newLocationData, error } = await this._supabase + .from("locations") + .insert({ + node_url: issue.issueUrl, + issue_id: issue.issueId, + node_type: "Issue", + repository_id: issueItem.id, + }) + .select("id") + .single(); + if (!newLocationData || error) { + console.error("Failed to create a new location", error); + } else { + locationId = newLocationData.id; + } + } else { + locationId = locationData.id; + } + if (!locationId) { + throw new Error(`Failed to retrieve the related location from issue ${issue}`); + } + return locationId; + } + + async _savePermitsToDatabase(userId: number, issue: { issueId: number; issueUrl: string }, permits: Permit[]) { + for (const permit of permits) { + try { + const { data: userData } = await this._supabase.from("users").select("id").eq("id", userId).single(); + const locationId = await this._getOrCreateIssueLocation(issue); + + if (userData) { + const { error } = await this._supabase.from("permits").insert({ + amount: permit.amount.toString(), + nonce: permit.nonce, + deadline: permit.deadline, + signature: permit.signature, + beneficiary_id: userData.id, + location_id: locationId, + }); + if (error) { + console.error("Failed to insert a new permit", error); + } + } else { + console.error(`Failed to save the permit: could not find user ${userId}`); + } + } catch (e) { + console.error("Failed to save permits to the database", e); + } + } + } + get enabled(): boolean { if (!Value.Check(permitGenerationConfigurationType, this._configuration)) { console.warn("Invalid configuration detected for PermitGenerationModule, disabling."); diff --git a/src/start.ts b/src/start.ts index 1cff40b..be5b6b9 100644 --- a/src/start.ts +++ b/src/start.ts @@ -6,6 +6,7 @@ import { GitHubPullRequest, GitHubPullRequestReviewComment, GitHubPullRequestReviewState, + GitHubRepository, GitHubTimelineEvent, GitHubUser, } from "./github-types"; @@ -57,6 +58,11 @@ import { export type IssueParams = ReturnType; export type PullParams = { owner: string; repo: string; pull_number: number }; +export async function getRepo(params: IssueParams): Promise { + const octokit = getOctokitInstance(); + return (await octokit.repos.get(params)).data; +} + export async function getIssue(params: IssueParams): Promise { const octokit = getOctokitInstance(); return (await octokit.issues.get(params)).data; diff --git a/tests/__mocks__/db-seed.json b/tests/__mocks__/db-seed.json index fe184aa..b80378a 100644 --- a/tests/__mocks__/db-seed.json +++ b/tests/__mocks__/db-seed.json @@ -119,5 +119,14 @@ "userId": 88761781, "address": "0x4D0704f400D57Ba93eEa88765C3FcDBD826dCFc4" } + ], + "locations": [ + { + "id": 1, + "issue_id": 22, + "node_url": "https://github.com/ubiquibot/comment-incentives/issues/22", + "node_type": "Issue", + "repository_id": 1 + } ] } diff --git a/tests/__mocks__/db.ts b/tests/__mocks__/db.ts index 2517c5d..5faa4b5 100644 --- a/tests/__mocks__/db.ts +++ b/tests/__mocks__/db.ts @@ -14,4 +14,20 @@ export const db = factory({ userId: Number, address: String, }, + locations: { + id: primaryKey(Number), + issue_id: Number, + node_url: String, + node_type: String, + repository_id: Number, + }, + permits: { + id: primaryKey(Number), + amount: String, + nonce: String, + deadline: String, + signature: String, + beneficiary_id: Number, + location_id: Number, + }, }); diff --git a/tests/__mocks__/handlers.ts b/tests/__mocks__/handlers.ts index 524acff..6ecd525 100644 --- a/tests/__mocks__/handlers.ts +++ b/tests/__mocks__/handlers.ts @@ -17,6 +17,9 @@ export const handlers = [ http.get("https://api.github.com/repos/ubiquibot/comment-incentives/issues/22", () => { return HttpResponse.json(issueGet); }), + http.get("https://api.github.com/repos/ubiquibot/comment-incentives", () => { + return HttpResponse.json(issueGet); + }), http.get("https://api.github.com/repos/ubiquibot/comment-incentives/issues/22/events", ({ params: { page } }) => { return HttpResponse.json(!page ? issueEventsGet : issueEvents2Get); }), @@ -54,4 +57,61 @@ export const handlers = [ http.post("https://api.github.com/app/installations/48381972/access_tokens", () => { return HttpResponse.json({}); }), + http.get("https://wfzpewmlyiozupulbuur.supabase.co/rest/v1/users", ({ request }) => { + const url = new URL(request.url); + const id = url.searchParams.get("id"); + const userId = Number((id as string).match(/\d+/)?.[0]); + const user = db.users.findFirst({ + where: { + id: { + equals: userId, + }, + }, + }); + if (!user) { + return HttpResponse.json("User not found", { status: 404 }); + } + return HttpResponse.json(user); + }), + http.get("https://wfzpewmlyiozupulbuur.supabase.co/rest/v1/locations", ({ request }) => { + const url = new URL(request.url); + const issue = url.searchParams.get("issue_id"); + const node = url.searchParams.get("node_url"); + if (!issue) { + return HttpResponse.json(db.locations.findMany({})); + } + const issueId = Number((issue as string).match(/\d+/)?.[0]); + const nodeUrl = (node as string).match(/https.+/)?.[0]; + const location = db.locations.findFirst({ + where: { + node_url: { + equals: nodeUrl, + }, + issue_id: { + equals: issueId, + }, + }, + }); + if (!location) { + return HttpResponse.json("Location not found", { status: 404 }); + } + return HttpResponse.json(location); + }), + http.post("https://wfzpewmlyiozupulbuur.supabase.co/rest/v1/locations", async ({ request }) => { + const data = await request.json(); + if (!data) { + return HttpResponse.error(); + } + const createdLocation = db.locations.create(data as Record); + return HttpResponse.json(createdLocation); + }), + http.post("https://wfzpewmlyiozupulbuur.supabase.co/rest/v1/permits", async ({ request }) => { + const data = (await request.json()) as Record; + if (!data) { + return HttpResponse.error(); + } + data.id = db.permits.count() + 1; + const createdPermit = db.permits.create(data); + return HttpResponse.json(createdPermit); + }), ]; diff --git a/tests/__mocks__/results/github-comment-results.json b/tests/__mocks__/results/github-comment-results.json index 953dfe9..f85219a 100644 --- a/tests/__mocks__/results/github-comment-results.json +++ b/tests/__mocks__/results/github-comment-results.json @@ -160,11 +160,11 @@ } } ], - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIxNzgwMDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiNTU5OTM2MDE0NzcwMzQzMTA4MTU5NDY5ODEzMzcwNTA1MDMxMzkxMzU2MjIzMDMwNTA5MjQyNzA2ODYyOTY3NzAwMDEzODA2OTM3ODEiLCJkZWFkbGluZSI6IjU3ODk2MDQ0NjE4NjU4MDk3NzExNzg1NDkyNTA0MzQzOTUzOTI2NjM0OTkyMzMyODIwMjgyMDE5NzI4NzkyMDAzOTU2NTY0ODE5OTY3In0sInRyYW5zZmVyRGV0YWlscyI6eyJ0byI6IjB4NEQwNzA0ZjQwMEQ1N0JhOTNlRWE4ODc2NUMzRmNEQkQ4MjZkQ0ZjNCIsInJlcXVlc3RlZEFtb3VudCI6IjE3ODAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweGQ5NTMwRjNmYkJFYTExYmVEMDFEQzA5RTc5MzE4ZjJmMjAyMjM3MTYiLCJzaWduYXR1cmUiOiIweDU0OWJjYmNmYmM2NGM3YjQ5ZDUyYTE3MTQwNmE5MTA4YmY2ZTI0MThhZjcyZTNkNDM4Yzg0ZTdmZmQxZTQ2NGM1NWVjYTI4ZGM4YzdjNDQwZTg4N2MzNDRiN2MwMzFjMGVlM2QyNmY5ZjYwNDJmMTkxMTAwMzU5ODE2ZWZlNDRiMWIiLCJuZXR3b3JrSWQiOjEwMH1d", - "evaluationCommentHtml": "

[ 1.78 WXDAI ]

@molecula451
Contributions Overview
View Contribution Count Reward
Issue Comment 6 1.4
Review Comment 2 0.38
Conversation Incentives
Comment Formatting Relevance Reward
pavlovcik i think we need to update a bit the readme ![image_202…
0.375
p:
  count: 15
  score: 1
img:
  count: 1
  score: 0
0.8 0.3
let us know when done
0.125
p:
  count: 5
  score: 1
0.8 0.1
https://github.com/ubiquibot/comment-incentives/actions/runs/793…
0.175
p:
  count: 7
  score: 1
0.8 0.14
@pavlovcik permitted with hard debug (tho no funds in the privat…
0.3
p:
  count: 12
  score: 1
0.8 0.24
pavlovcik i re-generated the X25519 to trigger the permit, what …
0.725
p:
  count: 29
  score: 1
0.8 0.58
sure thing
0.05
p:
  count: 2
  score: 1
0.8 0.04
indeed
0.025
p:
  count: 1
  score: 1
0.8 0.02
go to go pavlovick, we'll be using this one for test only or tes…
0.45
p:
  count: 18
  score: 1
0.8 0.36
" + "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIxNzgwMDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiNTI3ODUzNTAyNjczOTk4MzczNzk3NzMyNTIzMjczMjE4NDgwMzIwMjAyMzk4MjQ4NjYyMDQ3Mjc0NTUzMTcwMTIzMDk3NjYwMDQ2OTciLCJkZWFkbGluZSI6IjU3ODk2MDQ0NjE4NjU4MDk3NzExNzg1NDkyNTA0MzQzOTUzOTI2NjM0OTkyMzMyODIwMjgyMDE5NzI4NzkyMDAzOTU2NTY0ODE5OTY3In0sInRyYW5zZmVyRGV0YWlscyI6eyJ0byI6IjB4NEQwNzA0ZjQwMEQ1N0JhOTNlRWE4ODc2NUMzRmNEQkQ4MjZkQ0ZjNCIsInJlcXVlc3RlZEFtb3VudCI6IjE3ODAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweGQ5NTMwRjNmYkJFYTExYmVEMDFEQzA5RTc5MzE4ZjJmMjAyMjM3MTYiLCJzaWduYXR1cmUiOiIweDdhZDcwMjVmYmU1OGI1MjkwOTE1YzUxMGYxZGUzZDllNzQ0MjIwNzY0NmU1NWIzNGU5NjUxNTg5MTg0OTQzMzEzNzE4NDNjMmYwNzZjYTRkNjA3YzdjNzJmZjQyY2QwOThmZDI0NjYxYzFmZjJlMmJiMjVmNjg4MzdlMzMwZWM0MWMiLCJuZXR3b3JrSWQiOjEwMH1d", + "evaluationCommentHtml": "

[ 1.78 WXDAI ]

@molecula451
Contributions Overview
View Contribution Count Reward
Issue Comment 6 1.4
Review Comment 2 0.38
Conversation Incentives
Comment Formatting Relevance Reward
pavlovcik i think we need to update a bit the readme ![image_202…
0.375
p:
  count: 15
  score: 1
img:
  count: 1
  score: 0
0.8 0.3
let us know when done
0.125
p:
  count: 5
  score: 1
0.8 0.1
https://github.com/ubiquibot/comment-incentives/actions/runs/793…
0.175
p:
  count: 7
  score: 1
0.8 0.14
@pavlovcik permitted with hard debug (tho no funds in the privat…
0.3
p:
  count: 12
  score: 1
0.8 0.24
pavlovcik i re-generated the X25519 to trigger the permit, what …
0.725
p:
  count: 29
  score: 1
0.8 0.58
sure thing
0.05
p:
  count: 2
  score: 1
0.8 0.04
indeed
0.025
p:
  count: 1
  score: 1
0.8 0.02
go to go pavlovick, we'll be using this one for test only or tes…
0.45
p:
  count: 18
  score: 1
0.8 0.36
" }, "0x4007": { - "total": 33.44, + "total": 60.24, "userId": 4975670, "comments": [ { @@ -349,10 +349,37 @@ "reward": 0.96, "relevance": 0.8 } + }, + { + "content": "I am quoting some code!

[ 0.28 WXDAI ]

@gentlementlegen
Contributions Overview
View Contribution Count Reward
Issue Specification 1 0.1
Issue Comment 7 0.18
Conversation Incentives
Comment Formatting Relevance Reward
issue 2
0.2
p:   count: 2   score: 1 
0.5 0.1
test
0.2
p:   count: 1   score: 1 
- -
```hey```
0.4
p:   count: 1   score: 1 code:   count: 1   score: 1 
- -
``` heyo ```
0.4
p:   count: 1   score: 1 code:   count: 1   score: 1 
- -
gr
0.2
p:   count: 1   score: 1 
- -
te
0.2
p:   count: 1   score: 1 
- -
fwe
0.2
p:   count: 1   score: 1 
- -
te
0.2
p:   count: 1   score: 1 
0.9 0.18
[😂](https://emojipedia.org/face-with-tears-of-joy) - elem 1 - elem 2", + "url": "https://github.com/ubiquibot/comment-incentives/pull/25#issuecomment-1949196678", + "type": "REVIEW|COLLABORATOR|COMMENTED", + "score": { + "formatting": { + "content": { + "p": { + "count": 332, + "score": 1 + }, + "code": { + "count": 2, + "score": 1 + }, + "a": { + "count": 1, + "score": 1 + } + }, + "wordValue": 0.1, + "formattingMultiplier": 1 + }, + "reward": 26.8, + "relevance": 0.8 + } } ], - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIzMzQ0MDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjU0MTU2NjczMjEwMTg2MDc2NjY3MDM0MzA4MDMwMzQxMTU2NjMyMTc1NDA0MTE1ODg4NzA3NjM5NTc1ODU0Mzg0MzM3NTUwNzUyMjU2IiwiZGVhZGxpbmUiOiI1Nzg5NjA0NDYxODY1ODA5NzcxMTc4NTQ5MjUwNDM0Mzk1MzkyNjYzNDk5MjMzMjgyMDI4MjAxOTcyODc5MjAwMzk1NjU2NDgxOTk2NyJ9LCJ0cmFuc2ZlckRldGFpbHMiOnsidG8iOiIweDREMDcwNGY0MDBENTdCYTkzZUVhODg3NjVDM0ZjREJEODI2ZENGYzQiLCJyZXF1ZXN0ZWRBbW91bnQiOiIzMzQ0MDAwMDAwMDAwMDAwMDAwMCJ9LCJvd25lciI6IjB4ZDk1MzBGM2ZiQkVhMTFiZUQwMURDMDlFNzkzMThmMmYyMDIyMzcxNiIsInNpZ25hdHVyZSI6IjB4M2IyYjE5ZTMyNzE2MjI1NDE3ZmVjNmU0MzFiMGIyZTczZTM5MGYzYWYyZmJjMWEzYmNjNTNjNzgyNzdkMzA0ZTQxZTFmNmE1ZDBjNzEzZTZjYjVlZjY0MGEyZTcwMGJiOGUwMWI4ZTAwNjc4YTMwYTM5MzNmYmRlN2EwMGZkN2MxYyIsIm5ldHdvcmtJZCI6MTAwfV0=", - "evaluationCommentHtml": "

[ 33.44 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Specification 1 4.72
Issue Comment 6 27.2
Review Comment 2 1.52
Conversation Incentives
Comment Formatting Relevance Reward
Can somebody work on generating a new `X25519_PRIVATE_KEY` for t…
5.9
p:
  count: 56
  score: 1
code:
  count: 3
  score: 1
em:
  count: 6
  score: 0
0.8 4.72
Link below for conversation context. It was to me. Anyways you n…
4.2
p:
  count: 21
  score: 1
0.8 3.36
In the repository secrets I think I need to change the key to ma…
3
p:
  count: 15
  score: 1
0.8 2.4
I just changed it to `627H-BcWbcp_O3YmQGIA6MqgxVsFuplFCA9DK3iC7G…
13.6
p:
  count: 67
  score: 1
code:
  count: 1
  score: 1
0.8 10.88
I don't understand what you mean by this
1.6
p:
  count: 8
  score: 1
0.8 1.28
I'll investigate more on my computer later.
1.4
p:
  count: 7
  score: 1
0.8 1.12
Will it be an issue if I revert to the commit and secret that I …
10.2
p:
  count: 51
  score: 1
0.8 8.16
Need to document a private key too
0.7
p:
  count: 7
  score: 1
0.8 0.56
I was editing this right now but was too slow to push.
1.2
p:
  count: 12
  score: 1
0.8 0.96
" + "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiI2MDI0MDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjEzOTgwNzc0NDc2OTc2NzY0NTA0ODk5MjU5NjcyODM3NDI0NzU0ODkxMTY5NDMxMDE4MzYyNTI4MjAzMTI5OTY5NTkwODgyMDgxNjEiLCJkZWFkbGluZSI6IjU3ODk2MDQ0NjE4NjU4MDk3NzExNzg1NDkyNTA0MzQzOTUzOTI2NjM0OTkyMzMyODIwMjgyMDE5NzI4NzkyMDAzOTU2NTY0ODE5OTY3In0sInRyYW5zZmVyRGV0YWlscyI6eyJ0byI6IjB4NEQwNzA0ZjQwMEQ1N0JhOTNlRWE4ODc2NUMzRmNEQkQ4MjZkQ0ZjNCIsInJlcXVlc3RlZEFtb3VudCI6IjYwMjQwMDAwMDAwMDAwMDAwMDAwIn0sIm93bmVyIjoiMHhkOTUzMEYzZmJCRWExMWJlRDAxREMwOUU3OTMxOGYyZjIwMjIzNzE2Iiwic2lnbmF0dXJlIjoiMHgyNDdjOTBmYjljMjRjNWE4YzVlODhkNTk3MDk0NmJmMzBlZWQ5ZTIzMWEwYjliYjE2NjFiNzNhMGIwMzY0MDcyNzRmMDUwNWM3M2NlZWUwZDU4YmM1NWE1NTU3NDVmNzdjNmUxNDMzYzRlNDhkYWIxYjk5NmYyZWMyODg2NzhkZjFiIiwibmV0d29ya0lkIjoxMDB9XQ==", + "evaluationCommentHtml": "

[ 60.24 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Specification 1 4.72
Issue Comment 6 27.2
Review Comment 3 28.32
Conversation Incentives
Comment Formatting Relevance Reward
Can somebody work on generating a new `X25519_PRIVATE_KEY` for t…
5.9
p:
  count: 56
  score: 1
code:
  count: 3
  score: 1
em:
  count: 6
  score: 0
0.8 4.72
Link below for conversation context. It was to me. Anyways you n…
4.2
p:
  count: 21
  score: 1
0.8 3.36
In the repository secrets I think I need to change the key to ma…
3
p:
  count: 15
  score: 1
0.8 2.4
I just changed it to `627H-BcWbcp_O3YmQGIA6MqgxVsFuplFCA9DK3iC7G…
13.6
p:
  count: 67
  score: 1
code:
  count: 1
  score: 1
0.8 10.88
I don't understand what you mean by this
1.6
p:
  count: 8
  score: 1
0.8 1.28
I'll investigate more on my computer later.
1.4
p:
  count: 7
  score: 1
0.8 1.12
Will it be an issue if I revert to the commit and secret that I …
10.2
p:
  count: 51
  score: 1
0.8 8.16
Need to document a private key too
0.7
p:
  count: 7
  score: 1
0.8 0.56
I was editing this right now but was too slow to push.
1.2
p:
  count: 12
  score: 1
0.8 0.96
I am quoting some code! <task-lists sortable=\"\"> <table…
33.5
p:
  count: 332
  score: 1
code:
  count: 2
  score: 1
a:
  count: 1
  score: 1
0.8 26.8
" }, "gitcoindev": { "total": 45.5, @@ -438,7 +465,7 @@ } } ], - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiI0NTUwMDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjI1NTAxODE5OTY2NjA1NzQ1MzA1NTE0MTk4MDg3NTY5MTYyMTg1ODQzNzc2NTY0MDgxNzUwODI4NjE5MzMxNjYyNDIzMjAwMTU3MDk1IiwiZGVhZGxpbmUiOiI1Nzg5NjA0NDYxODY1ODA5NzcxMTc4NTQ5MjUwNDM0Mzk1MzkyNjYzNDk5MjMzMjgyMDI4MjAxOTcyODc5MjAwMzk1NjU2NDgxOTk2NyJ9LCJ0cmFuc2ZlckRldGFpbHMiOnsidG8iOiIweDREMDcwNGY0MDBENTdCYTkzZUVhODg3NjVDM0ZjREJEODI2ZENGYzQiLCJyZXF1ZXN0ZWRBbW91bnQiOiI0NTUwMDAwMDAwMDAwMDAwMDAwMCJ9LCJvd25lciI6IjB4ZDk1MzBGM2ZiQkVhMTFiZUQwMURDMDlFNzkzMThmMmYyMDIyMzcxNiIsInNpZ25hdHVyZSI6IjB4NDNhYmUyZTBlZmU4NTJjMzcyZGI1OWQ3N2JhMGYyZTg0ZDgzMDA0OTk5OGIyY2UwOTU2MTE0ZmY1ZTFhMTliNTc1ZTM2MGFmYWExOGU3MDJiNWE1OGY4MTU0YzBiMTBmY2QxZWNkNGZkZDYyYTM5Y2VjMmIyNTczZThiY2I3NjAxYyIsIm5ldHdvcmtJZCI6MTAwfV0=", - "evaluationCommentHtml": "

[ 45.5 WXDAI ]

@gitcoindev
Contributions Overview
View Contribution Count Reward
Issue Task 1 37.5
Issue Comment 1 0
Review Comment 3 8
Conversation Incentives
Comment Formatting Relevance Reward
@molecula451 I tried to override X25519_PRIVATE_KEY but it did n…
0
p:
  count: 26
  score: 1
0.8 -
The new evmPrivateKeyEncrypted generated for address 0x3a2E44e10…
0
p:
  count: 11
  score: 1
0.8 -
@pavlovcik @molecula451 please check now again, I added to docs.
4
p:
  count: 10
  score: 1
0.8 3.2
No way, full details are available in plain sight, only for test…
6
p:
  count: 15
  score: 1
0.8 4.8
" + "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiI0NTUwMDAwMDAwMDAwMDAwMDAwMCJ9LCJub25jZSI6IjEwODAwNTI0OTcwODY5MDEwODU1NTU2MTA2MzI5OTM1MDQ1MTQwNTQ2NDU1MDc5NDkxNzkwNzI0NjYzNjk1OTk5MTMyMjMxMTU3Nzc2NiIsImRlYWRsaW5lIjoiNTc4OTYwNDQ2MTg2NTgwOTc3MTE3ODU0OTI1MDQzNDM5NTM5MjY2MzQ5OTIzMzI4MjAyODIwMTk3Mjg3OTIwMDM5NTY1NjQ4MTk5NjcifSwidHJhbnNmZXJEZXRhaWxzIjp7InRvIjoiMHg0RDA3MDRmNDAwRDU3QmE5M2VFYTg4NzY1QzNGY0RCRDgyNmRDRmM0IiwicmVxdWVzdGVkQW1vdW50IjoiNDU1MDAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweGQ5NTMwRjNmYkJFYTExYmVEMDFEQzA5RTc5MzE4ZjJmMjAyMjM3MTYiLCJzaWduYXR1cmUiOiIweGRhNTE4NTRhMjkzYmU4MTcxMzAzNTVkMzQ2ZGQwMmJiYzIzNjFlMTRhMjExZTY1N2JlNmVjZjNkNGRhNDcyMzE2Mzg1Mzk0Mjk1ZmQ0N2VlNDUzMGMxNTk4NzA1ODliYTI1OWVlMGI2MmRiNWEyNTZkY2Q0NWNmYTk2MzAxYTE4MWMiLCJuZXR3b3JrSWQiOjEwMH1d", + "evaluationCommentHtml": "

[ 45.5 WXDAI ]

@gitcoindev
Contributions Overview
View Contribution Count Reward
Issue Task 1 37.5
Issue Comment 1 0
Review Comment 3 8
Conversation Incentives
Comment Formatting Relevance Reward
@molecula451 I tried to override X25519_PRIVATE_KEY but it did n…
0
p:
  count: 26
  score: 1
0.8 -
The new evmPrivateKeyEncrypted generated for address 0x3a2E44e10…
0
p:
  count: 11
  score: 1
0.8 -
@pavlovcik @molecula451 please check now again, I added to docs.
4
p:
  count: 10
  score: 1
0.8 3.2
No way, full details are available in plain sight, only for test…
6
p:
  count: 15
  score: 1
0.8 4.8
" } } diff --git a/tests/__mocks__/results/output.html b/tests/__mocks__/results/output.html index 92cabd5..58be4f5 100644 --- a/tests/__mocks__/results/output.html +++ b/tests/__mocks__/results/output.html @@ -1 +1 @@ -

[ 1.78 WXDAI ]

@molecula451
Contributions Overview
View Contribution Count Reward
Issue Comment 6 1.4
Review Comment 2 0.38
Conversation Incentives
Comment Formatting Relevance Reward
pavlovcik i think we need to update a bit the readme ![image_202…
0.375
p:
  count: 15
  score: 1
img:
  count: 1
  score: 0
0.8 0.3
let us know when done
0.125
p:
  count: 5
  score: 1
0.8 0.1
https://github.com/ubiquibot/comment-incentives/actions/runs/793…
0.175
p:
  count: 7
  score: 1
0.8 0.14
@pavlovcik permitted with hard debug (tho no funds in the privat…
0.3
p:
  count: 12
  score: 1
0.8 0.24
pavlovcik i re-generated the X25519 to trigger the permit, what …
0.725
p:
  count: 29
  score: 1
0.8 0.58
sure thing
0.05
p:
  count: 2
  score: 1
0.8 0.04
indeed
0.025
p:
  count: 1
  score: 1
0.8 0.02
go to go pavlovick, we'll be using this one for test only or tes…
0.45
p:
  count: 18
  score: 1
0.8 0.36

[ 33.44 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Specification 1 4.72
Issue Comment 6 27.2
Review Comment 2 1.52
Conversation Incentives
Comment Formatting Relevance Reward
Can somebody work on generating a new `X25519_PRIVATE_KEY` for t…
5.9
p:
  count: 56
  score: 1
code:
  count: 3
  score: 1
em:
  count: 6
  score: 0
0.8 4.72
Link below for conversation context. It was to me. Anyways you n…
4.2
p:
  count: 21
  score: 1
0.8 3.36
In the repository secrets I think I need to change the key to ma…
3
p:
  count: 15
  score: 1
0.8 2.4
I just changed it to `627H-BcWbcp_O3YmQGIA6MqgxVsFuplFCA9DK3iC7G…
13.6
p:
  count: 67
  score: 1
code:
  count: 1
  score: 1
0.8 10.88
I don't understand what you mean by this
1.6
p:
  count: 8
  score: 1
0.8 1.28
I'll investigate more on my computer later.
1.4
p:
  count: 7
  score: 1
0.8 1.12
Will it be an issue if I revert to the commit and secret that I …
10.2
p:
  count: 51
  score: 1
0.8 8.16
Need to document a private key too
0.7
p:
  count: 7
  score: 1
0.8 0.56
I was editing this right now but was too slow to push.
1.2
p:
  count: 12
  score: 1
0.8 0.96

[ 45.5 WXDAI ]

@gitcoindev
Contributions Overview
View Contribution Count Reward
Issue Task 1 37.5
Issue Comment 1 0
Review Comment 3 8
Conversation Incentives
Comment Formatting Relevance Reward
@molecula451 I tried to override X25519_PRIVATE_KEY but it did n…
0
p:
  count: 26
  score: 1
0.8 -
The new evmPrivateKeyEncrypted generated for address 0x3a2E44e10…
0
p:
  count: 11
  score: 1
0.8 -
@pavlovcik @molecula451 please check now again, I added to docs.
4
p:
  count: 10
  score: 1
0.8 3.2
No way, full details are available in plain sight, only for test…
6
p:
  count: 15
  score: 1
0.8 4.8
+

[ 1.78 WXDAI ]

@molecula451
Contributions Overview
View Contribution Count Reward
Issue Comment 6 1.4
Review Comment 2 0.38
Conversation Incentives
Comment Formatting Relevance Reward
pavlovcik i think we need to update a bit the readme ![image_202…
0.375
p:
  count: 15
  score: 1
img:
  count: 1
  score: 0
0.8 0.3
let us know when done
0.125
p:
  count: 5
  score: 1
0.8 0.1
https://github.com/ubiquibot/comment-incentives/actions/runs/793…
0.175
p:
  count: 7
  score: 1
0.8 0.14
@pavlovcik permitted with hard debug (tho no funds in the privat…
0.3
p:
  count: 12
  score: 1
0.8 0.24
pavlovcik i re-generated the X25519 to trigger the permit, what …
0.725
p:
  count: 29
  score: 1
0.8 0.58
sure thing
0.05
p:
  count: 2
  score: 1
0.8 0.04
indeed
0.025
p:
  count: 1
  score: 1
0.8 0.02
go to go pavlovick, we'll be using this one for test only or tes…
0.45
p:
  count: 18
  score: 1
0.8 0.36

[ 60.24 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Specification 1 4.72
Issue Comment 6 27.2
Review Comment 3 28.32
Conversation Incentives
Comment Formatting Relevance Reward
Can somebody work on generating a new `X25519_PRIVATE_KEY` for t…
5.9
p:
  count: 56
  score: 1
code:
  count: 3
  score: 1
em:
  count: 6
  score: 0
0.8 4.72
Link below for conversation context. It was to me. Anyways you n…
4.2
p:
  count: 21
  score: 1
0.8 3.36
In the repository secrets I think I need to change the key to ma…
3
p:
  count: 15
  score: 1
0.8 2.4
I just changed it to `627H-BcWbcp_O3YmQGIA6MqgxVsFuplFCA9DK3iC7G…
13.6
p:
  count: 67
  score: 1
code:
  count: 1
  score: 1
0.8 10.88
I don't understand what you mean by this
1.6
p:
  count: 8
  score: 1
0.8 1.28
I'll investigate more on my computer later.
1.4
p:
  count: 7
  score: 1
0.8 1.12
Will it be an issue if I revert to the commit and secret that I …
10.2
p:
  count: 51
  score: 1
0.8 8.16
Need to document a private key too
0.7
p:
  count: 7
  score: 1
0.8 0.56
I was editing this right now but was too slow to push.
1.2
p:
  count: 12
  score: 1
0.8 0.96
I am quoting some code! <task-lists sortable=""> <table…
33.5
p:
  count: 332
  score: 1
code:
  count: 2
  score: 1
a:
  count: 1
  score: 1
0.8 26.8

[ 45.5 WXDAI ]

@gitcoindev
Contributions Overview
View Contribution Count Reward
Issue Task 1 37.5
Issue Comment 1 0
Review Comment 3 8
Conversation Incentives
Comment Formatting Relevance Reward
@molecula451 I tried to override X25519_PRIVATE_KEY but it did n…
0
p:
  count: 26
  score: 1
0.8 -
The new evmPrivateKeyEncrypted generated for address 0x3a2E44e10…
0
p:
  count: 11
  score: 1
0.8 -
@pavlovcik @molecula451 please check now again, I added to docs.
4
p:
  count: 10
  score: 1
0.8 3.2
No way, full details are available in plain sight, only for test…
6
p:
  count: 15
  score: 1
0.8 4.8
\ No newline at end of file diff --git a/tests/__mocks__/results/permit-generation-results.json b/tests/__mocks__/results/permit-generation-results.json index 2c355b3..16dbfe4 100644 --- a/tests/__mocks__/results/permit-generation-results.json +++ b/tests/__mocks__/results/permit-generation-results.json @@ -160,10 +160,10 @@ } } ], - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyYzIwLXBlcm1pdCIsInBlcm1pdCI6eyJwZXJtaXR0ZWQiOnsidG9rZW4iOiIweGU5MUQxNTNFMGI0MTUxOEEyQ2U4RGQzRDc5NDRGYTg2MzQ2M2E5N2QiLCJhbW91bnQiOiIxNzgwMDAwMDAwMDAwMDAwMDAwIn0sIm5vbmNlIjoiNTU5OTM2MDE0NzcwMzQzMTA4MTU5NDY5ODEzMzcwNTA1MDMxMzkxMzU2MjIzMDMwNTA5MjQyNzA2ODYyOTY3NzAwMDEzODA2OTM3ODEiLCJkZWFkbGluZSI6IjU3ODk2MDQ0NjE4NjU4MDk3NzExNzg1NDkyNTA0MzQzOTUzOTI2NjM0OTkyMzMyODIwMjgyMDE5NzI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3ODAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweGQ5NTMwRjNmYkJFYTExYmVEMDFEQzA5RTc5MzE4ZjJmMjAyMjM3MTYiLCJzaWduYXR1cmUiOiIweDdhZDcwMjVmYmU1OGI1MjkwOTE1YzUxMGYxZGUzZDllNzQ0MjIwNzY0NmU1NWIzNGU5NjUxNTg5MTg0OTQzMzEzNzE4NDNjMmYwNzZjYTRkNjA3YzdjNzJmZjQyY2QwOThmZDI0NjYxYzFmZjJlMmJiMjVmNjg4MzdlMzMwZWM0MWMiLCJuZXR3b3JrSWQiOjEwMH1d" }, "0x4007": { - "total": 33.44, + "total": 60.24, "userId": 4975670, "comments": [ { @@ -348,9 +348,36 @@ "reward": 0.96, "relevance": 0.8 } + }, + { + "content": "I am quoting some code!

[ 0.28 WXDAI ]

@gentlementlegen
Contributions Overview
View Contribution Count Reward
Issue Specification 1 0.1
Issue Comment 7 0.18
Conversation Incentives
Comment Formatting Relevance Reward
issue 2
0.2
p:   count: 2   score: 1 
0.5 0.1
test
0.2
p:   count: 1   score: 1 
- -
```hey```
0.4
p:   count: 1   score: 1 code:   count: 1   score: 1 
- -
``` heyo ```
0.4
p:   count: 1   score: 1 code:   count: 1   score: 1 
- -
gr
0.2
p:   count: 1   score: 1 
- -
te
0.2
p:   count: 1   score: 1 
- -
fwe
0.2
p:   count: 1   score: 1 
- -
te
0.2
p:   count: 1   score: 1 
0.9 0.18
[😂](https://emojipedia.org/face-with-tears-of-joy) - elem 1 - elem 2", + "url": "https://github.com/ubiquibot/comment-incentives/pull/25#issuecomment-1949196678", + "type": "REVIEW|COLLABORATOR|COMMENTED", + "score": { + "formatting": { + "content": { + "p": { + "count": 332, + "score": 1 + }, + "code": { + "count": 2, + "score": 1 + }, + "a": { + "count": 1, + "score": 1 + } + }, + "wordValue": 0.1, + "formattingMultiplier": 1 + }, + "reward": 26.8, + "relevance": 0.8 + } } ], - "permitUrl": "https://pay.ubq.fi?claim=W3sidHlwZSI6ImVyY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ZXRhaWxzIjp7InRvIjoiMHg0RDA3MDRmNDAwRDU3QmE5M2VFYTg4NzY1QzNGY0RCRDgyNmRDRmM0IiwicmVxdWVzdGVkQW1vdW50IjoiNDU1MDAwMDAwMDAwMDAwMDAwMDAifSwib3duZXIiOiIweGQ5NTMwRjNmYkJFYTExYmVEMDFEQzA5RTc5MzE4ZjJmMjAyMjM3MTYiLCJzaWduYXR1cmUiOiIweGRhNTE4NTRhMjkzYmU4MTcxMzAzNTVkMzQ2ZGQwMmJiYzIzNjFlMTRhMjExZTY1N2JlNmVjZjNkNGRhNDcyMzE2Mzg1Mzk0Mjk1ZmQ0N2VlNDUzMGMxNTk4NzA1ODliYTI1OWVlMGI2MmRiNWEyNTZkY2Q0NWNmYTk2MzAxYTE4MWMiLCJuZXR3b3JrSWQiOjEwMH1d" } } diff --git a/tests/process.issue.test.ts b/tests/process.issue.test.ts index 8d26896..5f0e74a 100644 --- a/tests/process.issue.test.ts +++ b/tests/process.issue.test.ts @@ -77,6 +77,32 @@ jest.mock("@ubiquibot/permit-generation/core", () => { }; }); +jest.mock("@supabase/supabase-js", () => { + return { + createClient: jest.fn(() => ({ + from: jest.fn(() => ({ + insert: jest.fn(() => ({})), + select: jest.fn(() => ({ + eq: jest.fn(() => ({ + single: jest.fn(() => ({ + data: { + id: 1, + }, + })), + eq: jest.fn(() => ({ + single: jest.fn(() => ({ + data: { + id: 1, + }, + })), + })), + })), + })), + })), + })), + }; +}); + beforeAll(() => server.listen()); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); @@ -93,6 +119,9 @@ describe("Modules tests", () => { for (const item of dbSeed.wallets) { mockDb.wallets.create(item); } + for (const item of dbSeed.locations) { + mockDb.locations.create(item); + } }); it("Should extract users from comments", async () => {