Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge development into main #97

Merged
merged 41 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6c1a13e
feat: sdk and command interface
whilefoo Nov 16, 2024
1a32260
feat: upgrade typebox
whilefoo Nov 20, 2024
5f81ebf
fix: switch back to CJS
whilefoo Nov 20, 2024
aaf9c59
feat: manifest commands object
whilefoo Nov 20, 2024
b3405d7
refactor: reorder imports and optimize async operations
gentlementlegen Nov 22, 2024
5c2ec98
chore: updated generated configuration
ubiquity-os[bot] Nov 22, 2024
e26a4f6
chore: changed conditions for testing
gentlementlegen Nov 24, 2024
410a76c
chore: changed entry file
gentlementlegen Nov 24, 2024
fa5a60e
chore: changed version
gentlementlegen Nov 24, 2024
46ce5a6
chore: updated manifest.json and dist build
github-actions[bot] Nov 24, 2024
8c7e8f3
chore: upgrade octokit
whilefoo Nov 24, 2024
d725423
chore: changed http test and logs
gentlementlegen Nov 25, 2024
f84b7e5
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
bd0aab6
chore: changed user id for test
gentlementlegen Nov 25, 2024
e5259f1
fix: logic to retrieve pull-requests pending for a user updated
gentlementlegen Nov 25, 2024
cfb54db
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
8fd3029
chore: split function for readability
gentlementlegen Nov 25, 2024
e3ed8f6
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
7deffaf
fix: yarn v1
whilefoo Nov 25, 2024
7b19d2c
Merge pull request #86 from ubiquity-whilefoo/command-interface
gentlementlegen Nov 25, 2024
a787355
chore: updated generated configuration
ubiquity-os[bot] Nov 25, 2024
44fd708
Merge branch 'development' into fix/task-limit
gentlementlegen Nov 25, 2024
ac15c98
chore: updated manifest.json and dist build
github-actions[bot] Nov 25, 2024
d74a9f2
chore: update hono to version 4.6.12
gentlementlegen Nov 25, 2024
6241af7
feat: switch to Bun and fix deploy
whilefoo Nov 25, 2024
9155361
fix: ignore eslint config
whilefoo Nov 25, 2024
2ba5e14
fix: ignore dist
whilefoo Nov 25, 2024
bb9e06e
chore: remove node
whilefoo Nov 26, 2024
688dfbb
Merge pull request #93 from ubiquity-whilefoo/deploy-fix
gentlementlegen Nov 26, 2024
29c2aef
fix: ncc build
whilefoo Nov 26, 2024
dc54e30
chore: updated manifest.json and dist build
github-actions[bot] Nov 26, 2024
dee590e
Merge pull request #95 from ubiquity-whilefoo/deploy-fix
gentlementlegen Nov 26, 2024
2d6199a
chore: updated manifest.json and dist build
github-actions[bot] Nov 26, 2024
37e2e55
Merge branch 'development' into fix/task-limit
gentlementlegen Nov 26, 2024
f81051c
chore: updated lock file
gentlementlegen Nov 26, 2024
21d9f55
chore: fixed pull request length check
gentlementlegen Nov 26, 2024
c3540aa
chore: changed logic for opened PRs
gentlementlegen Nov 26, 2024
adca88b
chore: simplified logic for opened PRs
gentlementlegen Nov 26, 2024
45a0726
Merge pull request #91 from gentlementlegen/fix/task-limit
0x4007 Nov 27, 2024
bc695de
chore: fixed plugin entry path
gentlementlegen Nov 27, 2024
ab45541
chore: updated manifest.json and dist build
github-actions[bot] Nov 27, 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
12 changes: 11 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts"],
"ignorePaths": [
"**/*.json",
"**/*.css",
"bun.lockb",
"tests/http/**",
"node_modules",
"**/*.log",
"./src/adapters/supabase/**/**.ts",
"dist/**",
"coverage/**"
],
"useGitignore": true,
"language": "en",
"words": [
Expand Down
2 changes: 1 addition & 1 deletion .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config: KnipConfig = {
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**", "src/worker.ts"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "ts-node", "@octokit/rest"],
eslint: true,
};

Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/cspell.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/formatting-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Formatting Check

on:
push:

jobs:
format-check:
name: Check for formatting errors
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install toolchain
run: bun install --frozen-lockfile

- name: Eslint
run: bun run eslint --fix-dry-run

- name: Cspell
run: bun run format:cspell

- name: Prettier
run: bun run prettier --check .
9 changes: 6 additions & 3 deletions .github/workflows/jest-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ jobs:
with:
fetch-depth: 0

- name: Enable corepack
run: corepack enable
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install toolchain
run: bun install --frozen-lockfile

- name: Jest With Coverage
run: yarn install && yarn test
run: bun run test

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

- name: Enable corepack
run: corepack enable
- name: Setup Bun
uses: oven-sh/setup-bun@v2

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

- name: Store PR number
run: echo ${{ github.event.number }} > pr-number.txt

- name: Run Knip
run: yarn knip || yarn knip --reporter json > knip-results.json
run: bun run knip || bun run knip --reporter json > knip-results.json

- name: Upload knip result
if: failure()
Expand Down
56 changes: 8 additions & 48 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,21 @@
name: "Update Configuration"
name: Update Manifest and Commit Changes

on:
workflow_dispatch:
push:

jobs:
update:
name: "Update Configuration in manifest.json"
update-manifest:
name: "Update Manifest and Commit Changes"
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Enable corepack
run: corepack enable

- name: Install deps and run configuration update
run: |
yarn install
yarn tsc --noCheck --project tsconfig.json

- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
- name: Update Manifest and Commit Changes
uses: ubiquity-os/action-deploy-plugin@main
with:
script: |
const fs = require('fs');
const path = require('path');

const { pluginSettingsSchema } = require('./src/types/plugin-input');

const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));

