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

Start/Stop plugin #1

Merged
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c591a74
chore: remove scaffolding
Keyrxng May 21, 2024
1be6c95
chore: repo root setting
Keyrxng May 21, 2024
1ffc10c
chore: workflow and main
Keyrxng May 21, 2024
eefab92
chore: adapters
Keyrxng May 21, 2024
3cf302d
chore: handlers
Keyrxng May 21, 2024
b653394
chore: types
Keyrxng May 21, 2024
1fe37a2
chore: utils
Keyrxng May 21, 2024
14f0e11
chore: tests
Keyrxng May 21, 2024
cf1a6b6
feat: workerize
Keyrxng May 23, 2024
9054863
chore: improved types
Keyrxng May 23, 2024
c1cec05
chore: test
Keyrxng May 23, 2024
148df8c
chore: tests
Keyrxng May 23, 2024
c553c86
chore: cspell and knip
Keyrxng May 23, 2024
0f1df81
chore: update toml
Keyrxng May 23, 2024
7e5fc99
fix: remove configs
Keyrxng May 23, 2024
c484635
fix: types and package name
Keyrxng May 23, 2024
8b594bb
fix: remove compute. use ubiquibot token
Keyrxng May 23, 2024
bedfb6d
fix: add config defaults
Keyrxng May 23, 2024
b2420da
fix: logs types
Keyrxng May 24, 2024
fd2c198
fix: pretty logs types
Keyrxng May 24, 2024
bfb71f2
fix: readme, log type tweaks, tests passing
Keyrxng May 24, 2024
a971442
chore: remove location resp
Keyrxng May 24, 2024
5f0dc46
chore: add stop as default
Keyrxng May 26, 2024
36458ce
fix: parse labels and correct env
Keyrxng Jun 7, 2024
844b867
fix: readme config
Keyrxng Jun 7, 2024
ff05224
chore: add validator
Keyrxng Jun 7, 2024
4095cd3
fix: optional chain and types
Keyrxng Jun 7, 2024
03075e2
Merge branch 'development' into development
Keyrxng Jun 10, 2024
23e748e
fix: use Octokit types
Keyrxng Jun 11, 2024
0dcd243
fix: target ESNEXT
Keyrxng Jun 11, 2024
941c0fe
chore: remove unused type
Keyrxng Jun 11, 2024
20a7025
chore: uppercase
Keyrxng Jun 11, 2024
6fd8d73
fix: readme and const placement
Keyrxng Jun 11, 2024
926c319
fix: no parsing required
Keyrxng Jun 11, 2024
9bdf4c5
fix: naming convention
Keyrxng Jun 11, 2024
0d41663
fix: remove unused
Keyrxng Jun 13, 2024
0d67eb6
chore: remove multiplier logic
Keyrxng Jun 18, 2024
97d3361
chore: use Logs as logger
Keyrxng Jun 19, 2024
7cac716
chore: revert logger, configurable startRequiresWallet
Keyrxng Jun 22, 2024
89fac97
chore: use prettylogs, comment on false stop
Keyrxng Jun 24, 2024
b166046
fix: removing helpers previously missed
Keyrxng Jun 24, 2024
68476dd
chore(deps): bump yarn to v4
Keyrxng Jun 24, 2024
8e70120
chore(deps): ts to v5.5
Keyrxng Jun 24, 2024
5506954
chore: add accountId to deploy action
Keyrxng Jun 24, 2024
01af205
Update .github/workflows/worker-deploy.yml
Keyrxng Jun 26, 2024
5cf487d
Update README.md
Keyrxng Jun 26, 2024
5651183
chore: tests, fix one add one
Keyrxng Jun 28, 2024
07f0181
chore: refactor checkStaleTask
Keyrxng Jul 3, 2024
eb297c6
chore: readme config
Keyrxng Jul 3, 2024
d8aceb5
chore: use task syntax and non-nulls
Keyrxng Jul 3, 2024
c254df0
chore: use slashCommand syntax
Keyrxng Jul 3, 2024
f8046ed
chore: no test logs, no .fatal
Keyrxng Jul 3, 2024
fd564b7
chore: improve get-linked-prs
Keyrxng Jul 3, 2024
cf6a257
chore: isEnabled > disabledCommands
Keyrxng Jul 3, 2024
e129915
chore: fix tests
Keyrxng Jul 3, 2024
50f57f2
chore: fix test ctx
Keyrxng Jul 3, 2024
b4ea398
chore: cspell script, format
Keyrxng Jul 3, 2024
ecb4d97
chore: remove database.ts
Keyrxng Jul 3, 2024
8161483
chore: unneeded check
Keyrxng Jul 4, 2024
023a3eb
chore: readme fix
Keyrxng Jul 4, 2024
88b5431
chore: use ubiquity-logger
Keyrxng Jul 4, 2024
f7a93ce
chore: corepack, logger, isEnabled default
Keyrxng Jul 11, 2024
c50412b
chore: fix start comment whitespace
Keyrxng Jul 11, 2024
8039369
fix: return check
Keyrxng Jul 11, 2024
6a20875
fix: better formatting for closed pulls
Keyrxng Jul 11, 2024
e4d4bf3
chore: original pull closed comment
Keyrxng Jul 11, 2024
3f44200
Update src/types/context.ts
Keyrxng Jul 12, 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
4 changes: 2 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts"],
"useGitignore": true,
"language": "en",
"words": ["dataurl", "devpool", "outdir", "servedir"],
"words": ["dataurl", "devpool", "outdir", "servedir", "Supabase", "supabase", "SUPABASE", "typebox", "ubiquibot", "signoff", "sonarjs", "mswjs"],
gentlementlegen marked this conversation as resolved.
Show resolved Hide resolved
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
"ignoreRegExpList": ["[0-9a-fA-F]{6}"]
Expand Down
2 changes: 2 additions & 0 deletions .dev.vars.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUPABASE_URL=
SUPABASE_KEY=
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

