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

next v2.6.0 #440

Merged
merged 14 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 13 additions & 7 deletions .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@ jobs:
name: Review formatting
timeout-minutes: 2
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Check out repository code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v3
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Review formatting
run: pnpm format
run: pnpm format
16 changes: 10 additions & 6 deletions .github/workflows/deploy-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ env:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

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

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v3
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ env:
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

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

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v3
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run Version Bump Script
run: scripts/workflows/bump-version.sh "${{ join(github.event.pull_request.labels.*.name, ' ') }}"

Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@ jobs:
name: Check linting
timeout-minutes: 2
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- name: Check out repository code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v3
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@ on:

jobs:
testing:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: secretpassword
POSTGRES_USER: postgres
Expand All @@ -38,20 +36,21 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
uses: actions/setup-node@v3
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Run unit tests
run: pnpm test
# creates a .env so node does not throw error
run: touch .env && pnpm test
env:
DATABASE_PASSWORD: secretpassword
DATABASE_USER: postgres
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ yarn-error.log*
.env.production.local
.direnv

# input files
groups.csv
# testing
.nyc_output


tmp
15 changes: 15 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"reporter": [
"text",
"lcov"
],
"include": [
"src/services/*.ts",
"src/modules/*.ts"
],
"exclude": [
"src/**/*.spec.ts"
]
}
2 changes: 1 addition & 1 deletion drizzle.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const envVariables = environmentVariables.parse(process.env);
/** @type { import("drizzle-kit").Config } */
export default {
dialect: 'postgresql',
schema: './src/db/*',
schema: './src/db/schema/*',
out: './migrations',
dbCredentials: {
user: envVariables.DATABASE_USER,
Expand Down
24 changes: 0 additions & 24 deletions jest.config.mjs

This file was deleted.

1 change: 1 addition & 0 deletions migrations/0026_redundant_galactus.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "forum_questions" ADD COLUMN "vote_model" varchar(256) DEFAULT 'COCM' NOT NULL;
70 changes: 70 additions & 0 deletions migrations/0027_stormy_silverclaw.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
ALTER TABLE "forum_questions" RENAME TO "questions";--> statement-breakpoint
ALTER TABLE "question_options" RENAME TO "options";--> statement-breakpoint
ALTER TABLE "comments" RENAME COLUMN "question_option_id" TO "option_id";--> statement-breakpoint
ALTER TABLE "questions" RENAME COLUMN "question_title" TO "title";--> statement-breakpoint
ALTER TABLE "questions" RENAME COLUMN "question_sub_title" TO "sub_title";--> statement-breakpoint
ALTER TABLE "options" RENAME COLUMN "option_title" TO "title";--> statement-breakpoint
ALTER TABLE "options" RENAME COLUMN "option_sub_title" TO "sub_title";--> statement-breakpoint
ALTER TABLE "comments" DROP CONSTRAINT "comments_question_option_id_question_options_id_fk";
--> statement-breakpoint
ALTER TABLE "questions" DROP CONSTRAINT "forum_questions_cycle_id_cycles_id_fk";
--> statement-breakpoint
ALTER TABLE "options" DROP CONSTRAINT "question_options_user_id_users_id_fk";
--> statement-breakpoint
ALTER TABLE "options" DROP CONSTRAINT "question_options_registration_id_registrations_id_fk";
--> statement-breakpoint
ALTER TABLE "options" DROP CONSTRAINT "question_options_question_id_forum_questions_id_fk";
--> statement-breakpoint
ALTER TABLE "votes" DROP CONSTRAINT "votes_option_id_question_options_id_fk";
--> statement-breakpoint
ALTER TABLE "votes" DROP CONSTRAINT "votes_question_id_forum_questions_id_fk";
--> statement-breakpoint
ALTER TABLE "questions_to_group_categories" DROP CONSTRAINT "questions_to_group_categories_question_id_forum_questions_id_fk";
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "comments" ADD CONSTRAINT "comments_option_id_options_id_fk" FOREIGN KEY ("option_id") REFERENCES "public"."options"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "questions" ADD CONSTRAINT "questions_cycle_id_cycles_id_fk" FOREIGN KEY ("cycle_id") REFERENCES "public"."cycles"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "options" ADD CONSTRAINT "options_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "options" ADD CONSTRAINT "options_registration_id_registrations_id_fk" FOREIGN KEY ("registration_id") REFERENCES "public"."registrations"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "options" ADD CONSTRAINT "options_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "votes" ADD CONSTRAINT "votes_option_id_options_id_fk" FOREIGN KEY ("option_id") REFERENCES "public"."options"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "votes" ADD CONSTRAINT "votes_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "questions_to_group_categories" ADD CONSTRAINT "questions_to_group_categories_question_id_questions_id_fk" FOREIGN KEY ("question_id") REFERENCES "public"."questions"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
15 changes: 15 additions & 0 deletions migrations/0028_keen_nick_fury.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ALTER TABLE "options" RENAME COLUMN "accepted" TO "show";--> statement-breakpoint
ALTER TABLE "questions_to_group_categories" ALTER COLUMN "group_category_id" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "events" ADD COLUMN "fields" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "registrations" ADD COLUMN "data" jsonb;--> statement-breakpoint
ALTER TABLE "questions" ADD COLUMN "user_can_create" boolean DEFAULT false;--> statement-breakpoint
ALTER TABLE "questions" ADD COLUMN "fields" jsonb DEFAULT '{}'::jsonb NOT NULL;--> statement-breakpoint
ALTER TABLE "options" ADD COLUMN "group_id" uuid;--> statement-breakpoint
ALTER TABLE "options" ADD COLUMN "data" jsonb;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "options" ADD CONSTRAINT "options_group_id_groups_id_fk" FOREIGN KEY ("group_id") REFERENCES "public"."groups"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "status_idx" ON "cycles" ("status");
Loading
Loading