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

fix(payments): fix docker compose and banking circle connector #1727

Merged
merged 3 commits into from
Sep 27, 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
1 change: 1 addition & 0 deletions components/payments/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins
.DS_Store
.idea
vendor
Expand Down
1 change: 1 addition & 0 deletions components/payments/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ compile-plugins:
DO --pass-args core+GO_COMPILE --VERSION=$VERSION
WORKDIR /src
SAVE ARTIFACT /src/components/payments/internal/connectors/plugins/public/$c/cmd/main ./plugins/$c
SAVE ARTIFACT /src/components/payments/internal/connectors/plugins/public/$c/cmd/main AS LOCAL ./plugins/$c
END

compile:
Expand Down
47 changes: 42 additions & 5 deletions components/payments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,47 @@ services:
condition: service_healthy
volumes:
- .:/app/components/payments
- ../../libs:/app/libs
working_dir: /app/components/payments
environment:
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable

temporal:
image: temporalio/auto-setup:1.25.0
depends_on:
postgres:
condition: service_healthy
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: payments
POSTGRES_PWD: payments
POSTGRES_SEEDS: postgres
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development-sql.yaml
ports:
- 7233:7233
volumes:
- ./local_env/postgres/temporal-sql.yaml:/etc/temporal/config/dynamicconfig/development-sql.yaml
temporal-admin-tools:
container_name: temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:1.25.0-tctl-1.18.1-cli-1.0.0
stdin_open: true
tty: true
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:2.26.2
ports:
- 8081:8080

payments:
image: golang:1.22.4-alpine3.19
command: go run ./ server
Expand All @@ -50,11 +86,12 @@ services:
- "8080:8080"
volumes:
- .:/app/components/payments
- ../../libs:/app/libs
working_dir: /app/components/payments
environment:
DEBUG: ${DEBUG:-"true"}
DEBUG: true
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey

# TODO(polo): add temporal
TEMPORAL_ADDRESS: temporal:7233
PLUGIN_MAGIC_COOKIE: mysupercookie
PLUGIN_DIRECTORY_PATH: /app/components/payments/plugins
TEMPORAL_INIT_SEARCH_ATTRIBUTES: true
2 changes: 1 addition & 1 deletion components/payments/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.22.7
require (
github.com/ThreeDotsLabs/watermill v1.3.7
github.com/bombsimon/logrusr/v3 v3.1.0
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15
github.com/formancehq/payments/genericclient v0.0.0-00010101000000-000000000000
github.com/gibson042/canonicaljson-go v1.0.3
github.com/go-chi/chi/v5 v5.1.0
Expand Down
4 changes: 2 additions & 2 deletions components/payments/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c h1:fSPJ3x4ofe+9bnrS1pr1+9r0SAaxhJ5Jw4k4wKEUTwk=
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c/go.mod h1:ynmWBbsdhVyjE+MxneMErtgd/RnNAk892VuIhZE2fps=
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15 h1:a/STc7qwGyEX3itlrLgVJoB0N8IGA9TJ+xPeQns7Lsk=
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15/go.mod h1:ynmWBbsdhVyjE+MxneMErtgd/RnNAk892VuIhZE2fps=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/gibson042/canonicaljson-go v1.0.3 h1:EAyF8L74AWabkyUmrvEFHEt/AGFQeD6RfwbAuf0j1bI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func (c *Client) login(ctx context.Context) error {
}
return fmt.Errorf("failed to login: %d", statusCode)
}
return fmt.Errorf("failed make login request: %w", err)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈


c.accessToken = res.AccessToken
expiresIn, err := strconv.Atoi(res.ExpiresIn)
Expand Down
1 change: 1 addition & 0 deletions components/payments/local_env/postgres/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER ROLE payments SET search_path = public;
6 changes: 6 additions & 0 deletions components/payments/local_env/postgres/temporal-sql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
limit.maxIDLength:
- value: 255
constraints: {}
system.forceSearchAttributesCacheRefreshOnRead:
- value: true # Dev setup only. Please don't turn this on in production.
constraints: {}
3 changes: 2 additions & 1 deletion tests/integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ require (
github.com/egymgmbh/go-prefix-writer v0.0.0-20180609083313-7326ea162eca
github.com/formancehq/auth v0.0.0-00010101000000-000000000000
github.com/formancehq/formance-sdk-go/v2 v2.0.0-00010101000000-000000000000
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c
github.com/formancehq/formance-sdk-go/v3 v3.0.0
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15
github.com/formancehq/ledger v0.0.0-00010101000000-000000000000
github.com/formancehq/orchestration v0.0.0-00010101000000-000000000000
github.com/formancehq/payments v0.0.0-00010101000000-000000000000
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c h1:fSPJ3x4ofe+9bnrS1pr1+9r0SAaxhJ5Jw4k4wKEUTwk=
github.com/formancehq/go-libs v1.7.2-0.20240926150224-306278b90e0c/go.mod h1:ynmWBbsdhVyjE+MxneMErtgd/RnNAk892VuIhZE2fps=
github.com/formancehq/formance-sdk-go/v3 v3.0.0 h1:UIzVMJSPUBUSm29Zg50tZjM0f101WeWHYlu0ClfUk2c=
github.com/formancehq/formance-sdk-go/v3 v3.0.0/go.mod h1:ZBBYCgtDgde68qMW5nZ9lfliM8W1D3ZI/BpZ+RdhD3c=
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15 h1:a/STc7qwGyEX3itlrLgVJoB0N8IGA9TJ+xPeQns7Lsk=
github.com/formancehq/go-libs v1.7.2-0.20240927101303-a8e108b39d15/go.mod h1:ynmWBbsdhVyjE+MxneMErtgd/RnNAk892VuIhZE2fps=
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
Expand Down