4 changes: 2 additions & 2 deletions .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { KnipConfig } from "knip";
const config: KnipConfig = {
entry: ["build/index.ts"],
project: ["src/**/*.ts"],
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
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", "@mswjs/data"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@types/jest"],
eslint: true,
};

Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/cypress-testing.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/deploy.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
Keyrxng marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/checkout@v4
- uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "3.57.0"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
secrets: |
rndquu marked this conversation as resolved.
Show resolved Hide resolved
SUPABASE_URL
SUPABASE_KEY
UBIQUIBOT_TOKEN
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
UBIQUIBOT_TOKEN: ${{ secrets.UBIQUIBOT_TOKEN }}
Keyrxng marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ node_modules
.pnp.cjs
.pnp.loader.mjs
.env
.env.dev
.dev.vars
static/dist
coverage
junit.xml
cypress/screenshots
script.ts
.wrangler
62 changes: 42 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
# `@ubiquity/ts-template`
# `@ubiquibot-plugins/start-stop-plugin`

This template repository includes support for the following:
This plugin allows a hunter to begin a task as well as gracefully stop a task without incurring a negative impact on the hunter's XP or karma.

- TypeScript
- Environment Variables
- Conventional Commits
- Automatic deployment to Cloudflare Pages
## Usage

## Testing
### Start a task

### Cypress
To start a task, a hunter should use the `/start` command. This will assign them to the issue so long as the following is true:

To test with Cypress Studio UI, run
- Price labels are set on the issue
- The issue is not already assigned
0x4007 marked this conversation as resolved.
Show resolved Hide resolved
- The hunter has not reached the maximum number of concurrent tasks
- The command is not disabled at the repository or organization level
- TODO: If the hunter meets the required karma and XP requirements
Keyrxng marked this conversation as resolved.
Show resolved Hide resolved

```shell
yarn cy:open
```
### Stop a task

Otherwise to simply run the tests through the console, run
To stop a task, a hunter should use the `/stop` command. This will unassign them from the issue so long as the following is true:

```shell
yarn cy:run
```
- The hunter is assigned to the issue
- The command is not disabled at the repository or organization level
- The command is called on the issue, not the associated pull request

### [Configuration](./src/plugin-config.yml)

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

### Jest
To configure your Ubiquibot to run this plugin, add the following to your [`.ubiquibot-config.yml`](./.github/.ubiquibot-config.yml) file at either the organization or repository level:

To start Jest tests, run
```yml
plugins:
issue_comment.created:
- uses:
- plugin: ubiquibot-plugins/start-stop-plugin:compute.yml@development
name: start-stop
id: start-stop-command
type: github
description: "Allows a user to start/stop a bounty without negative XP impact"
command: "/(start|stop)"
example: "/start | /stop"
with:
disabledCommands: [] # Empty array means no commands are disabled
- start # Disables the start command
timers:
reviewDelayTolerance: 86000
taskStaleTimeoutDuration: 2580000
miscellaneous:
maxConcurrentTasks: 3
labels:
time: []
priority: []

```shell
yarn test
```
33 changes: 0 additions & 33 deletions build/esbuild-build.ts

This file was deleted.

18 changes: 0 additions & 18 deletions build/esbuild-server.ts

This file was deleted.

4 changes: 0 additions & 4 deletions build/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions cypress.config.ts

This file was deleted.

11 changes: 0 additions & 11 deletions cypress/e2e/main.cy.ts

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

37 changes: 0 additions & 37 deletions cypress/support/commands.ts

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/support/e2e.ts

This file was deleted.

Loading