Skip to content

Commit

Permalink
feat: switch to Postgres (#113)
Browse files Browse the repository at this point in the history
* chore: clippy warnings

* feat: Postgres boilerplate

* chore: CI Postgres

* chore: Terraform Postgres

* chore: fmt

* feat: projects in Postgres

* fix: domain regex

* chore: style

* chore: style

* feat: auto-migrate projects

* chore: remove unused struct

* chore: link to issue

* chore: major work

* chore: combine subscribes

* chore: remove docdb from state

* chore: rename

* chore: idempotency & updated_at

* chore: spawn for handle_msg() to avoid blocking reconnect

* feat: re-enable scopes

* fix: cannot use CTE with modification statements as they are unpredictable

* chore: remove fixme

* fix: filter scope in /notify

* fix: remaining NotifyClient data

* fix: NotifyMessage data export

* chore: remove comments

* chore: fmt query

* chore: redundant var

* chore: remove more MongoDB

* chore: FIXME fixed

* chore: refactor

* fix: notify key migration & add tests

* chore: test two subscribers

* chore: test two projects

* fix: test-threads in CI

* chore: fix imports

* chore(version): v0.15.0

* chore: Bump version for release

* chore: rm tf file

* chore: separate storage tests

* chore: add back outputs.tf

* chore(version): v0.16.0

* chore: Bump version for release

* fix(ci): don't release on PR push

* chore: test ports

* chore: reset version

* chore: reset changelog

* fix: MongoDB default user/pass

* chore: use enum

* fix: ERD

* chore: ON DELETE CASCADE

* chore: POSTGRES_HOST_AUTH_METHOD: trust

* chore: test double migration

* chore: add codeowners

* chore: use sqlx migrate add

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: chris13524 <[email protected]>
  • Loading branch information
3 people authored Oct 18, 2023
1 parent f585bf5 commit 5fb0f54
Show file tree
Hide file tree
Showing 43 changed files with 3,886 additions and 1,395 deletions.
2 changes: 2 additions & 0 deletions .github/codeowners
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* @geekbrother
* @chris13524
31 changes: 30 additions & 1 deletion .github/workflows/sub-app-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: WalletConnect/actions-rs/[email protected]
with:
command: clippy
args: -- -D warnings
args: --all-features --tests -- -D warnings

formatting:
name: Formatting
Expand Down Expand Up @@ -68,6 +68,26 @@ jobs:
name: Tests
runs-on:
group: ${{ vars.RUN_GROUP }}
services:
mongodb:
image: mongo
env:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
MONGO_INITDB_DATABASE: notify
ports:
- 27017:27017
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -92,3 +112,12 @@ jobs:
with:
command: test
args: --all-features --lib --bins

- name: "Storage Tests"
uses: WalletConnect/actions-rs/[email protected]
with:
command: test
args: --test storage -- --test-threads=1
env:
DATABASE_URL: mongodb://admin:admin@localhost:27017/notify?authSource=admin
POSTGRES_URL: postgres://postgres:password@localhost:5432/postgres
16 changes: 0 additions & 16 deletions .github/workflows/sub-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,6 @@ jobs:
environment:
name: ${{ inputs.stage }}
url: ${{ inputs.stage-url }}
services:
mongodb:
image: mongo
ports:
- 27017:27017
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,4 +585,4 @@ All notable changes to this project will be documented in this file. See [conven
- triggering action - (0b555c9) - Rakowskiii
- - -

Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto).
Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto).
Loading

0 comments on commit 5fb0f54

Please sign in to comment.