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 interaction with max and unbounded overdraft #474

Closed
wants to merge 1,336 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1336 commits
Select commit Hold shift + click to select a range
cf376c1
feat(ledger): Update
flemzord Jan 31, 2023
0a1edbd
feat: remove .devcontainer
flemzord Jan 31, 2023
2e04c9c
feat: Add Licence & Update .goreleaser.yml
flemzord Jan 31, 2023
8b17579
feat: Improvement for CI
flemzord Jan 31, 2023
da35972
feat: update ledger
gfyrag Feb 8, 2023
203b679
fix: first
Feb 8, 2023
c11548b
*: change imports for go-libs to be in the monorepo
paul-nicolas Feb 10, 2023
b9e9df6
*: add replace instead of branch commit
paul-nicolas Feb 10, 2023
565dedc
fix: empty events using numscript (#431)
gfyrag Feb 10, 2023
aa547ff
git subrepo pull --force components/ledger
flemzord Feb 10, 2023
9270760
feat: Add subscription on publish shared lib and update components le…
gfyrag Feb 13, 2023
cf90f7f
fix: add proper version for gateway for local dev and bump deps (#55)
paul-nicolas Feb 14, 2023
d48e003
chore: Machine in Ledger (#50)
Feb 14, 2023
92e4deb
fix: go-libs imports were not up to date (#67)
paul-nicolas Feb 17, 2023
ca3bc98
chore: Improve test coverage (#59)
Feb 21, 2023
2979644
chore: Bump Go to 1.19 (#82)
Feb 21, 2023
ad73372
fix: tests with postgres server (#86)
gfyrag Feb 22, 2023
4466ec6
feat: Integration testing (#64)
Feb 23, 2023
d93bd76
fix: concurrent map read/writes (#90)
gfyrag Feb 23, 2023
542bf09
fix: default UI port (#440)
leobeal Mar 10, 2023
c36376c
feat: remove deprecated ledger field for event message (#150)
paul-nicolas Mar 15, 2023
223af06
chore: add example in the description for metadata filter (#115)
jdupas22 Mar 20, 2023
5b78af1
fix: Reverse transaction (#189)
Mar 29, 2023
7baf148
feat: Numscript: new ASSET variable type (#182)
Mar 29, 2023
87e842b
feat: Numscript: allow 0 and 100 inclusive in portions (#201)
Apr 3, 2023
a3fabac
chore: update readme
altitude Apr 4, 2023
991b720
fix: remove minimum balance for all balances operation (#227)
paul-nicolas Apr 13, 2023
32fde57
fix: mapping ignore destinations accounts
gfyrag Apr 11, 2023
ee33821
fix: Ledger: openapi numscript vars example
Apr 17, 2023
c730c6d
chore: Ledger: deprecation message for sqlite (#245)
Apr 17, 2023
c9825de
feat: Implement whith subtree
flemzord Apr 18, 2023
1e5c328
feat: Add Subtree configuration for Ledger repository (#248)
flemzord Apr 18, 2023
03a18b7
feat: Add go-libs folder in Ledger
flemzord Apr 18, 2023
be6bc77
ci: Add Control
flemzord Apr 18, 2023
a129fab
ci: rework Dockerfile for Ledger
flemzord Apr 18, 2023
57e7a2a
feat(Ledger): Add Auto-upgrade when libs is updated (#249)
flemzord Apr 19, 2023
77d584c
ci: Add build.Dockerfile & Use in GoReleaser
flemzord Apr 19, 2023
ab366e3
feat: Update config for release
flemzord Apr 19, 2023
0faa2e9
ci: Update main.yml
flemzord Apr 19, 2023
5a3ba95
ci: Update main.yml
flemzord Apr 19, 2023
05bf723
Merge commit '5a3ba95095ce2e30c3bf224d921d4e32633a0b6a'
flemzord Apr 19, 2023
3dc7e24
feat(Numscript): Send monetary with arithmetic (#215)
Apr 24, 2023
c1022f1
ci: Upgrade
flemzord Apr 24, 2023
27a9fe9
ci: Update Dockerfile flow
flemzord Apr 24, 2023
7d26135
feat: remove tracer from health road (#274)
paul-nicolas Apr 25, 2023
7b8a145
feat: add otel metrics lib in go libs (#289)
paul-nicolas May 2, 2023
e5e835c
chore: Improve Goreleaser management & CI (#278)
flemzord May 5, 2023
36a6b5b
feat(ledger): Add monorepo info in GoReleaser
flemzord May 9, 2023
15bb085
git subrepo push components/ledger
gfyrag Feb 23, 2023
ec2db48
feat(ledger): replace gin by chi and remove authorization options (#92)
gfyrag Mar 2, 2023
a19ec7f
feat: Remove NUMARY_ prefix on ledger and update operator (#94)
gfyrag Mar 2, 2023
5de3066
feat: move openapi files to root (#95)
gfyrag Mar 2, 2023
a737501
feat: remove ledger config file (#96)
gfyrag Mar 2, 2023
a5bbfad
feat: remove deprecated flags and add --bind flag on ledger (replace …
gfyrag Mar 2, 2023
49ac8c6
feat: rename references from numary to ledger (#98)
gfyrag Mar 2, 2023
0f2bbb2
feat: remove deprecated json fields and query params (#100)
gfyrag Mar 2, 2023
1d4fcca
feat/num 1546 ledger replace server start by serve (#101)
gfyrag Mar 2, 2023
a3bc45b
feat: remove /script endpoint (#102)
gfyrag Mar 2, 2023
efa43a9
feat: remove mapping and batch (#104)
gfyrag Mar 3, 2023
780357c
chore: remove 'ui' and 'stickers' commands on ledger (#105)
gfyrag Mar 3, 2023
c7d0896
chore: remove http basic authentication and deprecated telemetry flag…
gfyrag Mar 3, 2023
ed3d108
feat: remove wrapper on GET /_info (#108)
gfyrag Mar 3, 2023
82e60e5
feat: remove sqlite from ledger (#109)
paul-nicolas Mar 3, 2023
8b8c8c6
fix: local testing (#116)
gfyrag Mar 7, 2023
9a0a03d
feat: use pgtesting from go libs (#112)
gfyrag Mar 7, 2023
0dbea27
feat: sqlstorage rework (#122)
paul-nicolas Mar 9, 2023
21dbdaf
feat: move ledger lock inside core ledger (#129)
gfyrag Mar 13, 2023
8de3017
feat: introduce logs insertion by batch (#128)
paul-nicolas Mar 13, 2023
705eaf5
fix: if we have an error, still release all models (#141)
paul-nicolas Mar 14, 2023
508e904
feat: move bulk insert to copy with bun (#145)
paul-nicolas Mar 14, 2023
91aaddf
feat: combine logs before insertion (#142)
paul-nicolas Mar 14, 2023
63a3471
feat: add openapi spec validation on integration tests (#133)
gfyrag Mar 15, 2023
859626f
feat: remove unnecessary storage abstractions (#147)
gfyrag Mar 15, 2023
e92c101
feat: refactor commit process (#160)
gfyrag Mar 20, 2023
062cf27
feat: add internal channel for views computing (#161)
paul-nicolas Mar 21, 2023
bb24de3
fix: stop worker if stop chan is used (#164)
paul-nicolas Mar 21, 2023
9c4567d
test: add CQRS integration tests (#163)
gfyrag Mar 21, 2023
333b90c
chore: remove deprecated ledger openapi (#152)
Mar 22, 2023
cd37d0b
remove unused logs
paul-nicolas Mar 22, 2023
9d8912e
feat: fix from review (#168)
gfyrag Mar 22, 2023
8c72bf6
feat: optimize log postgresql table (#166)
paul-nicolas Mar 22, 2023
751805c
feat: simplify model (#169)
gfyrag Mar 22, 2023
fb407da
feat: extract sources from machine (#167)
gfyrag Mar 22, 2023
9f3bf01
feat: make cache works in parallel (#170)
gfyrag Mar 22, 2023
ddba008
refactor: machine resources resolution (#162)
gfyrag Mar 22, 2023
ff13b68
feat: Skip init if DB is not initialized (#171)
paul-nicolas Mar 22, 2023
402b024
refactor: commit write buffer (#174)
gfyrag Mar 23, 2023
b5eda90
feat: add waiting on cqrs to have a synchrone api (#176)
paul-nicolas Mar 23, 2023
2675422
feat: readd numscript cache (#177)
gfyrag Mar 23, 2023
ff77152
fix: cache (concurrent read cause multiple db accesses) (#178)
gfyrag Mar 23, 2023
d73df6b
refactor: separate machine code (#180)
gfyrag Mar 27, 2023
a099980
feat: optimize cache (#181)
gfyrag Mar 27, 2023
2f444ea
feat: rework storage errors (#183)
paul-nicolas Mar 28, 2023
2ca1cbb
feat: centralize ledger lifecycle inside resolver. (#184)
gfyrag Mar 28, 2023
32988a6
feat: Numscript: return postings with zero amount (#185)
Mar 28, 2023
5f387df
refactor: extract state management from runner (#186)
gfyrag Mar 29, 2023
1dbd425
feat: optimize queries package (#187)
paul-nicolas Mar 29, 2023
a418c19
fix: refactor query Worker struct and methods (#190)
paul-nicolas Mar 29, 2023
e821b75
feat: implement error handling utilities package (#194)
paul-nicolas Mar 30, 2023
29042e1
chore: Webhooks integration tests (#188)
Mar 31, 2023
c822741
chore: Machine: add tests for new asset variable type (#197)
Mar 31, 2023
42c6cec
feat: improve ledger errors (#198)
paul-nicolas Mar 31, 2023
ee5b244
test: remove sql need on most ledger tests
gfyrag Mar 27, 2023
f80c629
feat: add orchestration (#123)
gfyrag Mar 9, 2023
5b03937
feat: replace map[string]any by map[string]string on all metadata
gfyrag Mar 31, 2023
4dc3c8f
fix: integration tests fix (#203)
paul-nicolas Apr 4, 2023
728bbab
chore: update dependencies and configurations for ledger service (#200)
paul-nicolas Apr 4, 2023
a8b940a
feat: Numscript: save from account (#199)
Apr 4, 2023
1142e4b
feat: add otel metrics everywhere in ledger (#205)
paul-nicolas Apr 5, 2023
4803dc1
feat: store worker is now configurable (#206)
paul-nicolas Apr 5, 2023
8f38dbf
feat: ensure all ledgers are closed when closing the app (#208)
paul-nicolas Apr 5, 2023
06131ab
feat: factorize pagination
gfyrag Apr 4, 2023
4088a97
feat: wait for logs ingestion before starting (#212)
paul-nicolas Apr 6, 2023
bb5f2b9
feat: implement multi account based lock
gfyrag Mar 23, 2023
2434ab1
feat: change transactions ids to uuid
gfyrag Apr 5, 2023
1be7a5a
feat: use sync.Map
gfyrag Apr 3, 2023
69b4386
wip
gfyrag Apr 6, 2023
08a4e88
feat: add cache eviction and make retention and eviction period confi…
gfyrag Apr 6, 2023
92292b9
wip
gfyrag Apr 6, 2023
bf43a2e
fix: concurrent reverts
gfyrag Apr 7, 2023
de8be24
query: launch init ledger in goroutines (#219)
paul-nicolas Apr 11, 2023
eb7bed4
fix: query worker init
gfyrag Apr 11, 2023
c9075c2
feat: add limit for select in query init ledgers (#223)
paul-nicolas Apr 11, 2023
d0a4462
feat: merge all migrations to one (#225)
paul-nicolas Apr 12, 2023
762cb41
feat: add some benchmarks
gfyrag Apr 11, 2023
a3ed10c
feat: enable uuid rand pool for uuid generation
gfyrag Apr 13, 2023
26a7af0
feat: add benchmark and optimize logs hashing
gfyrag Apr 13, 2023
351ce26
fix: machine involved accounts resolution
gfyrag Apr 13, 2023
fe86393
Revert "feat: change transactions ids to uuid"
gfyrag Apr 13, 2023
6354661
feat: keep last log in memory
gfyrag Apr 14, 2023
056c82b
feat: allow core to handle transactions aynchronously
gfyrag Apr 14, 2023
c299116
fix: hash
gfyrag Apr 14, 2023
25dc5f1
feat: add more integrations tests for ledger (#238)
paul-nicolas Apr 14, 2023
dcc244a
feat: clean openapi (#240)
paul-nicolas Apr 14, 2023
5c61222
feat: Improvement for GoReleaser
flemzord Apr 17, 2023
1c50ab3
feat: Add build.Dockerfile for Ledger
flemzord Apr 17, 2023
ecc80f7
feat: add ballast package (#243)
paul-nicolas Apr 17, 2023
33a6544
feat: remove pre/post commit volumes from transaction creation response
gfyrag Apr 13, 2023
97c9d75
feat: remove redundant postings denormalization
gfyrag Apr 14, 2023
91e6033
refactor: reduce memory allocation of big ints inside machine
gfyrag Apr 17, 2023
14797fc
feat: merge all logs related writes
gfyrag Apr 17, 2023
2855bba
feat: use logger with json formatter (#247)
paul-nicolas Apr 18, 2023
f68157b
refactor: make commit process only use logs (not projections)
gfyrag Apr 19, 2023
2f9190d
feat: change status code to 204 on HEAD /transactions and /accounts
gfyrag Apr 20, 2023
ea97ba7
fix: fix memory leak with store logs worker not closed (#257)
paul-nicolas Apr 20, 2023
05c7cff
feat: rename preview to dry run
gfyrag Apr 20, 2023
c5395d2
feat: disallow empty accounts
gfyrag Apr 20, 2023
83f05c1
feat: change status code from 200 to 201 on revert transactions
gfyrag Apr 20, 2023
0feacdc
feat: add idempotency at log level
gfyrag Apr 20, 2023
bebdcc6
feat: introduce PersistedLog structure
gfyrag Apr 20, 2023
0b02f76
feat: use pointers for logs instead of value to avoid copy and too ma…
gfyrag Apr 20, 2023
535c96a
refactor: remove testing dead code
gfyrag Apr 20, 2023
85c4822
feat: make numscript cache configurable
gfyrag Apr 20, 2023
4ee9984
feat: add migrations from v1.9.x to v2.x (#266)
paul-nicolas Apr 21, 2023
faa48e4
feat: add index on postings (#258)
gfyrag Apr 21, 2023
d55ebeb
feat: avoid useless sql query to insert already existing accounts
gfyrag Apr 20, 2023
27fc77c
fix: missing import
gfyrag Apr 21, 2023
fd33470
feat: refine benchs scenario
gfyrag Apr 22, 2023
eb77e84
feat(v2): Add moon (#252)
flemzord Apr 24, 2023
d3001af
feat: add connection pooling configuration
gfyrag Apr 22, 2023
93f947c
feat: set GOMAXPROCS=2 for benchmarks
gfyrag Apr 24, 2023
cdb8963
feat: refine benchs
gfyrag Apr 25, 2023
89e2fd9
feat: add a metric on bench
gfyrag Apr 25, 2023
b05d9d2
feat: add a metric on bench
gfyrag Apr 25, 2023
db3104d
refactor: storage
gfyrag Apr 25, 2023
701f202
fix: memory leak
gfyrag Apr 27, 2023
7765492
fix: rebase
gfyrag May 10, 2023
6d1b800
feat: fix release
flemzord May 11, 2023
6dd119d
chore(moon): Tasks management improvement
flemzord May 12, 2023
2ed6b7e
refactor: memory management
gfyrag Apr 28, 2023
f3ff4be
feat: update benchmark scenario with a more real use case
gfyrag May 12, 2023
633ef26
feat: change implementation of accounts lock
gfyrag Apr 23, 2023
fb0e6de
feat: update benchmark scenario to use numscript cache
gfyrag May 12, 2023
ffd5acb
ci: Desactive release.yml workflow
flemzord May 15, 2023
8e28978
feat: add stargate server and client (#297)
paul-nicolas May 16, 2023
c85f6c1
feat: use zero value of big.Int objects
gfyrag Apr 22, 2023
ede6dbd
ci: Simplify CI for Ledger Only
flemzord May 15, 2023
419ba3b
chore: remove .gitrepo (useless)
flemzord May 15, 2023
c664917
feat(ledger): Add libs sync
flemzord May 17, 2023
5a1d22a
feat(sdks): Switch to Speakeasy for SDK generator
flemzord Mar 22, 2023
937caaa
fix: crash with resources loaded twice (#338)
paul-nicolas May 26, 2023
945a57e
fix: missing metrics result tag when passing options (#339)
paul-nicolas May 26, 2023
ad2b30d
feat: infer metadata/variable types from numscript
gfyrag Jun 5, 2023
11efc1a
Merge commit 'ffd5acb98085efe36205c7781623eca5dabd167a'
flemzord Jun 7, 2023
698703c
ci: clear useless step
flemzord Jun 7, 2023
89fd51d
ci: clear useless step
flemzord Jun 7, 2023
864b467
ci: clear useless step
flemzord Jun 7, 2023
c2c1278
feat: Ledger v2 -> Stack repo 1641c3c85295b5199e7129e2ebe94926eedd826b
flemzord Sep 20, 2023
3767722
chore: init subrepo
flemzord Sep 20, 2023
d562813
chore: Update release flow
flemzord Sep 20, 2023
150db93
chore: Update release flow
flemzord Sep 20, 2023
5fb4cd2
chore: Update release flow
flemzord Sep 20, 2023
f5c6a32
chore: Update release flow
flemzord Sep 20, 2023
2f7f95c
chore: Create FUNDING.yml
flemzord Oct 2, 2023
94aeb02
feat: Sync Stack repo 9f6219e229d414f37d56a995056e4377226a65dc
flemzord Oct 6, 2023
8162d3f
git subrepo pull --remote=ledger --branch=main --force components/ledger
flemzord Oct 6, 2023
f16a2d3
chore(deps): bump actions/setup-go from 3 to 4 (#463)
dependabot[bot] Oct 10, 2023
02d0f47
chore(deps): bump docker/login-action from 2 to 3 (#466)
dependabot[bot] Oct 10, 2023
6c644ff
chore(deps): bump goreleaser/goreleaser-action from 4 to 5 (#464)
dependabot[bot] Oct 10, 2023
c063b1f
git subrepo pull --remote=ledger --branch=main --force components/ledger
flemzord Oct 6, 2023
504d266
chore(deps): bump github.com/docker/docker from 20.10.17+incompatible…
dependabot[bot] Oct 10, 2023
63319f7
chore(deps): bump github.com/opencontainers/runc from 1.1.3 to 1.1.5 …
dependabot[bot] Oct 10, 2023
3d99b65
deps: Update deps
flemzord Oct 10, 2023
206397f
git subrepo pull (merge) --remote=ledger --branch=main components/ledger
flemzord Oct 10, 2023
f1e8c7b
fix(ledger): fix curl error when publishing (#609)
paul-nicolas Oct 10, 2023
648b43c
feat(payments): add filters for transfer-initiation (#584)
paul-nicolas Oct 10, 2023
e99c040
feat: add secrets handling for configuration (#575)
gfyrag Oct 10, 2023
783d5f6
feat: add a sql connection pool by ledger (#637)
gfyrag Oct 13, 2023
e16abb8
feat: share code inside libs (#642)
gfyrag Oct 16, 2023
1eb9310
feat: Replace devbox & moon by Earthly (#647)
flemzord Oct 30, 2023
c7ce26b
feat: add stable cursor (#655)
gfyrag Oct 31, 2023
7c38649
fix: slow pg tests (#786)
gfyrag Nov 3, 2023
4c43ac7
feat: add bulk on ledger (#781)
gfyrag Nov 3, 2023
88af7b9
feat(ledger): add tests on big int support (#827)
gfyrag Nov 6, 2023
7e5ecf1
feat: add balances aggregation by metadata (#826)
gfyrag Nov 6, 2023
c331e81
fix: support of 'expand' on accounts list (#828)
gfyrag Nov 6, 2023
b7c7080
feat: add 'force' query param to force reverts even if the source acc…
gfyrag Nov 6, 2023
bccd2ef
feat: Add benchmarks (#450)
gfyrag Nov 7, 2023
c8e593c
fix: missing big ints un openapispec / sdk (#830)
gfyrag Nov 7, 2023
cda4bd1
fix: import from https://github.com/formancehq/ledger/pull/454/files …
gfyrag Nov 7, 2023
be3bc16
feat: refactor error handling and add tests (#836)
gfyrag Nov 10, 2023
d5c0e34
feat: allow digits in first segment of account addresses (#839)
gfyrag Nov 10, 2023
c781d24
feat: add configurable service at configuration level and add fallbac…
gfyrag Nov 13, 2023
f59d387
fix: with earthly +pre-commit from racine (#851)
Dav-14 Nov 14, 2023
00e1c68
feat: allow options (listener or bindingAddress) with opts pattern (#…
Dav-14 Nov 16, 2023
96fa981
fix: libs (#869)
Dav-14 Nov 16, 2023
b69ca22
feat: benchmarks store (#872)
gfyrag Nov 17, 2023
8b7fe8b
feat(ledger): add earthfile target to compare benchmarks (#873)
gfyrag Nov 17, 2023
76bc275
feat(ledger): add some parameters to benchmarks (#874)
gfyrag Nov 17, 2023
a312cab
feat(otlp): add bodies on http requests if status code >= 400 (#876)
gfyrag Nov 21, 2023
ccb2ecf
feat(ledger): add some columns on transactions table to speed up read…
gfyrag Nov 22, 2023
017b4ae
feat: fix events handler on ledger v2 (#538)
gfyrag Nov 22, 2023
6b95d43
feat(ledger): add namespace V2 for sdk (#885)
gfyrag Nov 23, 2023
1fb9bfa
feat: various bench improvements (#887)
gfyrag Nov 23, 2023
d29fda2
chore(deps): bump google.golang.org/grpc from 1.55.0 to 1.56.3 in /li…
dependabot[bot] Nov 24, 2023
e92b2ce
chore(deps): bump github.com/docker/docker from 20.10.17+incompatible…
dependabot[bot] Nov 26, 2023
6d9a5ea
chore(deps): bump github.com/docker/docker from 20.10.24+incompatible…
dependabot[bot] Nov 26, 2023
07613a7
chore(deps): bump github.com/nats-io/nats-server/v2 from 2.9.8 to 2.9…
dependabot[bot] Nov 26, 2023
fba27bc
chore(deps): bump github.com/nats-io/nkeys from 0.4.4 to 0.4.6 in /co…
dependabot[bot] Nov 26, 2023
1cbbcad
chore: Update Dependabot
flemzord Nov 27, 2023
998a0fb
feat(ledger): various benchmark improvement (#919)
gfyrag Nov 27, 2023
84c34ec
chore: Update Dependabot
flemzord Nov 28, 2023
c53593d
feat(ledger): improve queries performances (#920)
gfyrag Nov 28, 2023
6086050
chore(deps): bump github.com/nats-io/nats-server/v2 from 2.9.8 to 2.9…
dependabot[bot] Nov 29, 2023
b2cc1d2
feat: add ledger partitionning (#867)
gfyrag Dec 4, 2023
3fff0aa
ci: Update version for actions (#471)
br-rafaelbarros Dec 4, 2023
3f8717e
feat: Sync with stack repository => fcc7dac82d00b8ecb47b09a4b391e7105…
flemzord Dec 12, 2023
a22d3a5
feat: Sync with stack repository => 56c8bf3d78050d8dd20f20e84e03a0748…
flemzord Dec 18, 2023
07c93e7
fix interaction with max and unbounded overdraft
Azorlogh Dec 20, 2023
8ebf160
move comment
Azorlogh Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 0 additions & 19 deletions .devcontainer/Dockerfile

This file was deleted.

37 changes: 0 additions & 37 deletions .devcontainer/devcontainer.json

This file was deleted.

11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
vendor
sdk
.git
.devbox
.direnv
.github
.moon
sdks
config
docs
nix
openapi
tests
worktrees
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: FormanceHQ
File renamed without changes.
16 changes: 0 additions & 16 deletions .github/workflows/benchmarks.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/codeql.yml

This file was deleted.

148 changes: 26 additions & 122 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,128 +2,32 @@ on:
push:
branches:
- main
pull_request:
types: [ assigned, opened, synchronize, reopened ]
release:
types: [ prereleased, released ]

name: Main
jobs:
Pr:
if: github.event_name == 'pull_request'
uses: formancehq/gh-workflows/.github/workflows/pr-style.yml@main

Lint:
uses: formancehq/gh-workflows/.github/workflows/golang-lint.yml@main

Control:
name: 'Control'
needs:
- Lint
uses: ./.github/workflows/template_build-control.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}

Test_postgres:
uses: formancehq/gh-workflows/.github/workflows/golang-test-postgres.yml@main

Test_sqlite:
uses: formancehq/gh-workflows/.github/workflows/golang-test.yml@main

GoReleaserBuild:
if: github.event_name != 'release'
name: 'GoReleaser Build'
needs:
- Control
- Test_sqlite
- Test_postgres
uses: ./.github/workflows/template_goreleaser-build.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}

GoReleaserRelease:
if: github.event_name == 'release'
name: 'GoReleaser Release'
needs:
- Control
- Test_sqlite
- Test_postgres
uses: ./.github/workflows/template_goreleaser-release.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}

SdkGenerate:
needs:
- GoReleaserBuild
uses: ./.github/workflows/template_sdk-generate.yaml
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}

SdkPublish:
needs:
- GoReleaserRelease
uses: ./.github/workflows/template_sdk-publish.yaml
with:
VERSION: ${{ github.event.release.tag_name }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}

DockerRelease:
if: github.event_name == 'release'
uses: ./.github/workflows/template_docker.yaml
needs:
- Control
- Test_sqlite
- Test_postgres
with:
VERSION: ${{ github.event.release.tag_name }}
APP_SHA: ${{ github.sha }}
RELEASE: ${{ github.event.action }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}

DockerBranch:
if: github.event_name != 'release'
uses: ./.github/workflows/template_docker.yaml
needs:
- Control
- Test_sqlite
- Test_postgres
with:
VERSION: develop
APP_SHA: ${{ github.sha }}
RELEASE: ${{ github.event.action }}
secrets:
NUMARY_GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
SEGMENT_WRITE_KEY_OSS: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}

# Check-pkgs:
# if: github.event_name == 'release'
# runs-on: ubuntu-latest
# env:
# DOCKER_CLI_EXPERIMENTAL: "enabled"
# needs:
# - GoReleaserRelease
# strategy:
# matrix:
# format: [ deb, rpm ]
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - uses: arduino/setup-task@v1
# with:
# version: 3.x
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# - uses: docker/setup-qemu-action@v1
# - uses: actions/cache@v2
# with:
# path: |
# ./dist/*.deb
# ./dist/*.rpm
# key: ${{ runner.os }}-go-${{ hashFiles('**/*.go') }}-${{ hashFiles('**/go.sum') }}
# - run: task goreleaser:test:${{ matrix.format }}
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache-dependency-path: go.sum
cache: true
- run: task tests
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
name: 'Ledger'
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
12 changes: 0 additions & 12 deletions .github/workflows/pr_open_target.yml

This file was deleted.

71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Ledger - Release
on:
push:
tags:
- 'v*.*.*'

jobs:
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache-dependency-path: go.sum
cache: true
- run: task tests
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
name: 'Ledger'
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)

GoReleaser:
name: GoReleaser
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
needs:
- Tests
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "NumaryBot"
password: ${{ secrets.NUMARY_GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
version: latest
install-only: true
- run: goreleaser release --clean -f .goreleaser.ledger.yml
env:
GITHUB_TOKEN: ${{ secrets.NUMARY_GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_OSS }}
20 changes: 0 additions & 20 deletions .github/workflows/template_build-control.yaml

This file was deleted.

Loading