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

fix: remove allow command #66

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7591c53
fix: removed `/allow` command
gentlementlegen Dec 17, 2024
242e7cf
chore: updated manifest.json and dist build
github-actions[bot] Dec 17, 2024
de502f9
chore: removed unused packages and exports
gentlementlegen Dec 17, 2024
c414809
chore: updated manifest.json and dist build
github-actions[bot] Dec 17, 2024
68bdf61
chore: changed posted message on insufficient permissions
gentlementlegen Dec 17, 2024
7e26143
chore: updated manifest.json and dist build
github-actions[bot] Dec 17, 2024
4d5c12c
Merge branch 'development' into fix/remove-allow-command
gentlementlegen Dec 18, 2024
9e9a79f
test: added tests for label set
gentlementlegen Dec 18, 2024
61f6ca8
chore: updated manifest.json and dist build
github-actions[bot] Dec 18, 2024
b55cd10
test: updated README.md
gentlementlegen Dec 18, 2024
a3d1a02
chore: fixed knip
gentlementlegen Dec 18, 2024
2f82908
chore: updated manifest.json and dist build
github-actions[bot] Dec 18, 2024
8832411
chore: removed commands from manifest.json
gentlementlegen Dec 18, 2024
df2d10d
fix!: removed command and Supabase related logic
gentlementlegen Dec 21, 2024
784e494
chore: update lockb file
gentlementlegen Dec 21, 2024
242b20d
chore: updated manifest.json and dist build
github-actions[bot] Dec 21, 2024
a846856
chore: remove supabase from tests
gentlementlegen Dec 21, 2024
e2c8606
chore: update packages
gentlementlegen Dec 21, 2024
055c4ab
chore: fix tests
gentlementlegen Dec 21, 2024
8ec54ff
chore: removed sender username in response to permission issues
gentlementlegen Dec 28, 2024
ed5aaf3
chore: updated manifest.json and dist build
github-actions[bot] Dec 28, 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
2 changes: 0 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"**/*.log",
"**/*.toml",
"**/*.http",
"src/adapters/supabase/types/database.ts",
"bun.lockb",
"dist/**"
],
Expand All @@ -24,7 +23,6 @@
"devpool",
"outdir",
"servedir",
"supabase",
"typebox",
"typeguards",
"mswjs",
Expand Down
2 changes: 0 additions & 2 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SUPABASE_URL=
SUPABASE_KEY=
KERNEL_PUBLIC_KEY=
2 changes: 0 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
SUPABASE_URL=
SUPABASE_KEY=
KERNEL_PUBLIC_KEY=
6 changes: 1 addition & 5 deletions .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["src/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "src/adapters/supabase/types/database.ts"],
ignore: ["src/types/config.ts"],
ignoreExportsUsedInFile: true,
ignoreDependencies: [
"ts-node",
"@types/jest",
"@eslint/js",
"typescript-eslint",
"eslint-plugin-sonarjs",
"eslint-plugin-prettier",
"eslint-plugin-check-file",
"eslint-config-prettier",
"@typescript-eslint/parser",
"@typescript-eslint/eslint-plugin",
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ jobs:
- name: Calling action
uses: ./
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
PLUGIN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KERNEL_PUBLIC_KEY: ${{ secrets.KERNEL_PUBLIC_KEY }}
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
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Example of valid configuration:
publicAccessControl:
setLabel: true
fundExternalClosedIssue: false
protectLabels:
- price
- time
- priority
globalConfigUpdate:
excludeRepos: ["devpool-directory", "devpool-directory-private"]
```
Expand All @@ -55,7 +59,7 @@ supabase start
Start the Worker by running

```shell
yarn worker
bun run worker
```

### Make requests
Expand Down Expand Up @@ -83,5 +87,5 @@ For convenience you can find an `.http` file with a valid request [here](/tests/
To start Jest tests, run

```shell
yarn test
bun run test
```
Binary file modified bun.lockb
Binary file not shown.
12 changes: 6 additions & 6 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default tsEslint.config({
"@typescript-eslint": tsEslint.plugin,
"check-file": checkFile,
},
ignores: [".github/knip.ts", "src/adapters/supabase/types/database.ts", ".wrangler/**", "dist/**", "coverage/**"],
ignores: [".github/knip.ts", ".wrangler/**", "dist/**", "coverage/**"],
extends: [eslint.configs.recommended, ...tsEslint.configs.recommended, sonarjs.configs.recommended],
languageOptions: {
parser: tsEslint.parser,
Expand Down Expand Up @@ -74,6 +74,7 @@ export default tsEslint.config({
"sonarjs/function-return-type": "off",
"sonarjs/no-misleading-array-reverse": "off",
"sonarjs/slow-regex": "off",
"sonarjs/no-nested-template-literals": "off",
gentlementlegen marked this conversation as resolved.
Show resolved Hide resolved
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down
31 changes: 8 additions & 23 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@
"name": "Assistive pricing",
"description": "Handles assistive pricing, and allows for users to modify labels.",
"ubiquity:listeners": ["repository.created", "issues.opened", "issues.labeled", "issues.unlabeled", "label.edited", "issue_comment.created", "push"],
"commands": {
"allow": {
"ubiquity:example": "/allow @user1 label",
"description": "Allows the user to modify the given label type.",
"parameters": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "The user that will be allowed to change the label"
},
"labelTypes": {
"type": "array",
"description": "Array of label types that user will be allowed to change, it can be empty to remove access from all labels",
"items": {
"type": "string",
"enum": ["time", "priority"]
}
}
}
}
}
},
"configuration": {
"default": {},
"type": "object",
Expand Down Expand Up @@ -98,6 +75,14 @@
"fundExternalClosedIssue": {
"default": false,
"type": "boolean"
},
"protectLabels": {
"default": ["priority", "price", "time"],
"uniqueItems": true,
"type": "array",
"items": {
"type": "string"
}
}
}
}
Expand Down
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@
},
"scripts": {
"worker": "wrangler dev --env dev --port 4001",
"start": "tsx src/index.ts",
0x4007 marked this conversation as resolved.
Show resolved Hide resolved
"format": "run-s format:lint format:prettier format:cspell",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
"format:cspell": "cspell **/*",
"knip": "knip --config .github/knip.ts",
"knip-ci": "knip --no-exit-code --reporter json --config .github/knip.ts",
"prepare": "husky install",
"test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --setupFiles dotenv/config --coverage",
"supabase:generate:local": "supabase gen types typescript --local > src/adapters/supabase/types/database.ts",
"supabase:generate:remote": "dotenv -- cross-env-shell supabase gen types typescript --project-id $SUPABASE_PROJECT_ID --schema public > src/adapters/supabase/types/database.ts"
"test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest --setupFiles dotenv/config --coverage"
},
"keywords": [
"typescript",
Expand All @@ -31,13 +28,10 @@
"open-source"
],
"dependencies": {
"@commander-js/extra-typings": "12.0.1",
"@octokit/rest": "^20.1.0",
"@sinclair/typebox": "0.34.3",
"@supabase/supabase-js": "2.43.1",
"@ubiquity-os/plugin-sdk": "^1.1.1",
"@ubiquity-os/ubiquity-os-logger": "^1.3.2",
"commander": "12.0.0",
"decimal.js": "^10.4.3",
"dotenv": "^16.4.5",
"hono": "^4.6.7"
Expand All @@ -57,7 +51,6 @@
"@typescript-eslint/parser": "^8.14.0",
"cross-env": "7.0.3",
"cspell": "^8.4.0",
"dotenv-cli": "7.4.2",
"eslint": "9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-check-file": "^2.8.0",
Expand All @@ -71,17 +64,15 @@
"lint-staged": "^15.2.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.5",
"supabase": "^1.207.9",
"ts-jest": "29.1.2",
"ts-node": "10.9.2",
"tsx": "^4.7.1",
"typescript": "5.6.2",
"typescript-eslint": "^8.14.0",
"wrangler": "^3.87.0"
},
"lint-staged": {
"*.ts": [
"yarn prettier --write",
"prettier --write",
"eslint --fix"
],
"src/**.{ts,json}": [
Expand Down
17 changes: 0 additions & 17 deletions src/adapters/index.ts

This file was deleted.

52 changes: 0 additions & 52 deletions src/adapters/supabase/helpers/tables/access.ts

This file was deleted.

56 changes: 0 additions & 56 deletions src/adapters/supabase/helpers/tables/label.ts

This file was deleted.

13 changes: 0 additions & 13 deletions src/adapters/supabase/helpers/tables/super.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/adapters/supabase/helpers/tables/user.ts

This file was deleted.

Loading