Skip to content

Commit

Permalink
chore(deps): Bumping deps
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Mar 26, 2022
1 parent e43a481 commit 4b5aba2
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 57 deletions.
23 changes: 12 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ module github.com/ViBiOh/ketchup
go 1.18

require (
github.com/ViBiOh/auth/v2 v2.12.0
github.com/ViBiOh/flags v0.1.0
github.com/ViBiOh/httputils/v4 v4.38.1
github.com/ViBiOh/mailer v1.28.0
github.com/ViBiOh/auth/v2 v2.12.1
github.com/ViBiOh/flags v1.0.0
github.com/ViBiOh/httputils/v4 v4.39.1
github.com/ViBiOh/mailer v1.28.1
github.com/golang/mock v1.6.0
github.com/jackc/pgconn v1.11.0
github.com/jackc/pgproto3/v2 v2.2.0
github.com/jackc/pgx/v4 v4.15.0
github.com/prometheus/client_golang v1.12.1
go.opentelemetry.io/otel/trace v1.5.0
go.opentelemetry.io/otel/trace v1.6.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

Expand All @@ -21,7 +21,7 @@ require (
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-redis/redis/v8 v8.11.5 // indirect
github.com/golang/protobuf v1.5.2 // indirect
Expand All @@ -38,14 +38,15 @@ require (
github.com/streadway/amqp v1.0.0 // indirect
github.com/tdewolff/minify/v2 v2.10.0 // indirect
github.com/tdewolff/parse/v2 v2.5.27 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 // indirect
go.opentelemetry.io/otel v1.5.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.5.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.30.0 // indirect
go.opentelemetry.io/otel v1.6.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.6.0 // indirect
go.opentelemetry.io/otel/internal/metric v0.27.0 // indirect
go.opentelemetry.io/otel/metric v0.27.0 // indirect
go.opentelemetry.io/otel/sdk v1.5.0 // indirect
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 // indirect
go.opentelemetry.io/otel/sdk v1.6.0 // indirect
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 // indirect
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.26.0 // indirect
)
46 changes: 26 additions & 20 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/ViBiOh/auth/v2 v2.12.0 h1:/qF3IDpsAnnCK2XfFHmyaa0eomyPf5s/mngARf39yfU=
github.com/ViBiOh/auth/v2 v2.12.0/go.mod h1:O9Ggcy+9uRHsHK18y68WvrdpFTXSwLQJ5FJCkO14RNg=
github.com/ViBiOh/flags v0.1.0 h1:adKGFXmbeCZW97B386vjZ5Q/rvWiBxa/WedOS4+teMg=
github.com/ViBiOh/flags v0.1.0/go.mod h1:W0YgB4Nqou2j/2vevgO3kyrcS2f+ci/+w+jDGzVZilk=
github.com/ViBiOh/httputils/v4 v4.38.1 h1:BndrRQDU/B7yAK6LwZxg1NVajMtwUz8CeDcmdvZnOIw=
github.com/ViBiOh/httputils/v4 v4.38.1/go.mod h1:sY+x57i1EmZjvb+uFLJVtAdjfpRlCwRjLFNPTkrPnPA=
github.com/ViBiOh/mailer v1.28.0 h1:hQLba/Bk9N+goTkXHYGRyWj7RID0+RaUa1TLZ1S2fPo=
github.com/ViBiOh/mailer v1.28.0/go.mod h1:blAdamqu+aMD8/Lz/fz9MlZ4SJK3d4nZu9BEDswnyPA=
github.com/ViBiOh/auth/v2 v2.12.1 h1:SXFAj9f2F6DJpmiCPheolCEAfiZKmqFx9r2vhir5xyg=
github.com/ViBiOh/auth/v2 v2.12.1/go.mod h1:j66TAujWpYEKO/Mwdtp1AilDarxsNVNTBk5YHAzABIA=
github.com/ViBiOh/flags v1.0.0 h1:ECiQMH2tK04PaCkPRuziWAtxYGtx2Ej8O15ZZ2Jx4Ww=
github.com/ViBiOh/flags v1.0.0/go.mod h1:W0YgB4Nqou2j/2vevgO3kyrcS2f+ci/+w+jDGzVZilk=
github.com/ViBiOh/httputils/v4 v4.39.1 h1:Mcx2AZCsHBjLVqGt3DAdwbEQo8ZLa8VIC3JChDaErlE=
github.com/ViBiOh/httputils/v4 v4.39.1/go.mod h1:obDEhyINLcPZjYHBdUbAOjFAMh2DNqY2LcT52VYLEnI=
github.com/ViBiOh/mailer v1.28.1 h1:46LyhrQcfv+4D26GWv9mwCKm3R5gL62HVC1FBBggtOE=
github.com/ViBiOh/mailer v1.28.1/go.mod h1:1mFUNoKogDQ760CSB1NpSHv0m6ToMKigWx5cyp8z2xI=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down Expand Up @@ -90,8 +90,9 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v1.2.2 h1:ahHml/yUpnlb96Rp8HCvtYVPY8ZYpxq3g7UYchIYwbs=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
Expand Down Expand Up @@ -301,8 +302,9 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tdewolff/minify/v2 v2.10.0 h1:ovVAHUcjfGrBDf1EIvsodRUVJiZK/28mMose08B7k14=
github.com/tdewolff/minify/v2 v2.10.0/go.mod h1:6XAjcHM46pFcRE0eztigFPm0Q+Cxsw8YhEWT+rDkcZM=
github.com/tdewolff/parse/v2 v2.5.27 h1:PL3LzzXaOpmdrknnOlIeO2muIBHAwiKp6TxN1RbU5gI=
Expand All @@ -319,22 +321,24 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 h1:SLme4Porm+UwX0DdHMxlwRt7FzPSE0sys81bet2o0pU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.30.0 h1:UWZ4BLzqvZOktTauQxRZONVet1hDRrvL0VxhiFWa/2Y=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.30.0/go.mod h1:OoQiI4C9O38fTJWSHQjy6qCWqRli3FFV8c1oeiA9Rs8=
go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk=
go.opentelemetry.io/otel v1.5.0 h1:DhCU8oR2sJH9rfnwPdoV/+BJ7UIN5kXHL8DuSGrPU8E=
go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydAjSAHk=
go.opentelemetry.io/otel/exporters/jaeger v1.5.0 h1:ZR7nhLSfLufS5AHk/iN11Q+W9XYwsJrVZ1Frb833d+Y=
go.opentelemetry.io/otel/exporters/jaeger v1.5.0/go.mod h1:rSeUArMBRe1eQLo1T0WxOazohN1M2mYThWJQmn1BjRQ=
go.opentelemetry.io/otel v1.6.0 h1:YV6GkGe/Ag2PKsm4rjlqdSNs0w0A5ZzxeGkxhx1T+t4=
go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOUXMTQQ=
go.opentelemetry.io/otel/exporters/jaeger v1.6.0 h1:S6NKcNwBf9DJPeVIWYp2MEsgtnM2hXcMkDh27E7U5c0=
go.opentelemetry.io/otel/exporters/jaeger v1.6.0/go.mod h1:2ZcEphvH09jWp3zi/RFeAELQp1AV7R2AOP71Fjx9h2A=
go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk=
go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw=
go.opentelemetry.io/otel/metric v0.27.0 h1:HhJPsGhJoKRSegPQILFbODU56NS/L1UE4fS1sC5kIwQ=
go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g=
go.opentelemetry.io/otel/sdk v1.5.0 h1:QKhWBbcOC9fDCZKCfPFjWTWpfIlJR+i9xiUDYrLVmZs=
go.opentelemetry.io/otel/sdk v1.5.0/go.mod h1:CU4J1v+7iEljnm1G14QjdFWOXUyYLHVh0Lh+/BTYyFg=
go.opentelemetry.io/otel/sdk v1.6.0 h1:JoriAoiNENuxxIQApR1O0k2h1Md5QegZhbentcRJpWk=
go.opentelemetry.io/otel/sdk v1.6.0/go.mod h1:PjLRUfDsoPy0zl7yrDGSUqjj43tL7rEtFdCEiGlxXRM=
go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE=
go.opentelemetry.io/otel/trace v1.5.0 h1:AKQZ9zJsBRFAp7zLdyGNkqG2rToCDIt3i5tcLzQlbmU=
go.opentelemetry.io/otel/trace v1.5.0/go.mod h1:sq55kfhjXYr1zVSyexg0w1mpa03AYXR5eyTkB9NPPdE=
go.opentelemetry.io/otel/trace v1.6.0 h1:NDzPermp9ISkhxIaJXjBTi2O60xOSHDHP/EezjOL2wo=
go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qEp4/+tZLLwJE=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
Expand All @@ -357,8 +361,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70 h1:syTAU9FwmvzEoIYMqcPHOcVm4H3U5u90WsvuYgwpETU=
golang.org/x/crypto v0.0.0-20220307211146-efcb8507fb70/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064 h1:S25/rfnfsMVgORT4/J61MJ7rdyseOZOyvLIrZEZ7s6s=
golang.org/x/crypto v0.0.0-20220321153916-2c7772ba3064/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -489,6 +493,8 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40W
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
4 changes: 2 additions & 2 deletions pkg/ketchup/ketchups.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (a App) handleCreate(w http.ResponseWriter, r *http.Request) {
return
}

if err := cache.OnModify(ctx, a.redisApp, suggestCacheKey(model.ReadUser(ctx)), nil); err != nil {
if err := cache.EvictOnSuccess(ctx, a.redisApp, suggestCacheKey(model.ReadUser(ctx)), nil); err != nil {
logger.Error("unable to evict suggests cache: %s", err)
}

Expand Down Expand Up @@ -135,7 +135,7 @@ func (a App) handleDelete(w http.ResponseWriter, r *http.Request) {
return
}

if err := cache.OnModify(ctx, a.redisApp, suggestCacheKey(model.ReadUser(ctx)), nil); err != nil {
if err := cache.EvictOnSuccess(ctx, a.redisApp, suggestCacheKey(model.ReadUser(ctx)), nil); err != nil {
logger.Error("unable to evict suggests cache: %s", err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ketchup/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (a App) suggests(ctx context.Context, ignoreIds []uint64, count uint64) []m
ignoreIds = []uint64{0}
}

items, err := cache.Retrieve(ctx, a.redisApp, suggestCacheKey(user), func() ([]model.Repository, error) {
items, err := cache.Retrieve(ctx, a.redisApp, suggestCacheKey(user), func(ctx context.Context) ([]model.Repository, error) {
return a.repositoryService.Suggest(ctx, ignoreIds, count)
}, time.Hour*24)
if err != nil {
Expand Down
10 changes: 0 additions & 10 deletions pkg/model/ketchup.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ func NewKetchup(pattern, version string, frequency KetchupFrequency, updateWhenN
}
}

// Key for breaksync
func (k Ketchup) Key() string {
return fmt.Sprintf("%d|%s", k.Repository.ID, k.Pattern)
}

// WithID generate ID of the ketchup
func (k Ketchup) WithID() Ketchup {
k.ID = sha.New(k)[:8]
Expand Down Expand Up @@ -135,11 +130,6 @@ func NewRelease(repository Repository, pattern string, version semver.Version) R
}
}

// Key for breaksync
func (r Release) Key() string {
return fmt.Sprintf("%d|%s", r.Repository.ID, r.Pattern)
}

// SetUpdated marks released as auto updated
func (r Release) SetUpdated(status uint) Release {
r.Updated = status
Expand Down
12 changes: 10 additions & 2 deletions pkg/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Config struct {
// Flags adds flags for configuring package
func Flags(fs *flag.FlagSet, prefix string) Config {
return Config{
pushURL: flags.New(prefix, "notifier", "PushUrl").Default("", nil).Label("Pushgateway URL").ToString(fs),
pushURL: flags.String(fs, prefix, "notifier", "PushUrl", "Pushgateway URL", "", nil),
}
}

Expand Down Expand Up @@ -162,6 +162,14 @@ func (a App) getKetchupToNotify(ctx context.Context, releases []model.Release) (
return userToNotify, nil
}

func releaseKey(r model.Release) string {
return fmt.Sprintf("%d|%s", r.Repository.ID, r.Pattern)
}

func ketchupKey(k model.Ketchup) string {
return fmt.Sprintf("%d|%s", k.Repository.ID, k.Pattern)
}

func (a App) syncReleasesByUser(ctx context.Context, releases []model.Release, ketchups []model.Ketchup) map[model.User][]model.Release {
usersToNotify := make(map[model.User][]model.Release)

Expand All @@ -172,7 +180,7 @@ func (a App) syncReleasesByUser(ctx context.Context, releases []model.Release, k
return releaseID
})

err := breaksync.NewSynchronization().AddSources(breaksync.NewSliceSource(releases, releaseRupture), breaksync.NewSliceSource(ketchups, nil)).AddRuptures(releaseRupture).Run(func(synchronised uint64, items []any) error {
err := breaksync.NewSynchronization().AddSources(breaksync.NewSliceSource(releases, releaseKey, releaseRupture), breaksync.NewSliceSource(ketchups, ketchupKey, nil)).Run(func(synchronised uint64, items []any) error {
if synchronised != 0 {
return nil
}
Expand Down
12 changes: 5 additions & 7 deletions pkg/provider/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type Config struct {
// Flags adds flags for configuring package
func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config {
return Config{
username: flags.New(prefix, "docker", "Username").Default("", overrides).Label("Registry Username").ToString(fs),
password: flags.New(prefix, "docker", "Password").Default("", overrides).Label("Registry Password").ToString(fs),
username: flags.String(fs, prefix, "docker", "Username", "Registry Username", "", overrides),
password: flags.String(fs, prefix, "docker", "Password", "Registry Password", "", overrides),
}
}

Expand Down Expand Up @@ -139,13 +139,13 @@ func (a App) login(ctx context.Context, repository string) (string, error) {

func browseRegistryTagsList(body io.ReadCloser, versions map[string]semver.Version, patterns map[string]semver.Pattern) error {
done := make(chan struct{})
versionsStream := make(chan any, runtime.NumCPU())
versionsStream := make(chan string, runtime.NumCPU())

go func() {
defer close(done)

for tag := range versionsStream {
tagVersion, err := semver.Parse(*(tag.(*string)))
tagVersion, err := semver.Parse(tag)
if err != nil {
continue
}
Expand All @@ -154,9 +154,7 @@ func browseRegistryTagsList(body io.ReadCloser, versions map[string]semver.Versi
}
}()

if err := httpjson.Stream(body, func() any {
return new(string)
}, versionsStream, "tags"); err != nil {
if err := httpjson.Stream(body, versionsStream, "tags", true); err != nil {
return fmt.Errorf("unable to read tags: %s", err)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ type app struct {
// Flags adds flags for configuring package
func Flags(fs *flag.FlagSet, prefix string) Config {
return Config{
token: flags.New(prefix, "github", "Token").Default("", nil).Label("OAuth Token").ToString(fs),
token: flags.String(fs, prefix, "github", "Token", "OAuth Token", "", nil),
}
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type app struct {
// Flags adds flags for configuring package
func Flags(fs *flag.FlagSet, prefix string) Config {
return Config{
enabled: flags.New(prefix, "scheduler", "Enabled").Default(true, nil).Label("Enable cron job").ToBool(fs),
timezone: flags.New(prefix, "scheduler", "Timezone").Default("Europe/Paris", nil).Label("Timezone").ToString(fs),
hour: flags.New(prefix, "scheduler", "Hour").Default("08:00", nil).Label("Hour of cron, 24-hour format").ToString(fs),
enabled: flags.Bool(fs, prefix, "scheduler", "Enabled", "Enable cron job", true, nil),
timezone: flags.String(fs, prefix, "scheduler", "Timezone", "Timezone", "Europe/Paris", nil),
hour: flags.String(fs, prefix, "scheduler", "Hour", "Hour of cron, 24-hour format", "08:00", nil),
}
}

Expand Down

0 comments on commit 4b5aba2

Please sign in to comment.