const configuration = JSON.stringify(pluginSettingsSchema);

manifest["configuration"] = JSON.parse(configuration);

const updatedManifest = JSON.stringify(manifest, null, 2);
console.log('Updated manifest:', updatedManifest);
fs.writeFileSync(manifestPath, updatedManifest);

- name: Commit and Push generated types
run: |
git config --global user.name 'ubiquity-os[bot]'
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
treatAsEsm: false
sourcemap: false
pluginEntry: ${{ github.workspace }}/src/index.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:

- uses: actions/checkout@v4

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

- name: Update wrangler.toml Name Field
run: |
branch_name=$(echo '${{ github.event.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
Expand All @@ -32,21 +35,24 @@ jobs:
# Update the wrangler.toml file
sed -i "s/^name = .*/name = \"$new_name\"/" wrangler.toml
echo "Updated wrangler.toml name to: $new_name"

- name: Deploy with Wrangler
id: wrangler_deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "3.79.0"
wranglerVersion: "3.87.0"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
SUPABASE_URL
SUPABASE_KEY
BOT_USER_ID
${{ secrets.KERNEL_PUBLIC_KEY && secrets.KERNEL_PUBLIC_KEY != '' && 'KERNEL_PUBLIC_KEY' || '' }}
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
BOT_USER_ID: ${{ secrets.BOT_USER_ID }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}

- name: Write Deployment URL to Summary
run: |
Expand Down
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
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
coverage/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ To stop a task, a hunter should use the `/stop` command. This will unassign them

#### Note: The command name is `"start"` when configuring your `.ubiquity-os.config.yml` file.

To configure your Ubiquibot to run this plugin, add the following to the `.ubiquity-os.config.yml` file in your organization configuration repository.
To configure your Ubiquity Kernel to run this plugin, add the following to the `.ubiquity-os.config.yml` file in your organization configuration repository.

```yml
- plugin: http://localhost:4000 # or the URL where the plugin is hosted
Expand Down
Binary file added bun.lockb
Binary file not shown.
3 changes: 3 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default tsEslint.config({
"@typescript-eslint": tsEslint.plugin,
"check-file": checkFile,
},
ignores: [".github/knip.ts", ".github/cspell.ts", ".wrangler/**/*.ts", ".wrangler/**/*.js"],
ignores: [".github/knip.ts", ".github/cspell.ts", ".wrangler/**/*.ts", ".wrangler/**/*.js", "dist/**", "eslint.config.mjs"],
extends: [eslint.configs.recommended, ...tsEslint.configs.recommended, sonarjs.configs.recommended],
languageOptions: {
parser: tsEslint.parser,
Expand Down
10 changes: 0 additions & 10 deletions jest.config.json

This file was deleted.

27 changes: 27 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type { Config } from "jest";

const cfg: Config = {
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
useESM: true,
},
],
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
coveragePathIgnorePatterns: ["node_modules", "mocks"],
collectCoverage: true,
coverageReporters: ["json", "lcov", "text", "clover", "json-summary"],
reporters: ["default", "jest-junit", "jest-md-dashboard"],
coverageDirectory: "coverage",
testTimeout: 20000,
roots: ["<rootDir>", "tests"],
extensionsToTreatAsEsm: [".ts"],
moduleNameMapper: {
"^(\\.{1,2}/.*)\\.js$": "$1",
},
setupFilesAfterEnv: ["dotenv/config"],
};

export default cfg;
Loading