Skip to content

Commit fafbccc

Browse files
[CAPPL 1031] (feat): Workflow Storage service (#18936)
* (feat): Hook up Workflow Storage service client to retrieve URLs for workflow artifacts * changeset * lint * (test): Amend v2 syncer handler tests for workflow/config ids * (test): Update test TOMLs
1 parent 471b116 commit fafbccc

58 files changed

Lines changed: 859 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/big-bouncy-kangaroos.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink": minor
3+
---
4+
5+
#added WF Registry Syncer V2 retrieves workflow artifacts from workflow storage service

.mockery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ packages:
417417
github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer/v2:
418418
interfaces:
419419
ORM:
420+
WorkflowClient:
420421
github.com/smartcontractkit/chainlink/v2/core/services/workflows/metering:
421422
interfaces:
422423
BillingClient:

core/capabilities/integration_tests/framework/don.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ import (
4242
p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types"
4343
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
4444
"github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities"
45-
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts"
4645
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer"
46+
wftypes "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types"
4747
"github.com/smartcontractkit/chainlink/v2/core/utils/testutils/heavyweight"
4848
)
4949

@@ -52,7 +52,7 @@ type DonContext struct {
5252
p2pNetwork *FakeRageP2PNetwork
5353
capabilityRegistry *CapabilitiesRegistry
5454
workflowRegistry *WorkflowRegistry
55-
syncerFetcherFunc artifacts.FetcherFunc
55+
syncerFetcherFunc wftypes.FetcherFunc
5656
computeFetcherFactory compute.FetcherFactory
5757
}
5858

@@ -66,7 +66,7 @@ func CreateDonContext(ctx context.Context, t *testing.T) DonContext {
6666
return DonContext{EthBlockchain: ethBlockchain, p2pNetwork: rageP2PNetwork, capabilityRegistry: capabilitiesRegistry}
6767
}
6868

69-
func CreateDonContextWithWorkflowRegistry(ctx context.Context, t *testing.T, syncerFetcherFunc artifacts.FetcherFunc,
69+
func CreateDonContextWithWorkflowRegistry(ctx context.Context, t *testing.T, syncerFetcherFunc wftypes.FetcherFunc,
7070
computeFetcherFactory compute.FetcherFactory) DonContext {
7171
donContext := CreateDonContext(ctx, t)
7272
workflowRegistry := NewWorkflowRegistry(ctx, t, donContext.EthBlockchain)
@@ -445,7 +445,7 @@ func startNewNode(ctx context.Context,
445445
newOracleFactoryFn standardcapabilities.NewOracleFactoryFn,
446446
keyV2 ethkey.KeyV2,
447447
setupCfg func(c *chainlink.Config),
448-
fetcherFunc artifacts.FetcherFunc,
448+
fetcherFunc wftypes.FetcherFunc,
449449
fetcherFactoryFunc compute.FetcherFactory,
450450
) *cltest.TestApplication {
451451
config, _ := heavyweight.FullTestDBV2(t, func(c *chainlink.Config, s *chainlink.Secrets) {

core/config/capabilities_config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ type CapabilitiesWorkflowRegistry interface {
3030
MaxConfigSize() utils.FileSize
3131
RelayID() types.RelayID
3232
SyncStrategy() string
33+
WorkflowStorage() WorkflowStorage
34+
}
35+
36+
type WorkflowStorage interface {
37+
URL() string
38+
TLSEnabled() bool
3339
}
3440

3541
type GatewayConnector interface {

core/config/docs/core.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,12 @@ MaxConfigSize = '50.00kb' # Default
514514
# Options are: event which watches for contract events or reconciliation which diffs workflow metadata state.
515515
SyncStrategy = 'event' # Default
516516

517+
[Capabilities.WorkflowRegistry.WorkflowStorage]
518+
# URL is the location for the workflow storage service to be communicated with.
519+
URL = "localhost:4566" # Default
520+
# TLSEnabled enables TLS to be used to secure communication with the workflow storage service. This is enabled by default.
521+
TLSEnabled = true # Default
522+
517523
[Workflows]
518524
[Workflows.Limits]
519525
# Global is the maximum number of workflows that can be registered globally.

core/config/toml/types.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,20 @@ func (r *Limits) setFrom(f *Limits) {
19901990
}
19911991
}
19921992

1993+
type WorkflowStorage struct {
1994+
URL *string
1995+
TLSEnabled *bool
1996+
}
1997+
1998+
func (s *WorkflowStorage) setFrom(f *WorkflowStorage) {
1999+
if f.URL != nil {
2000+
s.URL = f.URL
2001+
}
2002+
if f.TLSEnabled != nil {
2003+
s.TLSEnabled = f.TLSEnabled
2004+
}
2005+
}
2006+
19932007
type WorkflowRegistry struct {
19942008
Address *string
19952009
NetworkID *string
@@ -1999,6 +2013,7 @@ type WorkflowRegistry struct {
19992013
MaxEncryptedSecretsSize *utils.FileSize
20002014
MaxConfigSize *utils.FileSize
20012015
SyncStrategy *string
2016+
WorkflowStorage WorkflowStorage
20022017
}
20032018

20042019
func (r *WorkflowRegistry) setFrom(f *WorkflowRegistry) {
@@ -2033,6 +2048,8 @@ func (r *WorkflowRegistry) setFrom(f *WorkflowRegistry) {
20332048
if f.SyncStrategy != nil {
20342049
r.SyncStrategy = f.SyncStrategy
20352050
}
2051+
2052+
r.WorkflowStorage.setFrom(&f.WorkflowStorage)
20362053
}
20372054

20382055
type Dispatcher struct {

core/internal/cltest/cltest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939

4040
"github.com/smartcontractkit/chainlink-common/pkg/settings/limits"
4141
"github.com/smartcontractkit/chainlink/v2/core/services/llo/retirement"
42-
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/artifacts"
4342
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/metering"
4443

4544
"github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
@@ -92,6 +91,7 @@ import (
9291
"github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc/cache"
9392
"github.com/smartcontractkit/chainlink/v2/core/services/standardcapabilities"
9493
"github.com/smartcontractkit/chainlink/v2/core/services/webhook"
94+
wftypes "github.com/smartcontractkit/chainlink/v2/core/services/workflows/types"
9595
clsessions "github.com/smartcontractkit/chainlink/v2/core/sessions"
9696
"github.com/smartcontractkit/chainlink/v2/core/static"
9797
"github.com/smartcontractkit/chainlink/v2/core/store/models"
@@ -342,9 +342,9 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn
342342
}
343343
}
344344

345-
var syncerFetcherFunc artifacts.FetcherFunc
345+
var syncerFetcherFunc wftypes.FetcherFunc
346346
for _, dep := range flagsAndDeps {
347-
syncerFetcherFunc, _ = dep.(artifacts.FetcherFunc)
347+
syncerFetcherFunc, _ = dep.(wftypes.FetcherFunc)
348348
if syncerFetcherFunc != nil {
349349
break
350350
}

core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/cron-based/go.mod

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/smartcontractkit/chainlink/core/scripts/cre/environment/exampl
33
go 1.24.2
44

55
require (
6-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250702142954-f9ce5ef305d1
6+
github.com/smartcontractkit/chainlink-common v0.9.1-0.20250811122449-9242c88f1c99
77
gopkg.in/yaml.v3 v3.0.1
88
)
99

@@ -16,7 +16,7 @@ require (
1616
github.com/cloudevents/sdk-go/binding/format/protobuf/v2 v2.16.1 // indirect
1717
github.com/cloudevents/sdk-go/v2 v2.16.1 // indirect
1818
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
19-
github.com/go-logr/logr v1.4.2 // indirect
19+
github.com/go-logr/logr v1.4.3 // indirect
2020
github.com/go-logr/stdr v1.2.2 // indirect
2121
github.com/go-playground/locales v0.14.1 // indirect
2222
github.com/go-playground/universal-translator v0.18.1 // indirect
@@ -32,42 +32,43 @@ require (
3232
github.com/modern-go/reflect2 v1.0.2 // indirect
3333
github.com/mr-tron/base58 v1.2.0 // indirect
3434
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
35-
github.com/prometheus/client_golang v1.21.1 // indirect
35+
github.com/prometheus/client_golang v1.22.0 // indirect
3636
github.com/prometheus/client_model v0.6.1 // indirect
3737
github.com/prometheus/common v0.63.0 // indirect
3838
github.com/prometheus/procfs v0.16.0 // indirect
39-
github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 // indirect
39+
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
4040
github.com/shopspring/decimal v1.4.0 // indirect
41-
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250626141212-e50b2e7ffe2d // indirect
42-
github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510 // indirect
41+
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.1 // indirect
42+
github.com/smartcontractkit/chainlink-common/pkg/values v0.0.0-20250806152407-159881c7589c // indirect
43+
github.com/smartcontractkit/libocr v0.0.0-20250408131511-c90716988ee0 // indirect
4344
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
4445
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
45-
go.opentelemetry.io/otel v1.35.0 // indirect
46+
go.opentelemetry.io/otel v1.37.0 // indirect
4647
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.10.0 // indirect
4748
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.10.0 // indirect
4849
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect
4950
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.34.0 // indirect
5051
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect
5152
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
5253
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 // indirect
53-
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.10.0 // indirect
54+
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.13.0 // indirect
5455
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.34.0 // indirect
5556
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.34.0 // indirect
56-
go.opentelemetry.io/otel/log v0.10.0 // indirect
57-
go.opentelemetry.io/otel/metric v1.35.0 // indirect
58-
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
59-
go.opentelemetry.io/otel/sdk/log v0.10.0 // indirect
60-
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
61-
go.opentelemetry.io/otel/trace v1.35.0 // indirect
57+
go.opentelemetry.io/otel/log v0.13.0 // indirect
58+
go.opentelemetry.io/otel/metric v1.37.0 // indirect
59+
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
60+
go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect
61+
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
62+
go.opentelemetry.io/otel/trace v1.37.0 // indirect
6263
go.opentelemetry.io/proto/otlp v1.5.0 // indirect
6364
go.uber.org/multierr v1.11.0 // indirect
6465
go.uber.org/zap v1.27.0 // indirect
65-
golang.org/x/crypto v0.36.0 // indirect
66-
golang.org/x/net v0.38.0 // indirect
67-
golang.org/x/sys v0.32.0 // indirect
68-
golang.org/x/text v0.23.0 // indirect
69-
google.golang.org/genproto/googleapis/api v0.0.0-20250219182151-9fdb1cabc7b2 // indirect
70-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
71-
google.golang.org/grpc v1.72.0 // indirect
66+
golang.org/x/crypto v0.40.0 // indirect
67+
golang.org/x/net v0.42.0 // indirect
68+
golang.org/x/sys v0.34.0 // indirect
69+
golang.org/x/text v0.27.0 // indirect
70+
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
71+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250519155744-55703ea1f237 // indirect
72+
google.golang.org/grpc v1.73.0 // indirect
7273
google.golang.org/protobuf v1.36.6 // indirect
7374
)

0 commit comments

Comments
 (0)