Skip to content

Commit

Permalink
Merge pull request #189 from ubiquity-os-marketplace/development
Browse files Browse the repository at this point in the history
Merge development into main
  • Loading branch information
gentlementlegen authored Nov 17, 2024
2 parents 6057481 + d9d29aa commit df6a521
Show file tree
Hide file tree
Showing 68 changed files with 3,464 additions and 12,077 deletions.
33 changes: 30 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
# Token used to use when calling GitHub API
GITHUB_TOKEN="<token>"

# Key for OpenAI usage
OPENAI_API_KEY="<api_key>"
# treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1%

# Supabase URL
SUPABASE_URL=""

# Supabase key
SUPABASE_KEY=""

# X25519 private key
X25519_PRIVATE_KEY=""

# NFT minter private key
NFT_MINTER_PRIVATE_KEY=""

# NFT contract address
NFT_CONTRACT_ADDRESS=""

# Treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1%
PERMIT_FEE_RATE=""
# github account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquity-os-treasury"

# GitHub account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquity-os-treasury"
PERMIT_TREASURY_GITHUB_USERNAME=""
# comma separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6"

# Comma-separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6"
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST=""

# Optional kernel public key
KERNEL_PUBLIC_KEY=""

# Logger level, default is INFO
LOG_LEVEL=""
3 changes: 3 additions & 0 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
name: Rewards
runs-on: ubuntu-latest
permissions: write-all
environment: ${{ github.ref == 'refs/heads/main' && 'main' || 'development' }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLUGIN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
X25519_PRIVATE_KEY: ${{ secrets.X25519_PRIVATE_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
Expand All @@ -35,6 +37,7 @@ jobs:
PERMIT_FEE_RATE: ${{ secrets.PERMIT_FEE_RATE }}
PERMIT_TREASURY_GITHUB_USERNAME: ${{ secrets.PERMIT_TREASURY_GITHUB_USERNAME }}
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST: ${{ secrets.PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}

steps:
# Note: the checkout could potentially be avoided by calling the workflow on the repo/branch directly.
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ jobs:
with:
fetch-depth: 0

- uses: oven-sh/setup-bun@v2

- name: Jest With Coverage
run: yarn install --immutable --immutable-cache --check-cache && yarn test
# we install with bun but test with Jest because bun doesn't support network mocking yet
run: bun install && yarn test

- name: Add Jest Report to Summary
if: always()
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ jobs:
with:
node-version: 20.10.0

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: yarn install
run: bun install

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:

steps:
- uses: ubiquity-os/action-deploy-plugin@main
with:
treatAsEsm: true
sourcemap: false
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ static/dist
junit.xml
coverage
test-dashboard.md
*.private.env.json
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
bun commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
bun lint-staged
17 changes: 8 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

## [1.5.1](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/compare/v1.5.0...v1.5.1) (2024-10-12)


### Bug Fixes

* add log message for closed pull requests ([d640681](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/d640681cbcbbf5961e61c4f41eec8b82d963444d))
* add logging for payload truncation ([bf0f4c5](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/bf0f4c5f6aaa8714baf8e4653f36f275f695374f))
* added custom configuration and related tests ([2fc8136](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/2fc8136813c94553cc1631d50b87901831405484))
* downgrade ethers to 5.7.2 and update web3 helper ([c5e8e3c](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/c5e8e3c0877bd21e80d745bdae557d28c74bd7f4))
* enhance error logging for missing multiplier cases ([a8cab80](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/a8cab808e30cd1e156e795de22a63a386c39c591))
* enhance error logging for missing multiplier cases ([72d0d47](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/72d0d4711eec68f7880e95762ccb5a853cf2299a))
* remove redundant console log in run.ts ([7851b75](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/7851b7524822c42b62e1c67dca4a00bcbe9d7f4f))
* upgrade permit generation package ([5300022](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/5300022f2b45d0d1b5c48b2d0db46014a5643bf5))
- add log message for closed pull requests ([d640681](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/d640681cbcbbf5961e61c4f41eec8b82d963444d))
- add logging for payload truncation ([bf0f4c5](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/bf0f4c5f6aaa8714baf8e4653f36f275f695374f))
- added custom configuration and related tests ([2fc8136](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/2fc8136813c94553cc1631d50b87901831405484))
- downgrade ethers to 5.7.2 and update web3 helper ([c5e8e3c](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/c5e8e3c0877bd21e80d745bdae557d28c74bd7f4))
- enhance error logging for missing multiplier cases ([a8cab80](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/a8cab808e30cd1e156e795de22a63a386c39c591))
- enhance error logging for missing multiplier cases ([72d0d47](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/72d0d4711eec68f7880e95762ccb5a853cf2299a))
- remove redundant console log in run.ts ([7851b75](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/7851b7524822c42b62e1c67dca4a00bcbe9d7f4f))
- upgrade permit generation package ([5300022](https://github.com/ubiquity-os-marketplace/text-conversation-rewards/commit/5300022f2b45d0d1b5c48b2d0db46014a5643bf5))

## [1.5.0](https://github.com/ubiquity-os-marketplace/conversation-rewards/compare/v1.4.0...v1.5.0) (2024-09-30)

Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# `@ubiquity-os/text-conversation-rewards`

As of 28 February: test driven development to aggregate all necessary information based on a URL to an issue.

- pass in closed as complete issue URL and receive all the timeline events and activities of all humans who helped close the issue as complete.
- most importantly: this can inherit bot authentication and link pull requests to issues in private repositories.

Be sure to review all `*.test.*` files for implementation details.

## Data structure

```json
Expand Down Expand Up @@ -354,8 +347,8 @@ Partner private key (`evmPrivateEncrypted` config param in `conversation-rewards

Here `GITHUB_OWNER_ID` can be:

1. Github organization id (if ubiquity-os is used within an organization)
2. Github user id (if ubiquity-os is simply installed in a user's repository)
1. GitHub organization id (if ubiquity-os is used within an organization)
2. GitHub user id (if ubiquity-os is simply installed in a user's repository)

Format `PRIVATE_KEY:GITHUB_OWNER_ID` restricts in which particular organization (or user related repositories)
this private key can be used. It can be set either in the organization wide config either in the repository wide one.
Expand Down
Binary file added bun.lockb
Binary file not shown.
8 changes: 3 additions & 5 deletions dist/33.index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exports.id = 33;
exports.ids = [33];
exports.modules = {
export const id = 33;
export const ids = [33];
export const modules = {

/***/ 57666:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
Expand Down Expand Up @@ -28,7 +28,6 @@ module.exports = globalThis.DOMException
/***/ 42033:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
Expand Down Expand Up @@ -147,4 +146,3 @@ async function fileFromPath(path, filenameOrOptions, options) {
/***/ })

};
;
55 changes: 33 additions & 22 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default tsEslint.config({
parserOptions: {
projectService: {
defaultProject: "tsconfig.json",
allowDefaultProject: ["*.mjs"],
allowDefaultProject: ["eslint.config.mjs"],
},
tsconfigRootDir: import.meta.dirname,
},
Expand Down
12 changes: 11 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import type { Config } from "jest";

const cfg: Config = {
transform: {
"^.+\\.tsx?$": "babel-jest",
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
coveragePathIgnorePatterns: ["node_modules", "mocks"],
Expand All @@ -12,6 +17,11 @@ const cfg: Config = {
coverageDirectory: "coverage",
testTimeout: 20000,
roots: ["<rootDir>", "tests"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
setupFilesAfterEnv: ["dotenv/config"],
};

export default cfg;
2 changes: 1 addition & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const config: KnipConfig = {
project: ["src/**/*.ts"],
ignore: ["src/data-collection/examples/*.ts", "src/configuration/common-config-type.ts", "dist/**"],
ignoreExportsUsedInFile: true,
ignoreDependencies: ["ts-node", "msw", "@mswjs/data"],
ignoreDependencies: ["ts-node", "msw", "@mswjs/data", "@octokit/plugin-paginate-graphql"],
jest: {
config: ["jest.config.ts"],
entry: ["src/**/*.test.ts"],
Expand Down
Loading

0 comments on commit df6a521

Please sign in to comment.