This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Fix/workaround for character limits #21
Merged
+2,543
−236
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1325bca
chore: setup env vars
0x4007 1f8c3cc
chore: set up formatting
0x4007 b94d59b
feat: init local dev testing
0x4007 b8c3b25
fix: test values
0x4007 93a5a37
refactor: async await
0x4007 86e34db
feat(jest): working
0x4007 77ba9b0
fix: if no price label is set then continue calculating comment incen…
0x4007 d2c26d8
fix: run test for one minute
0x4007 683f843
Merge branch 'fix/no-price-labels-no-assignee-rewards' into fix/worka…
0x4007 567419d
fix: successfully runs locally
0x4007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SUPABASE_URL= | ||
SUPABASE_KEY= | ||
OPENAI_API_KEY= | ||
UBIQUIBOT_APP_ID= | ||
UBIQUIBOT_APP_PRIVATE_KEY= | ||
X25519_PRIVATE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist | ||
dist | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
transform: { | ||
'^.+\\.tsx?$': 'babel-jest', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { createClient } from "@supabase/supabase-js"; | ||
import { checkEnvironmentVariables } from "./check-env"; | ||
import { DelegatedComputeInputs, getAuthenticatedOctokit, issueClosedEventHandler } from "./index"; | ||
import { GitHubEvent } from "./types/payload"; | ||
const { SUPABASE_URL, SUPABASE_KEY, openAi } = checkEnvironmentVariables(); | ||
afterEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
const inputs: DelegatedComputeInputs = { | ||
eventName: "issues.closed" as GitHubEvent.ISSUES_CLOSED, | ||
issueOwner: "ubiquibot", | ||
issueRepository: "production", | ||
issueNumber: "84", | ||
collaborators: `["pavlovcik"]`, | ||
installationId: "37627918", // "ubiquibot-dev" app | ||
}; | ||
|
||
jest.mock("@actions/github", () => { | ||
const inputs: DelegatedComputeInputs = { | ||
eventName: "issues.closed" as GitHubEvent.ISSUES_CLOSED, | ||
issueOwner: "ubiquibot", | ||
issueRepository: "production", | ||
issueNumber: "84", | ||
collaborators: `["pavlovcik"]`, | ||
installationId: "37627918", // "ubiquibot-dev" app | ||
}; | ||
|
||
return { | ||
context: { | ||
payload: { | ||
inputs, | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
export async function indexTest() { | ||
const authenticatedOctokit = await getAuthenticatedOctokit(); | ||
const supabaseClient = createClient(SUPABASE_URL, SUPABASE_KEY); | ||
|
||
const output = await issueClosedEventHandler(supabaseClient, openAi, authenticatedOctokit, inputs); | ||
console.log({ output }); | ||
} | ||
|
||
it("runs", () => | ||
indexTest().then(() => { | ||
console.log("done"); | ||
}), 60000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically the real fixes are all in this file.
The rest of the changes are basically just 1. setting up jest to run locally 2. running the formatter