Skip to content

Commit

Permalink
Merge branch 'main' into contributors-page-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewuu committed Jan 12, 2025
2 parents 763dbd7 + 07ee562 commit f744493
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 86 deletions.
33 changes: 17 additions & 16 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ POSTGRES_USER=postgres
POSTGRES_DB=homie

# Auth
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_bmV1dHJhbC1xdWFnZ2EtNS5jbGVyay5hY2NvdW50cy5kZXYk
CLERK_SECRET_KEY=sk_test_XqvZjcmTFv17AvVlCVswVmJcNt6wCecpyvmisN78NG
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign_up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/pull_requests
Expand All @@ -17,9 +17,10 @@ NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/pull_requests
NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/pull_requests

# App
NEXT_PUBLIC_APP_URL=https://next.mikewu.dev
NEXT_PUBLIC_APP_URL=
NEXT_PUBLIC_APP_LOG_LEVEL=info
QUEUE_DRIVER=redis
QUEUE_DASHBOARD_PASSWORD=password

# AWS
AWS_SECRET_KEY_ID=
Expand All @@ -42,32 +43,32 @@ NEXT_PUBLIC_SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=

# OpenAI
OPENAI_API_KEY=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
OPENAI_API_KEY=

# Redis
REDIS_HOST=127.0.0.1:6379

# Pinecone
PINECONE_API_KEY=f5d8040a-b240-4f4f-82b3-997618714d2a
PINECONE_API_KEY=
PINECONE_INDEX_MAIN=main

# Cohere
COHERE_API_KEY=q2U7UN60svtJg2a7muLHe9WCRs4AF4xobl10B0b0
COHERE_API_KEY=

# Google Analytics
NEXT_PUBLIC_GA_MEASUREMENT_ID=

# Billing
STRIPE_PUBLISHABLE_KEY=pk_test_51Moau7HbuxsuVjqYhhKS959EOOunXSjkCMqNgShUof3205TfVFRjIy3sO9x8hb4dPZFaGylXtV1KN29X9gxQo8Ry00WKPs9R1Z
STRIPE_SECRET_KEY=sk_test_51Moau7HbuxsuVjqY1IE3v2vch6JpIaiat9qPCEzKkREJLXe3tmmvBgJXXuBeIz9qgRhELscOMQzQmQJ9Am5VUiHh00KTGood42
STRIPE_WEBHOOK_SECRET=whsec_vMMKkx9usexHEdMrfefh6RIMnAGL0ZYn
STRIPE_PRICE_ID_HOMIE_BASIC_MONTHLY=price_1PCtUtHbuxsuVjqYIlRe5Pey
STRIPE_PRICE_ID_HOMIE_TEAM_MONTHLY=price_1PCtVDHbuxsuVjqY0p0HnSFo
STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRICE_ID_HOMIE_BASIC_MONTHLY=
STRIPE_PRICE_ID_HOMIE_TEAM_MONTHLY=

# Axiom
NEXT_PUBLIC_AXIOM_DATASET=homie
NEXT_PUBLIC_AXIOM_TOKEN=xaat-212ecd83-91b1-4d90-84b6-b76fb99e3198
AXIOM_ORG_ID=world-united-studios-zopz
NEXT_PUBLIC_AXIOM_DATASET=
NEXT_PUBLIC_AXIOM_TOKEN=
AXIOM_ORG_ID=

#SENTRY
NEXT_PUBLIC_SENTRY_DSN=
Expand All @@ -86,5 +87,5 @@ ASANA_CLIENT_SECRET=

# Mailchimp
MAILCHIMP_API_KEY=
MAILCHIMP_SERVER_PREFIX=us22
MAILCHIMP_LIST_ID=8815837e17
MAILCHIMP_SERVER_PREFIX=
MAILCHIMP_LIST_ID=
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"date-fns": "^3.6.0",
"date-fns-tz": "^3.1.3",
"eslint-plugin-jest": "^28.2.0",
"express-basic-auth": "^1.2.1",
"framer-motion": "^11.1.9",
"gray-matter": "^4.0.3",
"he": "^1.2.0",
Expand Down
15 changes: 13 additions & 2 deletions queue-dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
import express from 'express'
import basicAuth from 'express-basic-auth'
import { createBullBoard } from '@bull-board/api'
import { BullAdapter } from '@bull-board/api/bullAdapter'
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter'
import { ExpressAdapter } from '@bull-board/express'
import { getQueue } from '@/queue/get-queue'
import { config } from '@/config'
import process from 'node:process'

const serverAdapter = new ExpressAdapter()
serverAdapter.setBasePath('/jobs')

// Add auth to require password for access
const auth = basicAuth({
users: { admin: process.env.QUEUE_DASHBOARD_PASSWORD ?? '' },
challenge: true, // Will show browser prompt
})

createBullBoard({
queues: Object.keys(config.queue.queues).map(
(queue) => new BullAdapter(getQueue(queue)),
(queue) => new BullMQAdapter(getQueue(queue)),
),
serverAdapter: serverAdapter,
})

const app = express()

// Apply auth middleware to /jobs routes only
app.use('/jobs', auth)

app.use('/jobs', serverAdapter.getRouter())
app.get('/', (_req, res) => res.send('ok'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ it('should create and embed a pr', async () => {

const pullRequest = await dbClient
.selectFrom('homie.pull_request')
.where('ext_gh_pull_request_id', '=', 8282)
.where('ext_gh_pull_request_id', '=', '8282')
.selectAll()
.executeTakeFirstOrThrow()
expect(pullRequest.title).toBe('My test closed PR')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* eslint-disable @typescript-eslint/naming-convention */
import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate'

export const shorthands: ColumnDefinitions | undefined = undefined

export async function up(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gh_pull_request_id',
{
type: 'text',
notNull: false,
},
)

pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_id',
{
type: 'text',
notNull: false,
},
)
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_iid',
{
type: 'text',
notNull: false,
},
)
}

export async function down(pgm: MigrationBuilder): Promise<void> {
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gh_pull_request_id',
{
type: 'integer',
notNull: false,
},
)

pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_id',
{
type: 'integer',
notNull: false,
},
)
pgm.alterColumn(
{
schema: 'homie',
name: 'pull_request',
},
'ext_gitlab_merge_request_iid',
{
type: 'integer',
notNull: false,
},
)
}
Loading

0 comments on commit f744493

Please sign in to comment.