PR Time Tracker automates invoice generation processes and tracks core developer activity related to PRs and issues.
If you want to contribute, please follow Holdex Developer Guidelines.
- Cannot submit time: see docs
- Access the App public page
- Install the App under your organization
- Invite the @pr-time-tracker into your organization and make him an owner
- To customize the included repositories, go to "Settings" -> "GitHub Apps"
- Add a record of your organization info in the Vercel env
APP_INTEGRATIONS_LIST
{ "id": "org_id", "name": "org_slug", "nodeId": "oracle_project_id"}
Where:
id
is the identifier used for defining jobs (can be any string)name
- the GitHub organization slugnodeId
- Holdex Oracle project ID, if no project is defined, use explicit value337c06eb
for HX project column
- Re-deploy the current production build so changes can take effect.
- postinstall: Sets up Husky for Git hooks.
- pre-dev: Executes a script to pull environment variables before starting development.
- dev: Starts the development server on port 3000 after executing the
pre-dev
script. - build: Builds the project.
- preview: Previews the build.
- format: Formats the code using Prettier with plugins for Svelte and Pug.
- lint: Lints the codebase using ESLint with support for JavaScript, TypeScript, Svelte, and CommonJS. check: Syncs Svelte kit and checks the TypeScript configuration.
- type-check: type checks the TypeScript files without emitting any output.
- check:watch: Watches for changes and syncs Svelte kit while checking TypeScript.
- proxy: Sets up ngrok to proxy requests to the development server with a specific domain.
git
https://git-scm.com/downloadsdocker
https://docs.docker.com/nodejs
https://nodejs.org/en/download/package-managerpnpm
https://pnpm.io/installation
-
Clone this repository
-
Make GitHub Access Token for installing some of the hosted dependencies:
-
Create a GitHub Classic Access Token with the necessary permissions https://github.com/settings/tokens.
-
-
Copy
.npmrc.example
to.npmrc
in the root folder and replace theNPM_TOKEN
with your generated GitHub access token. -
Install the dependencies
pnpm install
-
Setup Telebit https://telebit.cloud/
-
Setup your Supabase Project for Trigger.dev v2 based on this guide: https://v2docs.trigger.dev/documentation/guides/self-hosting/supabase (Optional)
You can skip this step if you don't need to run your own supabase for Trigger.dev v2. We provide a shared supabase project for development purpose that you can use.
But for some reason you have a problem when running with the shared supabase project, you can follow this guide to create your own supabase project.
-
You can follow this setup guide https://v2docs.trigger.dev/documentation/guides/self-hosting/supabase#create-a-supabase-db
-
Create your supabase project for trigger.dev
-
Go to the
/container
folder -
Duplicate the
.env.example
to.env
-
In the
.env
file change theDATABASE_URL
andDIRECT_URL
you created in the Supabase DB creation step (don't forget to adjust with your own password).# From this DATABASE_URL=postgresql://postgres.phtaofoaormwpxwrwtkw:[email protected]:6543/postgres?schema=triggerdotdev&pgbouncer=true DIRECT_URL=postgresql://postgres.phtaofoaormwpxwrwtkw:[email protected]:5432/postgres?schema=triggerdotdev # To this (EXAMPLE) DATABASE_URL=postgresql://postgres.arnehavoxpuewazwvpph:[email protected]:6543/postgres?schema=triggerdotdev&pgbouncer=true DIRECT_URL=postgresql://postgres.arnehavoxpuewazwvpph:[email protected]:5432/postgres?schema=triggerdotdev
-
-
Setup Local Trigger.dev v2
-
Start proxy server for
localhost:3030
to Telebitpnpm trigger-dev:proxy
-
Go to the
/container
folder -
Duplicate the
.env.example
to.env
-
In the
.env
file change theLOGIN_ORIGIN
andAPI_ORIGIN
with the forwarding URL from telebit above, e.g:# From this LOGIN_ORIGIN=https://alert-seemingly-moccasin.telebit.io APP_ORIGIN=https://alert-seemingly-moccasin.telebit.io # To this (EXAMPLE) LOGIN_ORIGIN=https://shaggy-termite-71.telebit.io APP_ORIGIN=https://shaggy-termite-71.telebit.io
-
Run
docker compose up
within the container. Make sure you don't have running redis that use port0.0.0.0:6379
. If you fail to run this see Possible issues on the bottom. -
You should be able to access your local Trigger.dev using the forwarding URL from
pnpm trigger-dev:proxy
above e.g: https://shaggy-termite-71.telebit.io/ -
Setup your local account and triggerdotdev project
-
Go to the root path and download the environment variables using
pnpm pre-dev
and you will see a new file.env
on root -
Take note of the Trigger.dev API Keys in Trigger dev UI (Environment & API Keys) and change the
TRIGGER_API_KEY
andTRIGGER_API_URL
in the.env
file, and theendpointId
in yourpackage.json
file.# .env # API Key from triggerdotdev UI TRIGGER_API_KEY="tr_dev_YIHNyqRKaKYt7lJ7hwF2" # URL from telebit forwarding proxy for accessing local triggerdotdev TRIGGER_API_URL="https://shaggy-termite-71.telebit.io" # slug for your created project in triggerdotdev (you can find this in the URL) TRIGGER_PROJECT_ID="pr-time-tracker-lmz0"
// package.json { // ... "trigger.dev": { "endpointId": "pr-time-tracker-lmz0" } }
-
Run local dev of the project
pnpm dev-only
-
Run ngrok proxy for the local dev project using
pnpm proxy
-
In the Trigger dev UI (Environment & API Keys), set a development endpoint with the following URL:
https://alert-seemingly-moccasin.ngrok-free.app/api/trigger
-
After the process is done, you should be able to see a new entry in
Runs
sidebar. Congrats! you have registered your local trigger.dev proxy url to github webhooks 🎉
-
-
Database Connection:
- Use
MongoDB Compass
to connect to the database using theMONGODB_URI
environment variable.
- Use
-
Telebit can't run. You might find this issue when running
pnpm trigger-dev:proxy
. pnpm trigger-dev:proxy > [email protected] trigger-dev:proxy /home/ubuntu/Developer/pr-time-tracker > ~/telebit http 3030 /home/ubuntu/Applications/telebit/bin/telebit-remote.js:643 var verstrd = [ pkg.name + ' daemon v' + state.config.version ]; ^ TypeError: Cannot read property 'version' of undefined at handleConfig (/home/ubuntu/Applications/telebit/bin/telebit-remote.js:643:57) at /home/ubuntu/Applications/telebit/bin/telebit-remote.js:359:22 at /home/ubuntu/Applications/telebit/usr/share/install-launcher.js:241:26 at ChildProcess.exithandler (child_process.js:280:7) at ChildProcess.emit (events.js:182:13) at maybeClose (internal/child_process.js:962:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) ELIFECYCLE Command failed with exit code 1.
Try to reinstall telebit
curl https://get.telebit.io/ | bash
Then rerun
pnpm trigger-dev:proxy
-
Trigger.dev local docker failed to run migration. You might face this issue when running
docker compose up
in/container
folder.triggerdotdev | 526 migrations found in prisma/migrations triggerdotdev | triggerdotdev | Error: P3009 triggerdotdev | triggerdotdev | migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve triggerdotdev | The `20230616104937_remove_api_identifier` migration started at 2024-11-12 08:37:52.191805 UTC failed triggerdotdev |
A fix mentioned in triggerdotdev/trigger.dev#1026
Make new Supabase project and change the
DATABASE_URL
andDIRECT_URL
accordinglyAdd this to the
triggerdotdev
container withindocker-compose.yml
# This is the important bit! command: - sh - -c - sed -i s/public/triggerdotdev/ ./packages/database/prisma/migrations/20240130165343_add_composite_index_to_job_run_for_job_id_and_created_at/migration.sql && ./scripts/entrypoint.sh
-
Redis can't find addrinfo. You might face this issue when running
docker compose up
in/container
folder.triggerdotdev | [ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND host.docker.internal triggerdotdev | at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) triggerdotdev | at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)
You might need to change the
REDIS_HOST="host.docker.internal"
in the/container/.env
to docker specific ip address e.g:REDIS_HOST=172.17.0.1
-
After setting a development endpoint, no new
Runs
entry made.Make sure the root `.env` `TRIGGER_API_KEY`, `TRIGGER_API_URL`, and `TRIGGER_PROJECT_ID` points to the correct values.If you have verified these settings but still don't see any new
Runs
entries, try creating a new project in your local trigger.dev and rerun the setup process using the new project data. You can also try to restart the whole docker container after changing the.env
andpackage.json
files.