From 992a6d12ed32be96098708d5282348dee9c98972 Mon Sep 17 00:00:00 2001 From: Brandur Date: Tue, 25 Aug 2026 22:10:32 +0800 Subject: [PATCH] Upgrade to Go 1.27 + River 0.45.0 + River Pro 0.28.0 A series of upgrades to get everything onto the latest version of Go, bring in compatible River/River Pro versions, and also sneak in a SQLite performance fix for River UI. --- .github/workflows/ci.yaml | 2 +- CHANGELOG.md | 6 + Dockerfile | 2 +- Dockerfile.pro | 2 +- go.mod | 18 ++- go.sum | 36 +++--- handler_api_endpoint_test.go | 113 +++++++++--------- riverproui/go.mod | 29 ++--- riverproui/go.sum | 58 ++++----- .../prohandler/pro_handler_api_endpoints.go | 12 +- .../pro_handler_api_endpoints_test.go | 57 +++++---- 11 files changed, 156 insertions(+), 179 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f2b0d3c8..dadbf7bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,8 +19,8 @@ jobs: strategy: matrix: go-version: - - "1.25" - "1.26" + - "1.27" postgres-version: [18, 17, 16] fail-fast: false timeout-minutes: 5 diff --git a/CHANGELOG.md b/CHANGELOG.md index a981828e..d03b39a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Upgrade supported Go versions to 1.26 and 1.27. [PR #665](https://github.com/riverqueue/riverpro/pull/665). +- Update River dependency to v0.45.0. [PR #665](https://github.com/riverqueue/riverui/pull/665). +- Update River Pro dependency to v0.28.0. [PR #665](https://github.com/riverqueue/riverui/pull/665). + ## [v0.18.1] - 2026-08-23 ### Changed diff --git a/Dockerfile b/Dockerfile index 3140a0f7..39338c58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ COPY src ./src RUN npx vite build # Build the Go binary, including embedded UI files: -FROM golang:1.25.12-alpine@sha256:56961d79ea8129efddcc0b8643fd8a5416b4e6228cfd477e3fd61deb2672c587 AS build-go +FROM golang:1.26.6-alpine@sha256:3889b425f035be855a72fb4755265311293b6d414521f0a519d819df32222d83 AS build-go WORKDIR /go/src/riverui COPY go.mod go.sum ./ diff --git a/Dockerfile.pro b/Dockerfile.pro index 047f03b8..d4bd237b 100644 --- a/Dockerfile.pro +++ b/Dockerfile.pro @@ -12,7 +12,7 @@ COPY src ./src RUN npx vite build # Build the Go binary, including embedded UI files: -FROM golang:1.25.12-alpine@sha256:56961d79ea8129efddcc0b8643fd8a5416b4e6228cfd477e3fd61deb2672c587 AS build-go +FROM golang:1.26.6-alpine@sha256:3889b425f035be855a72fb4755265311293b6d414521f0a519d819df32222d83 AS build-go WORKDIR /go/src/riverui # Download main module dependencies first diff --git a/go.mod b/go.mod index a0b04f7e..77f2f6c9 100644 --- a/go.mod +++ b/go.mod @@ -1,21 +1,19 @@ module riverqueue.com/riverui -go 1.25.0 - -toolchain go1.25.7 +go 1.26.0 require ( github.com/jackc/pgerrcode v0.0.0-20250907135507-afb5586c32a6 github.com/jackc/pgx/v5 v5.10.0 github.com/riverqueue/apiframe v0.0.0-20251229202423-2b52ce1c482e - github.com/riverqueue/river v0.44.1 - github.com/riverqueue/river/riverdriver v0.44.1 - github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1 - github.com/riverqueue/river/rivershared v0.44.1 - github.com/riverqueue/river/rivertype v0.44.1 + github.com/riverqueue/river v0.45.0 + github.com/riverqueue/river/riverdriver v0.45.0 + github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0 + github.com/riverqueue/river/rivershared v0.45.0 + github.com/riverqueue/river/rivertype v0.45.0 github.com/rs/cors v1.11.1 github.com/samber/slog-http v1.12.1 - github.com/stretchr/testify v1.12.0 + github.com/stretchr/testify v1.12.1 ) require ( @@ -35,11 +33,11 @@ require ( go.opentelemetry.io/otel v1.29.0 // indirect go.opentelemetry.io/otel/trace v1.29.0 // indirect go.uber.org/goleak v1.3.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/crypto v0.52.0 // indirect golang.org/x/sync v0.22.0 // indirect golang.org/x/sys v0.45.0 // indirect golang.org/x/text v0.41.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) retract ( diff --git a/go.sum b/go.sum index 9fbe6aff..e01f71cb 100644 --- a/go.sum +++ b/go.sum @@ -23,29 +23,23 @@ github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0= github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/riverqueue/apiframe v0.0.0-20251229202423-2b52ce1c482e h1:OwOgxT3MRpOj5Mp6DhFdZP43FOQOf2hhywAuT5XZCR4= github.com/riverqueue/apiframe v0.0.0-20251229202423-2b52ce1c482e/go.mod h1:O7UmsAMjpMYuToN4au5GNXdmN1gli+5FTldgXqAfaD0= -github.com/riverqueue/river v0.44.1 h1:RTSmxsfxMA2fWmNP5fjkMBQ89g55o0jZhJdXQkAuNXs= -github.com/riverqueue/river v0.44.1/go.mod h1:IXYp7GIbWfeW1F2q/8USppMRU8zduixLgDc69FpDNHg= -github.com/riverqueue/river/riverdriver v0.44.1 h1:ZDWC5YrWD38eAWPkwIbhNLWDrU+gqy5v7MA6hsFVQmY= -github.com/riverqueue/river/riverdriver v0.44.1/go.mod h1:oYT5b5KWczcf9qxX/tUZHy6eqAwPHpqSiDz/AQQw3hU= -github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1 h1:C8oU/ca8MNmbxcUaA5MZfFBGm+zN1mtD3q0IQ5swQ/g= -github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1/go.mod h1:GDDUOTTDfULearfjknVJ+bsMWwwC+1gb4WeyXM3k0xw= -github.com/riverqueue/river/rivershared v0.44.1 h1:QTFc7vCLmdy+6MN3Tkv5gGEdkLzzv/vBc60G4A35aWk= -github.com/riverqueue/river/rivershared v0.44.1/go.mod h1:NBD6huYureyKGK91eoIm5iDPngolm57YvHu06Ma4aeM= -github.com/riverqueue/river/rivertype v0.44.1 h1:G9UnsBJhlndreMPdjHSoY8wp+OTAsDTTzOpwvZQJv6M= -github.com/riverqueue/river/rivertype v0.44.1/go.mod h1:D1Ad+EaZiaXbQbJcJcfeicXJMBKno0n6UcfKI5Q7DIQ= +github.com/riverqueue/river v0.45.0 h1:gjp+eYx5sB+sA14URXls6EHdXOTbHRnXGN5u+FvYnH0= +github.com/riverqueue/river v0.45.0/go.mod h1:T2ijF1pvui0DUKZvF2FEyvBTAKfXhYb99HjEbRoEwUM= +github.com/riverqueue/river/riverdriver v0.45.0 h1:oGSiSw5Pjv6toclmsvcc1VCWhtQXvB0DnA8CGzK+5/k= +github.com/riverqueue/river/riverdriver v0.45.0/go.mod h1:s6UignsfjQ4pgQPjEcFpH9mpuNgf30jxKxsPbSxqEHU= +github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0 h1:6ST4tuudkk2rJrGxmlDDKOi09jI3R/30sd3Csq03QD0= +github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0/go.mod h1:FgK37hDtuuL/MsqvysdS6kXzsOQiwyK/qV3+9OvpO+g= +github.com/riverqueue/river/rivershared v0.45.0 h1:xWEqjaNBhqpE5QpPcCcPTXZNzPajI5PIYcMVdAjH0sM= +github.com/riverqueue/river/rivershared v0.45.0/go.mod h1:55trQ+PMQPBrn8Za4J8NeNrkPdncxCIRfktO4Xr26WY= +github.com/riverqueue/river/rivertype v0.45.0 h1:AITFM9ZB+kkd/PsWT7YuQ211V/kPCSv4awjSfnHVWMs= +github.com/riverqueue/river/rivertype v0.45.0/go.mod h1:XKkcRQR6zm8RR/JQa1Q2ywpj8uXQu21quPa4Lpw1Xhw= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/samber/slog-http v1.12.1 h1:XFJhZbO7GeGBJalEMzf6QUNHgH9kECBSd/G94f28xy8= @@ -53,8 +47,8 @@ github.com/samber/slog-http v1.12.1/go.mod h1:PAcQQrYFo5KM7Qbk50gNNwKEAMGCyfsw6G github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI= -github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.19.0 h1:xwxm7n691Uf3u5OFjzngavjGTh55KX5q/9w9xHW88JU= github.com/tidwall/gjson v1.19.0/go.mod h1:V37/opeE/JbLUOfH0QTXiNez2l0RUjYUhpT4szFQAfc= @@ -72,6 +66,8 @@ go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt3 go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= @@ -81,8 +77,4 @@ golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/handler_api_endpoint_test.go b/handler_api_endpoint_test.go index a5b918a9..df2a133f 100644 --- a/handler_api_endpoint_test.go +++ b/handler_api_endpoint_test.go @@ -23,7 +23,6 @@ import ( "github.com/riverqueue/river/rivershared/riversharedtest" "github.com/riverqueue/river/rivershared/startstop" "github.com/riverqueue/river/rivershared/uniquestates" - "github.com/riverqueue/river/rivershared/util/ptrutil" "github.com/riverqueue/river/rivertype" "riverqueue.com/riverui/internal/apibundle" @@ -242,10 +241,10 @@ func TestAPIHandlerAutocompleteList(t *testing.T) { setupTestKinds := func(t *testing.T, bundle *setupEndpointTestBundle) { t.Helper() ctx := context.Background() - testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: ptrutil.Ptr("alpha_job")}) - testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: ptrutil.Ptr("alpha_task")}) - testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: ptrutil.Ptr("beta_job")}) - testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: ptrutil.Ptr("gamma_job")}) + testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: new("alpha_job")}) + testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: new("alpha_task")}) + testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: new("beta_job")}) + testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{Kind: new("gamma_job")}) } runAutocompleteTests(t, autocompleteFacetJobKind, setupTestKinds) @@ -257,10 +256,10 @@ func TestAPIHandlerAutocompleteList(t *testing.T) { setupTestQueues := func(t *testing.T, bundle *setupEndpointTestBundle) { t.Helper() ctx := context.Background() - testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: ptrutil.Ptr("alpha_queue")}) - testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: ptrutil.Ptr("alpha_task")}) - testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: ptrutil.Ptr("beta_queue")}) - testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: ptrutil.Ptr("gamma_queue")}) + testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: new("alpha_queue")}) + testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: new("alpha_task")}) + testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: new("beta_queue")}) + testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{Name: new("gamma_queue")}) } runAutocompleteTests(t, autocompleteFacetQueueName, setupTestQueues) @@ -287,7 +286,7 @@ func TestAPIHandlerAutocompleteListCustomSchema(t *testing.T) { endpoint, bundle := setupEndpointWithCustomSchema(ctx, t, newAutocompleteListEndpoint) schema := bundle.client.Schema() - jobParams := testfactory.Job_Build(t, &testfactory.JobOpts{Kind: ptrutil.Ptr("custom_schema_job")}) + jobParams := testfactory.Job_Build(t, &testfactory.JobOpts{Kind: new("custom_schema_job")}) jobParams.Schema = schema _, err := bundle.exec.JobInsertFull(ctx, jobParams) require.NoError(t, err) @@ -301,7 +300,7 @@ func TestAPIHandlerAutocompleteListCustomSchema(t *testing.T) { jobKindResp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &autocompleteListRequest{ Facet: autocompleteFacetJobKind, - Match: ptrutil.Ptr("custom_schema_job"), + Match: new("custom_schema_job"), }) require.NoError(t, err) require.Len(t, jobKindResp.Data, 1) @@ -309,7 +308,7 @@ func TestAPIHandlerAutocompleteListCustomSchema(t *testing.T) { queueNameResp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &autocompleteListRequest{ Facet: autocompleteFacetQueueName, - Match: ptrutil.Ptr("custom_schema_queue"), + Match: new("custom_schema_queue"), }) require.NoError(t, err) require.Len(t, queueNameResp.Data, 1) @@ -559,14 +558,14 @@ func TestAPIHandlerJobList(t *testing.T) { job1 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ EncodedArgs: []byte(`{"id":1970670598291982290}`), - Kind: ptrutil.Ptr("kind1"), - Queue: ptrutil.Ptr("queue1"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Kind: new("kind1"), + Queue: new("queue1"), + State: new(rivertype.JobStateRunning), }) job2 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Kind: ptrutil.Ptr("kind2"), - Queue: ptrutil.Ptr("queue2"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Kind: new("kind2"), + Queue: new("queue2"), + State: new(rivertype.JobStateRunning), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{}) @@ -599,7 +598,7 @@ func TestAPIHandlerJobList(t *testing.T) { resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{ IDs: []int64{job1.ID, job2.ID}, - State: ptrutil.Ptr(rivertype.JobStateAvailable), + State: new(rivertype.JobStateAvailable), }) require.NoError(t, err) require.Len(t, resp.Data, 2) @@ -613,12 +612,12 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) job := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Kind: ptrutil.Ptr("kind1"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Kind: new("kind1"), + State: new(rivertype.JobStateRunning), }) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Kind: ptrutil.Ptr("kind2"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Kind: new("kind2"), + State: new(rivertype.JobStateRunning), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{ @@ -635,15 +634,15 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Priority: ptrutil.Ptr(1), + Priority: new(1), }) job2 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Priority: ptrutil.Ptr(2), + Priority: new(2), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{ Priorities: []int16{2}, - State: ptrutil.Ptr(rivertype.JobStateAvailable), + State: new(rivertype.JobStateAvailable), }) require.NoError(t, err) require.Len(t, resp.Data, 1) @@ -656,12 +655,12 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) job := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Queue: ptrutil.Ptr("queue1"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Queue: new("queue1"), + State: new(rivertype.JobStateRunning), }) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - Queue: ptrutil.Ptr("queue2"), - State: ptrutil.Ptr(rivertype.JobStateRunning), + Queue: new("queue2"), + State: new(rivertype.JobStateRunning), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{ @@ -678,15 +677,15 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) job1 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), Tags: []string{"alpha-tag", "shared"}, }) job2 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), Tags: []string{"beta"}, }) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), Tags: []string{"ALPHA-TAG"}, }) @@ -705,10 +704,10 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) job := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateAvailable), + State: new(rivertype.JobStateAvailable), }) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), }) state := rivertype.JobStateAvailable @@ -726,14 +725,14 @@ func TestAPIHandlerJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobListEndpoint) job := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), }) _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobListRequest{ - Limit: ptrutil.Ptr(1), + Limit: new(1), }) require.NoError(t, err) require.Len(t, resp.Data, 1) @@ -747,7 +746,7 @@ func TestAPIHandlerJobListCustomSchema(t *testing.T) { ctx := context.Background() endpoint, bundle := setupEndpointWithCustomSchema(ctx, t, newJobListEndpoint) jobParams := testfactory.Job_Build(t, &testfactory.JobOpts{ - State: ptrutil.Ptr(rivertype.JobStateRunning), + State: new(rivertype.JobStateRunning), Tags: []string{"custom-schema-tag"}, }) jobParams.Schema = bundle.client.Schema() @@ -788,12 +787,12 @@ func TestAPIHandlerJobRetry(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newJobRetryEndpoint) job1 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + FinalizedAt: new(time.Now()), + State: new(rivertype.JobStateDiscarded), }) job2 := testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + FinalizedAt: new(time.Now()), + State: new(rivertype.JobStateDiscarded), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &jobRetryRequest{JobIDs: []int64String{int64String(job1.ID), int64String(job2.ID)}}) @@ -826,8 +825,8 @@ func TestAPIHandlerJobRetry(t *testing.T) { uniqueStates := uniquestates.UniqueStatesToBitmask([]rivertype.JobState{rivertype.JobStateAvailable}) discardedParams := testfactory.Job_Build(t, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + FinalizedAt: new(time.Now()), + State: new(rivertype.JobStateDiscarded), }) discardedParams.UniqueKey = uniqueKey discardedParams.UniqueStates = uniqueStates @@ -915,7 +914,7 @@ func TestAPIHandlerQueueList(t *testing.T) { queue1 := testfactory.Queue(ctx, t, bundle.exec, nil) _ = testfactory.Queue(ctx, t, bundle.exec, nil) - resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &queueListRequest{Limit: ptrutil.Ptr(1)}) + resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &queueListRequest{Limit: new(1)}) require.NoError(t, err) require.Len(t, resp.Data, 1) require.Equal(t, queue1.Name, resp.Data[0].Name) @@ -960,7 +959,7 @@ func TestAPIHandlerQueueResume(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newQueueResumeEndpoint) queue := testfactory.Queue(ctx, t, bundle.exec, &testfactory.QueueOpts{ - PausedAt: ptrutil.Ptr(time.Now()), + PausedAt: new(time.Now()), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &queueResumeRequest{Name: queue.Name}) @@ -1060,34 +1059,34 @@ func TestStateAndCountGetEndpoint(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, newStateAndCountGetEndpoint) - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateAvailable)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateAvailable)}) for range 2 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateCancelled), FinalizedAt: ptrutil.Ptr(time.Now())}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateCancelled), FinalizedAt: new(time.Now())}) } for range 3 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateCompleted), FinalizedAt: ptrutil.Ptr(time.Now())}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateCompleted), FinalizedAt: new(time.Now())}) } for range 4 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateDiscarded), FinalizedAt: ptrutil.Ptr(time.Now())}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateDiscarded), FinalizedAt: new(time.Now())}) } for range 5 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStatePending)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStatePending)}) } for range 6 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateRetryable)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateRetryable)}) } for range 7 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateRunning)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateRunning)}) } for range 8 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateScheduled)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateScheduled)}) } resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &stateAndCountGetRequest{}) @@ -1111,7 +1110,7 @@ func TestStateAndCountGetEndpoint(t *testing.T) { const queryCacheSkipThreshold = 3 for range queryCacheSkipThreshold + 1 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateAvailable)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateAvailable)}) } _, err := endpoint.queryCacher.RunQuery(ctx) @@ -1131,7 +1130,7 @@ func TestStateAndCountGetEndpoint(t *testing.T) { const queryCacheSkipThreshold = 3 for range queryCacheSkipThreshold - 1 { - _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: ptrutil.Ptr(rivertype.JobStateAvailable)}) + _ = testfactory.Job(ctx, t, bundle.exec, &testfactory.JobOpts{State: new(rivertype.JobStateAvailable)}) } _, err := endpoint.queryCacher.RunQuery(ctx) diff --git a/riverproui/go.mod b/riverproui/go.mod index 00ad0bd1..792c55db 100644 --- a/riverproui/go.mod +++ b/riverproui/go.mod @@ -1,23 +1,21 @@ module riverqueue.com/riverui/riverproui -go 1.25.0 - -toolchain go1.25.7 +go 1.26.0 require ( github.com/google/uuid v1.6.0 github.com/jackc/pgx/v5 v5.10.0 github.com/riverqueue/apiframe v0.0.0-20260817233638-c78932f9ac68 - github.com/riverqueue/river v0.44.1 - github.com/riverqueue/river/riverdriver v0.44.1 - github.com/riverqueue/river/rivershared v0.44.1 - github.com/riverqueue/river/rivertype v0.44.1 - github.com/stretchr/testify v1.12.0 + github.com/riverqueue/river v0.45.0 + github.com/riverqueue/river/riverdriver v0.45.0 + github.com/riverqueue/river/rivershared v0.45.0 + github.com/riverqueue/river/rivertype v0.45.0 + github.com/stretchr/testify v1.12.1 modernc.org/sqlite v1.56.0 - riverqueue.com/riverpro v0.27.2 - riverqueue.com/riverpro/driver v0.27.2 - riverqueue.com/riverpro/driver/riverpropgxv5 v0.27.2 - riverqueue.com/riverpro/driver/riverprosqlite v0.27.2 + riverqueue.com/riverpro v0.28.0 + riverqueue.com/riverpro/driver v0.28.0 + riverqueue.com/riverpro/driver/riverpropgxv5 v0.28.0 + riverqueue.com/riverpro/driver/riverprosqlite v0.28.0 riverqueue.com/riverui v0.18.0 ) @@ -38,8 +36,8 @@ require ( github.com/mattn/go-isatty v0.0.24 // indirect github.com/ncruces/go-strftime v1.0.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1 // indirect - github.com/riverqueue/river/riverdriver/riversqlite v0.44.1 // indirect + github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0 // indirect + github.com/riverqueue/river/riverdriver/riversqlite v0.45.0 // indirect github.com/rs/cors v1.11.1 // indirect github.com/samber/slog-http v1.12.1 // indirect github.com/tidwall/gjson v1.19.0 // indirect @@ -49,7 +47,7 @@ require ( go.opentelemetry.io/otel v1.29.0 // indirect go.opentelemetry.io/otel/trace v1.29.0 // indirect go.uber.org/goleak v1.3.0 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/crypto v0.55.0 // indirect golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect golang.org/x/sync v0.22.0 // indirect @@ -58,7 +56,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d // indirect google.golang.org/protobuf v1.36.11 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect modernc.org/libc v1.74.4 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect diff --git a/riverproui/go.sum b/riverproui/go.sum index 364f0a29..bb9d4f96 100644 --- a/riverproui/go.sum +++ b/riverproui/go.sum @@ -35,10 +35,6 @@ github.com/jackc/pgx/v5 v5.10.0 h1:VhSvgU2jSli8o3AqIEOTJr7rZwAEUVo4E4XhR94Zfr0= github.com/jackc/pgx/v5 v5.10.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.5.0 h1:pLqT2kq1zpHW/1D18QMjMpdtX7cekxqtJJjg5ANyWw0= github.com/leodido/go-urn v1.5.0/go.mod h1:9BORnCDhdPBJNDEX+w1bJisa8yOKYi116VeO96s4ifE= github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= @@ -50,22 +46,20 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/riverqueue/apiframe v0.0.0-20260817233638-c78932f9ac68 h1:Ogb44HcUITrxC+61EsKNvt7yiHlgFQeP5sx418G0QYg= github.com/riverqueue/apiframe v0.0.0-20260817233638-c78932f9ac68/go.mod h1:bPlBpuQxWanRYcrZJR/1JHgJ1tgPl7mWaKKgT/oRdac= -github.com/riverqueue/river v0.44.1 h1:RTSmxsfxMA2fWmNP5fjkMBQ89g55o0jZhJdXQkAuNXs= -github.com/riverqueue/river v0.44.1/go.mod h1:IXYp7GIbWfeW1F2q/8USppMRU8zduixLgDc69FpDNHg= -github.com/riverqueue/river/riverdriver v0.44.1 h1:ZDWC5YrWD38eAWPkwIbhNLWDrU+gqy5v7MA6hsFVQmY= -github.com/riverqueue/river/riverdriver v0.44.1/go.mod h1:oYT5b5KWczcf9qxX/tUZHy6eqAwPHpqSiDz/AQQw3hU= -github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1 h1:C8oU/ca8MNmbxcUaA5MZfFBGm+zN1mtD3q0IQ5swQ/g= -github.com/riverqueue/river/riverdriver/riverpgxv5 v0.44.1/go.mod h1:GDDUOTTDfULearfjknVJ+bsMWwwC+1gb4WeyXM3k0xw= -github.com/riverqueue/river/riverdriver/riversqlite v0.44.1 h1:t4+o/Xhxhvnh13XS7PNYn8jf39e13KNmIwo3E4iFQsY= -github.com/riverqueue/river/riverdriver/riversqlite v0.44.1/go.mod h1:Dv5tvswubq5jgqd8i/ZeA3X/+9xgYlUylqXVCkbHoWc= -github.com/riverqueue/river/rivershared v0.44.1 h1:QTFc7vCLmdy+6MN3Tkv5gGEdkLzzv/vBc60G4A35aWk= -github.com/riverqueue/river/rivershared v0.44.1/go.mod h1:NBD6huYureyKGK91eoIm5iDPngolm57YvHu06Ma4aeM= -github.com/riverqueue/river/rivertype v0.44.1 h1:G9UnsBJhlndreMPdjHSoY8wp+OTAsDTTzOpwvZQJv6M= -github.com/riverqueue/river/rivertype v0.44.1/go.mod h1:D1Ad+EaZiaXbQbJcJcfeicXJMBKno0n6UcfKI5Q7DIQ= +github.com/riverqueue/river v0.45.0 h1:gjp+eYx5sB+sA14URXls6EHdXOTbHRnXGN5u+FvYnH0= +github.com/riverqueue/river v0.45.0/go.mod h1:T2ijF1pvui0DUKZvF2FEyvBTAKfXhYb99HjEbRoEwUM= +github.com/riverqueue/river/riverdriver v0.45.0 h1:oGSiSw5Pjv6toclmsvcc1VCWhtQXvB0DnA8CGzK+5/k= +github.com/riverqueue/river/riverdriver v0.45.0/go.mod h1:s6UignsfjQ4pgQPjEcFpH9mpuNgf30jxKxsPbSxqEHU= +github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0 h1:6ST4tuudkk2rJrGxmlDDKOi09jI3R/30sd3Csq03QD0= +github.com/riverqueue/river/riverdriver/riverpgxv5 v0.45.0/go.mod h1:FgK37hDtuuL/MsqvysdS6kXzsOQiwyK/qV3+9OvpO+g= +github.com/riverqueue/river/riverdriver/riversqlite v0.45.0 h1:3DuGn28+6s/OWOpsjMpsgryLP4Wt3V2AhuWDVM6P+u0= +github.com/riverqueue/river/riverdriver/riversqlite v0.45.0/go.mod h1:eMi2dPTGz/UWRJWlKeMRswYN4VLud4toWEx5BV9Idg8= +github.com/riverqueue/river/rivershared v0.45.0 h1:xWEqjaNBhqpE5QpPcCcPTXZNzPajI5PIYcMVdAjH0sM= +github.com/riverqueue/river/rivershared v0.45.0/go.mod h1:55trQ+PMQPBrn8Za4J8NeNrkPdncxCIRfktO4Xr26WY= +github.com/riverqueue/river/rivertype v0.45.0 h1:AITFM9ZB+kkd/PsWT7YuQ211V/kPCSv4awjSfnHVWMs= +github.com/riverqueue/river/rivertype v0.45.0/go.mod h1:XKkcRQR6zm8RR/JQa1Q2ywpj8uXQu21quPa4Lpw1Xhw= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= -github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/samber/slog-http v1.12.1 h1:XFJhZbO7GeGBJalEMzf6QUNHgH9kECBSd/G94f28xy8= @@ -73,8 +67,8 @@ github.com/samber/slog-http v1.12.1/go.mod h1:PAcQQrYFo5KM7Qbk50gNNwKEAMGCyfsw6G github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI= -github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.19.0 h1:xwxm7n691Uf3u5OFjzngavjGTh55KX5q/9w9xHW88JU= github.com/tidwall/gjson v1.19.0/go.mod h1:V37/opeE/JbLUOfH0QTXiNez2l0RUjYUhpT4szFQAfc= @@ -92,8 +86,8 @@ go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt3 go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= -go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA= @@ -115,11 +109,7 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d/go. google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= modernc.org/cc/v4 v4.29.1 h1:MKgdCV3WykTSPqpVrnxdEDS0HEd2FHpKZDzxzU5LyeI= modernc.org/cc/v4 v4.29.1/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI= modernc.org/ccgo/v4 v4.34.6 h1:sBgfIwyN0TQ9C5hwIeuqyeAKyMWnbvj2fvpF4L11uzU= @@ -148,13 +138,13 @@ modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -riverqueue.com/riverpro v0.27.2 h1:doaB3bkxNhwoToj59iwzwmbIMgpspzMAD1t6ldwd4wg= -riverqueue.com/riverpro v0.27.2/go.mod h1:36aj62Omht8Ec0lIfIopwAbC7Vh7aEWqfISzIIk7Kso= -riverqueue.com/riverpro/driver v0.27.2 h1:GfBzjZChJ/AWi7dDSAJ8jS3ueqzJm3126sbRvRjK7J0= -riverqueue.com/riverpro/driver v0.27.2/go.mod h1:mYlDDwJ8VZOL0kA6aBWBqmgJNHF2vm/yQU/4sqbFQjo= -riverqueue.com/riverpro/driver/riverpropgxv5 v0.27.2 h1:FiPnuDUamtHWZSNdVHVmACX3AqngkUOAWGPhNtzSY0o= -riverqueue.com/riverpro/driver/riverpropgxv5 v0.27.2/go.mod h1:KUkDGvFs882PqMQDEgjtrlPVlOm+ncr8fgfHkz6PuEc= -riverqueue.com/riverpro/driver/riverprosqlite v0.27.2 h1:gJ2RSSWpJufOZJoVDW3YwqQg/svd2I85PvTQ8VKZEWw= -riverqueue.com/riverpro/driver/riverprosqlite v0.27.2/go.mod h1:CW5LvzVds0IU3dKBMbCWrDkNg6n0+PKazCMYbDaCClI= +riverqueue.com/riverpro v0.28.0 h1:4CR7m5A5El0LUfWBsK7XYHaq1krUrykGErwRkK0aSg8= +riverqueue.com/riverpro v0.28.0/go.mod h1:Ys434Bl7Gkvao1T3G9Hm6r5BKIesDKs6E/ixg0g+Y+E= +riverqueue.com/riverpro/driver v0.28.0 h1:AC0BCRMz2xydnKl8XjwtNgPkjxSKuIVTJVnUhNRRlzo= +riverqueue.com/riverpro/driver v0.28.0/go.mod h1:GqguUahntTKcKrSvIe+17E2K5xA/7S3ostvxnXOe9z4= +riverqueue.com/riverpro/driver/riverpropgxv5 v0.28.0 h1:NaCuHwiF/30d7JaggENMMF133fZ6lHbCcBEz94Nw/3s= +riverqueue.com/riverpro/driver/riverpropgxv5 v0.28.0/go.mod h1:I5V49eybOM3BP29d9fEJ/ZmoKDpWvmoka/yMjsdkvko= +riverqueue.com/riverpro/driver/riverprosqlite v0.28.0 h1:6KY42gMAFgraK2b0yprJunV+rWjdA3toUAlOVRPi37I= +riverqueue.com/riverpro/driver/riverprosqlite v0.28.0/go.mod h1:Gq/fnZNoTaFbmathC2b4dWPe/Fw/ShBrtkRcHFT/krQ= riverqueue.com/riverui v0.18.0 h1:a7UWNT5c1NF3G4rRudv9GRUNNL6J/co8Wdv7DvJelAk= riverqueue.com/riverui v0.18.0/go.mod h1:MnmpKieZCfc/IR8oLkAYFzDKrdo0srbThvULgdOh0/s= diff --git a/riverproui/internal/prohandler/pro_handler_api_endpoints.go b/riverproui/internal/prohandler/pro_handler_api_endpoints.go index aa81b1f7..a5937412 100644 --- a/riverproui/internal/prohandler/pro_handler_api_endpoints.go +++ b/riverproui/internal/prohandler/pro_handler_api_endpoints.go @@ -445,18 +445,15 @@ func (a *workflowTaskSignalsEndpoint[TTx]) Execute(ctx context.Context, req *wor result, err := workflow.Signals().ListForTask(ctx, req.TaskName, params) if err != nil { - var signalKeyUndeclaredErr *riverworkflow.SignalKeyUndeclaredError - if errors.As(err, &signalKeyUndeclaredErr) { + if signalKeyUndeclaredErr, ok := errors.AsType[*riverworkflow.SignalKeyUndeclaredError](err); ok { return nil, apierror.NewBadRequestf("%s.", signalKeyUndeclaredErr) } - var signalTaskDeclaresNoSignalKeysErr *riverworkflow.SignalTaskDeclaresNoSignalKeysError - if errors.As(err, &signalTaskDeclaresNoSignalKeysErr) { + if signalTaskDeclaresNoSignalKeysErr, ok := errors.AsType[*riverworkflow.SignalTaskDeclaresNoSignalKeysError](err); ok { return nil, apierror.NewBadRequestf("%s.", signalTaskDeclaresNoSignalKeysErr) } - var signalUnknownTaskErr *riverworkflow.SignalUnknownTaskError - if errors.As(err, &signalUnknownTaskErr) { + if signalUnknownTaskErr, ok := errors.AsType[*riverworkflow.SignalUnknownTaskError](err); ok { return nil, apierror.NewNotFoundf("%s.", signalUnknownTaskErr) } @@ -654,8 +651,7 @@ func (a *workflowTaskWaitDiagnosticsEndpoint[TTx]) Execute(ctx context.Context, result, err := workflow.WaitDiagnostics(ctx, req.TaskName, nil) if err != nil { - var signalUnknownTaskErr *riverworkflow.SignalUnknownTaskError - if errors.As(err, &signalUnknownTaskErr) { + if signalUnknownTaskErr, ok := errors.AsType[*riverworkflow.SignalUnknownTaskError](err); ok { return nil, apierror.NewNotFoundf("%s.", signalUnknownTaskErr) } diff --git a/riverproui/internal/prohandler/pro_handler_api_endpoints_test.go b/riverproui/internal/prohandler/pro_handler_api_endpoints_test.go index b7f13be9..ad37fac3 100644 --- a/riverproui/internal/prohandler/pro_handler_api_endpoints_test.go +++ b/riverproui/internal/prohandler/pro_handler_api_endpoints_test.go @@ -20,7 +20,6 @@ import ( "github.com/riverqueue/river/riverdriver" "github.com/riverqueue/river/rivershared/riversharedtest" "github.com/riverqueue/river/rivershared/startstop" - "github.com/riverqueue/river/rivershared/util/ptrutil" "github.com/riverqueue/river/rivertype" "riverqueue.com/riverpro" @@ -104,8 +103,8 @@ func TestProAPIHandlerPeriodicJobList(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, NewPeriodicJobListEndpoint) - job1 := protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{ID: ptrutil.Ptr("alpha"), NextRunAt: ptrutil.Ptr(time.Now().Add(time.Minute)), Schema: bundle.schema}) - job2 := protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{ID: ptrutil.Ptr("beta"), NextRunAt: ptrutil.Ptr(time.Now().Add(2 * time.Minute)), Schema: bundle.schema}) + job1 := protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{ID: new("alpha"), NextRunAt: new(time.Now().Add(time.Minute)), Schema: bundle.schema}) + job2 := protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{ID: new("beta"), NextRunAt: new(time.Now().Add(2 * time.Minute)), Schema: bundle.schema}) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &periodicJobListRequest{}) require.NoError(t, err) @@ -122,7 +121,7 @@ func TestProAPIHandlerPeriodicJobList(t *testing.T) { job1 := protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{Schema: bundle.schema}) _ = protestfactory.PeriodicJob(ctx, t, bundle.exec, &protestfactory.PeriodicJobOpts{Schema: bundle.schema}) - resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &periodicJobListRequest{Limit: ptrutil.Ptr(1)}) + resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &periodicJobListRequest{Limit: new(1)}) require.NoError(t, err) require.Len(t, resp.Data, 1) require.Equal(t, job1.ID, resp.Data[0].ID) @@ -178,9 +177,9 @@ func TestProAPIHandlerWorkflowGet(t *testing.T) { dependencyJob := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ EncodedArgs: []byte(`{"id":1970670598291982290,"max":9223372036854775807}`), - FinalizedAt: ptrutil.Ptr(now.Add(-2 * time.Minute)), + FinalizedAt: new(now.Add(-2 * time.Minute)), Metadata: workflowMetadata("wf_get", "collect_inputs", nil), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) waitingJob := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ @@ -192,7 +191,7 @@ func TestProAPIHandlerWorkflowGet(t *testing.T) { }, }, }), - State: ptrutil.Ptr(rivertype.JobStatePending), + State: new(rivertype.JobStatePending), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &workflowGetRequest{ID: "wf_get"}) @@ -291,9 +290,9 @@ func TestProAPIHandlerWorkflowListCustomSchema(t *testing.T) { makeWorkflowJob(ctx, t, bundle.exec, bundle.schema, "active_workflow", "active_task", nil) jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("inactive_workflow", "inactive_task", nil), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) activeResp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &workflowListRequest{State: "active"}) @@ -740,19 +739,19 @@ func TestProAPIHandlerWorkflowRetry(t *testing.T) { endpoint, bundle := setupEndpoint(ctx, t, NewWorkflowRetryEndpoint) job1 := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_all_1", "task1", nil), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + State: new(rivertype.JobStateDiscarded), }) job2 := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_all_1", "task2", nil), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) job3 := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_all_1", "task3", []string{"task1", "task2"}), - State: ptrutil.Ptr(rivertype.JobStateCancelled), + State: new(rivertype.JobStateCancelled), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &workflowRetryRequest{ID: "wf_all_1"}) @@ -769,14 +768,14 @@ func TestProAPIHandlerWorkflowRetry(t *testing.T) { // Build jobs with specific states jobCompleted := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_failed_only", "done", nil), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) jobDiscarded := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_failed_only", "failed", nil), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + State: new(rivertype.JobStateDiscarded), }) _ = jobCompleted @@ -794,19 +793,19 @@ func TestProAPIHandlerWorkflowRetry(t *testing.T) { // a -> b -> c; mark a as discarded, others completed jobA := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_failed_downstream", "a", nil), - State: ptrutil.Ptr(rivertype.JobStateDiscarded), + State: new(rivertype.JobStateDiscarded), }) jobB := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_failed_downstream", "b", []string{"a"}), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) jobC := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_failed_downstream", "c", []string{"b"}), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) resp, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &workflowRetryRequest{ID: "wf_failed_downstream", Mode: "failed_and_downstream"}) @@ -825,10 +824,10 @@ func TestProAPIHandlerWorkflowRetry(t *testing.T) { maxAttempts := 5 job := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ Attempt: &attempt, - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_reset_history", "t1", nil), MaxAttempts: func() *int { v := maxAttempts; return &v }(), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) // Without resetting history, Attempt stays the same and MaxAttempts increments by 1 @@ -844,10 +843,10 @@ func TestProAPIHandlerWorkflowRetry(t *testing.T) { attempt2 := 3 job2 := jobWithSchema(ctx, t, bundle.exec, bundle.schema, &testfactory.JobOpts{ Attempt: &attempt2, - FinalizedAt: ptrutil.Ptr(time.Now()), + FinalizedAt: new(time.Now()), Metadata: workflowMetadata("wf_reset_history2", "t1", nil), MaxAttempts: func() *int { v := maxAttempts; return &v }(), - State: ptrutil.Ptr(rivertype.JobStateCompleted), + State: new(rivertype.JobStateCompleted), }) respReset, err := apitest.InvokeHandler(ctx, endpoint.Execute, testMountOpts(t), &workflowRetryRequest{ID: "wf_reset_history2", ResetHistory: true})