From e195300f3bb8a25997f372e520d10c7b53c7d91d Mon Sep 17 00:00:00 2001 From: ShashwatDadhich Date: Fri, 3 May 2024 16:17:13 +0530 Subject: [PATCH] common lib version upgrade --- go.mod | 4 +- go.sum | 8 ++-- .../common-lib/pubsub-lib/JetStreamUtil.go | 45 +++++++++++++++---- .../pubsub-lib/PubSubClientService.go | 15 ++++--- vendor/github.com/robfig/cron/v3/README.md | 4 +- vendor/github.com/robfig/cron/v3/chain.go | 4 +- vendor/github.com/robfig/cron/v3/cron.go | 7 ++- vendor/github.com/robfig/cron/v3/doc.go | 31 ++++++++++--- vendor/github.com/robfig/cron/v3/option.go | 2 +- vendor/modules.txt | 4 +- wire_gen.go | 5 ++- 11 files changed, 95 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index 73ac9f07..4f7ba66c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/caarlos0/env v3.5.0+incompatible - github.com/devtron-labs/common-lib v0.0.16-0.20240318063710-69cb957d019a + github.com/devtron-labs/common-lib v0.0.16-0.20240503082245-7ab933f8381f github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb github.com/gammazero/workerpool v0.0.0-20200206003619-019d125201ab github.com/go-git/go-git/v5 v5.11.0 @@ -15,7 +15,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.1 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/prometheus/client_golang v1.14.0 - github.com/robfig/cron/v3 v3.0.0 + github.com/robfig/cron/v3 v3.0.1 github.com/stretchr/testify v1.8.4 github.com/tidwall/gjson v1.9.3 go.uber.org/zap v1.21.0 diff --git a/go.sum b/go.sum index 78d550bb..6d9291e7 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devtron-labs/common-lib v0.0.16-0.20240318063710-69cb957d019a h1:6ik5mwqPW3/zNGCsV0kRh2zFQbECpOfeldflYQaRoVo= -github.com/devtron-labs/common-lib v0.0.16-0.20240318063710-69cb957d019a/go.mod h1:6QrrtLoLnuEdHkrx5HqkEVwMxEmnhAH1R/SJVMswuCc= +github.com/devtron-labs/common-lib v0.0.16-0.20240503082245-7ab933f8381f h1:DcnCVtWaqwL6rptUD2eMaSwQEIL4/VaRWBfjyJbXy4U= +github.com/devtron-labs/common-lib v0.0.16-0.20240503082245-7ab933f8381f/go.mod h1:mzEk3pf4JDXsOPNvCxjoSnsMBTwmt4A73Qc2tobLkZM= github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb h1:CkfQQgZc950/hTPqtQSiHV2RmZgkBLGCzwR02FZYjAU= github.com/devtron-labs/protos v0.0.3-0.20240130061723-7b2e12ab0abb/go.mod h1:pjLjgoa1GzbkOkvbMyP4SAKsaiK7eG6GoQCNauG03JA= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= @@ -120,8 +120,8 @@ github.com/prometheus/common v0.38.0 h1:VTQitp6mXTdUoCmDMugDVOJ1opi6ADftKfp/yeqT github.com/prometheus/common v0.38.0/go.mod h1:MBXfmBQZrK5XpbCkjofnXs96LD2QQ7fEq4C0xjC/yec= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= -github.com/robfig/cron/v3 v3.0.0 h1:kQ6Cb7aHOHTSzNVNEhmp8EcWKLb4CbiMW9h9VyIhO4E= -github.com/robfig/cron/v3 v3.0.0/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +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.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go index 9dcfc422..711316cb 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go @@ -46,6 +46,9 @@ const ( CI_COMPLETE_TOPIC string = "CI-COMPLETE" CI_COMPLETE_GROUP string = "CI-COMPLETE_GROUP-1" CI_COMPLETE_DURABLE string = "CI-COMPLETE_DURABLE-1" + IMAGE_SCANNING_SUCCESS_TOPIC string = "IMAGE-SCANNING-SUCCESS" + IMAGE_SCANNING_SUCCESS_GROUP string = "IMAGE-SCANNING-SUCCESS-GROUP" + IMAGE_SCANNING_SUCCESS_DURABLE string = "IMAGE-SCANNING-SUCCESS-DURABLE" APPLICATION_STATUS_UPDATE_TOPIC string = "APPLICATION_STATUS_UPDATE" APPLICATION_STATUS_UPDATE_GROUP string = "APPLICATION_STATUS_UPDATE_GROUP-1" APPLICATION_STATUS_UPDATE_DURABLE string = "APPLICATION_STATUS_UPDATE_DURABLE-1" @@ -95,6 +98,9 @@ const ( CD_STAGE_SUCCESS_EVENT_TOPIC string = "CD-STAGE-SUCCESS-EVENT" CD_STAGE_SUCCESS_EVENT_GROUP string = "CD-STAGE-SUCCESS-EVENT-GROUP" CD_STAGE_SUCCESS_EVENT_DURABLE string = "CD-STAGE-SUCCESS-EVENT-DURABLE" + CD_PIPELINE_DELETE_EVENT_TOPIC string = "CD-PIPELINE-DELETE-EVENT" + CD_PIPELINE_DELETE_EVENT_GROUP string = "CD-PIPELINE-DELETE-EVENT-GROUP" + CD_PIPELINE_DELETE_EVENT_DURABLE string = "CD-PIPELINE-DELETE-EVENT-DURABLE" ) type NatsTopic struct { @@ -120,8 +126,9 @@ var natsTopicMapping = map[string]NatsTopic{ WEBHOOK_EVENT_TOPIC: {topicName: WEBHOOK_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: WEBHOOK_EVENT_GROUP, consumerName: WEBHOOK_EVENT_DURABLE}, CD_BULK_DEPLOY_TRIGGER_TOPIC: {topicName: CD_BULK_DEPLOY_TRIGGER_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_BULK_DEPLOY_TRIGGER_GROUP, consumerName: CD_BULK_DEPLOY_TRIGGER_DURABLE}, - CI_COMPLETE_TOPIC: {topicName: CI_COMPLETE_TOPIC, streamName: CI_RUNNER_STREAM, queueName: CI_COMPLETE_GROUP, consumerName: CI_COMPLETE_DURABLE}, - CD_STAGE_COMPLETE_TOPIC: {topicName: CD_STAGE_COMPLETE_TOPIC, streamName: CI_RUNNER_STREAM, queueName: CD_COMPLETE_GROUP, consumerName: CD_COMPLETE_DURABLE}, + CI_COMPLETE_TOPIC: {topicName: CI_COMPLETE_TOPIC, streamName: CI_RUNNER_STREAM, queueName: CI_COMPLETE_GROUP, consumerName: CI_COMPLETE_DURABLE}, + CD_STAGE_COMPLETE_TOPIC: {topicName: CD_STAGE_COMPLETE_TOPIC, streamName: CI_RUNNER_STREAM, queueName: CD_COMPLETE_GROUP, consumerName: CD_COMPLETE_DURABLE}, + IMAGE_SCANNING_SUCCESS_TOPIC: {topicName: IMAGE_SCANNING_SUCCESS_TOPIC, streamName: CI_RUNNER_STREAM, queueName: IMAGE_SCANNING_SUCCESS_GROUP, consumerName: IMAGE_SCANNING_SUCCESS_DURABLE}, APPLICATION_STATUS_UPDATE_TOPIC: {topicName: APPLICATION_STATUS_UPDATE_TOPIC, streamName: KUBEWATCH_STREAM, queueName: APPLICATION_STATUS_UPDATE_GROUP, consumerName: APPLICATION_STATUS_UPDATE_DURABLE}, APPLICATION_STATUS_DELETE_TOPIC: {topicName: APPLICATION_STATUS_DELETE_TOPIC, streamName: KUBEWATCH_STREAM, queueName: APPLICATION_STATUS_DELETE_GROUP, consumerName: APPLICATION_STATUS_DELETE_DURABLE}, @@ -138,6 +145,8 @@ var natsTopicMapping = map[string]NatsTopic{ DEVTRON_CHART_INSTALL_TOPIC: {topicName: DEVTRON_CHART_INSTALL_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: DEVTRON_CHART_INSTALL_GROUP, consumerName: DEVTRON_CHART_INSTALL_DURABLE}, PANIC_ON_PROCESSING_TOPIC: {topicName: PANIC_ON_PROCESSING_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: PANIC_ON_PROCESSING_GROUP, consumerName: PANIC_ON_PROCESSING_DURABLE}, CD_STAGE_SUCCESS_EVENT_TOPIC: {topicName: CD_STAGE_SUCCESS_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_STAGE_SUCCESS_EVENT_GROUP, consumerName: CD_STAGE_SUCCESS_EVENT_DURABLE}, + + CD_PIPELINE_DELETE_EVENT_TOPIC: {topicName: CD_PIPELINE_DELETE_EVENT_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: CD_PIPELINE_DELETE_EVENT_GROUP, consumerName: CD_PIPELINE_DELETE_EVENT_DURABLE}, } var NatsStreamWiseConfigMapping = map[string]NatsStreamConfig{ @@ -160,6 +169,7 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{ APPLICATION_STATUS_DELETE_DURABLE: {}, CD_COMPLETE_DURABLE: {}, CI_COMPLETE_DURABLE: {}, + IMAGE_SCANNING_SUCCESS_DURABLE: {}, WEBHOOK_EVENT_DURABLE: {}, CD_TRIGGER_DURABLE: {}, BULK_HIBERNATE_DURABLE: {}, @@ -170,6 +180,8 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{ DEVTRON_CHART_INSTALL_DURABLE: {}, PANIC_ON_PROCESSING_DURABLE: {}, DEVTRON_TEST_CONSUMER: {}, + CD_STAGE_SUCCESS_EVENT_DURABLE: {}, + CD_PIPELINE_DELETE_EVENT_DURABLE: {}, } // getConsumerConfigMap will fetch the consumer wise config from the json string @@ -212,11 +224,12 @@ func getStreamConfigMap(jsonString string) map[string]NatsStreamConfig { return resMap } -func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { +func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() error { configJson := ConfigJson{} err := env.Parse(&configJson) if err != nil { - log.Fatal("error while parsing config from environment params", " err", err) + log.Println("error while parsing config from environment params", " err", err) + return err } // fetch the consumer configs that were given explicitly in the configJson.ConsumerConfigJson @@ -236,6 +249,21 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { defaultConsumerConfigVal := defaultConfig.GetDefaultNatsConsumerConfig() // initialise all the consumer wise config with default values or user defined values + updateNatsConsumerConfigMapping(defaultConsumerConfigVal, consumerConfigMap) + + // initialise all the stream wise config with default values or user defined values + updateNatsStreamConfigMapping(defaultStreamConfigVal, streamConfigMap) + return nil +} + +func updateNatsConsumerConfigMapping(defaultConsumerConfigVal NatsConsumerConfig, consumerConfigMap map[string]NatsConsumerConfig) { + //iterating through all nats topic mappings (assuming source of truth) to update any consumers if not present in consumer mapping + for _, natsTopic := range natsTopicMapping { + if _, ok := NatsConsumerWiseConfigMapping[natsTopic.consumerName]; !ok { + NatsConsumerWiseConfigMapping[natsTopic.consumerName] = NatsConsumerConfig{} + } + } + //initialise all the consumer wise config with default values or user defined values for key, _ := range NatsConsumerWiseConfigMapping { consumerConfig := defaultConsumerConfigVal if _, ok := consumerConfigMap[key]; ok { @@ -243,8 +271,9 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { } NatsConsumerWiseConfigMapping[key] = consumerConfig } +} - // initialise all the consumer wise config with default values or user defined values +func updateNatsStreamConfigMapping(defaultStreamConfigVal NatsStreamConfig, streamConfigMap map[string]NatsStreamConfig) { for key, _ := range NatsStreamWiseConfigMapping { streamConfig := defaultStreamConfigVal if _, ok := streamConfigMap[key]; ok { @@ -252,7 +281,6 @@ func ParseAndFillStreamWiseAndConsumerWiseConfigMaps() { } NatsStreamWiseConfigMapping[key] = streamConfig } - } func GetNatsTopic(topicName string) NatsTopic { @@ -280,11 +308,12 @@ func AddStream(js nats.JetStreamContext, streamConfig *nats.StreamConfig, stream cfgToSet := getNewConfig(streamName, streamConfig) _, err = js.AddStream(cfgToSet) if err != nil { - log.Fatal("Error while creating stream. ", "stream name: ", streamName, "error: ", err) + log.Println("Error while creating stream. ", "stream name: ", streamName, "error: ", err) return err } } else if err != nil { - log.Fatal("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) + log.Println("Error while getting stream info. ", "stream name: ", streamName, "error: ", err) + return err } else { config := streamInfo.Config streamConfig.Name = streamName diff --git a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go index 413d8731..88bb2769 100644 --- a/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go +++ b/vendor/github.com/devtron-labs/common-lib/pubsub-lib/PubSubClientService.go @@ -35,23 +35,28 @@ type PubSubClientServiceImpl struct { logsConfig *model.LogsConfig } -func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) *PubSubClientServiceImpl { +func NewPubSubClientServiceImpl(logger *zap.SugaredLogger) (*PubSubClientServiceImpl, error) { natsClient, err := NewNatsClient(logger) if err != nil { - logger.Fatalw("error occurred while creating nats client stopping now!!") + logger.Errorw("error occurred while creating nats client stopping now!!") + return nil, err } logsConfig := &model.LogsConfig{} err = env.Parse(logsConfig) if err != nil { logger.Errorw("error occurred while parsing LogsConfig", "err", err) + return nil, err + } + err = ParseAndFillStreamWiseAndConsumerWiseConfigMaps() + if err != nil { + return nil, err } - ParseAndFillStreamWiseAndConsumerWiseConfigMaps() pubSubClient := &PubSubClientServiceImpl{ Logger: logger, NatsClient: natsClient, logsConfig: logsConfig, } - return pubSubClient + return pubSubClient, nil } func (impl PubSubClientServiceImpl) Publish(topic string, msg string) error { @@ -125,7 +130,7 @@ func (impl PubSubClientServiceImpl) Subscribe(topic string, callback func(msg *m nats.AckWait(ackWait), // if ackWait is 0 , nats sets this option to 30secs by default nats.BindStream(streamName)) if err != nil { - impl.Logger.Fatalw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) + impl.Logger.Errorw("error while subscribing to nats ", "stream", streamName, "topic", topic, "error", err) return err } go impl.startListeningForEvents(processingBatchSize, channel, callback, loggerFunc, validations...) diff --git a/vendor/github.com/robfig/cron/v3/README.md b/vendor/github.com/robfig/cron/v3/README.md index 8db4f550..984c537c 100644 --- a/vendor/github.com/robfig/cron/v3/README.md +++ b/vendor/github.com/robfig/cron/v3/README.md @@ -72,7 +72,7 @@ It is backwards incompatible with both v1 and v2. These updates are required: // Seconds field, optional cron.New( cron.WithParser( - cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) - The Cron type now accepts functional options on construction rather than the previous ad-hoc behavior modification mechanisms (setting a field, calling a setter). @@ -118,7 +118,7 @@ There are two cron spec formats in common usage: jobs in Java software [the Cron wikipedia page]: https://en.wikipedia.org/wiki/Cron -[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html +[the Quartz Scheduler]: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tutorial-lesson-06.html The original version of this package included an optional "seconds" field, which made it incompatible with both of these formats. Now, the "standard" format is diff --git a/vendor/github.com/robfig/cron/v3/chain.go b/vendor/github.com/robfig/cron/v3/chain.go index 118e5bbe..9565b418 100644 --- a/vendor/github.com/robfig/cron/v3/chain.go +++ b/vendor/github.com/robfig/cron/v3/chain.go @@ -76,9 +76,9 @@ func DelayIfStillRunning(logger Logger) JobWrapper { // SkipIfStillRunning skips an invocation of the Job if a previous invocation is // still running. It logs skips to the given logger at Info level. func SkipIfStillRunning(logger Logger) JobWrapper { - var ch = make(chan struct{}, 1) - ch <- struct{}{} return func(j Job) Job { + var ch = make(chan struct{}, 1) + ch <- struct{}{} return FuncJob(func() { select { case v := <-ch: diff --git a/vendor/github.com/robfig/cron/v3/cron.go b/vendor/github.com/robfig/cron/v3/cron.go index f6e451db..c7e91766 100644 --- a/vendor/github.com/robfig/cron/v3/cron.go +++ b/vendor/github.com/robfig/cron/v3/cron.go @@ -21,11 +21,16 @@ type Cron struct { logger Logger runningMu sync.Mutex location *time.Location - parser Parser + parser ScheduleParser nextID EntryID jobWaiter sync.WaitGroup } +// ScheduleParser is an interface for schedule spec parsers that return a Schedule +type ScheduleParser interface { + Parse(spec string) (Schedule, error) +} + // Job is an interface for submitted cron jobs. type Job interface { Run() diff --git a/vendor/github.com/robfig/cron/v3/doc.go b/vendor/github.com/robfig/cron/v3/doc.go index ac6b4b07..fa5d08b4 100644 --- a/vendor/github.com/robfig/cron/v3/doc.go +++ b/vendor/github.com/robfig/cron/v3/doc.go @@ -1,6 +1,18 @@ /* Package cron implements a cron spec parser and job runner. +Installation + +To download the specific tagged release, run: + + go get github.com/robfig/cron/v3@v3.0.0 + +Import it in your program as: + + import "github.com/robfig/cron/v3" + +It requires Go 1.11 or later due to usage of Go Modules. + Usage Callers may register Funcs to be invoked on a given schedule. Cron will run @@ -9,7 +21,7 @@ them in their own goroutines. c := cron.New() c.AddFunc("30 * * * *", func() { fmt.Println("Every hour on the half hour") }) c.AddFunc("30 3-6,20-23 * * *", func() { fmt.Println(".. in the range 3-6am, 8-11pm") }) - c.AddFunc("CRON_TZ=Asia/Tokyo 30 04 * * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) + c.AddFunc("CRON_TZ=Asia/Tokyo 30 04 * * *", func() { fmt.Println("Runs at 04:30 Tokyo time every day") }) c.AddFunc("@hourly", func() { fmt.Println("Every hour, starting an hour from now") }) c.AddFunc("@every 1h30m", func() { fmt.Println("Every hour thirty, starting an hour thirty from now") }) c.Start() @@ -47,11 +59,18 @@ Alternative Formats Alternative Cron expression formats support other fields like seconds. You can implement that by creating a custom Parser as follows. - cron.New( - cron.WithParser( - cron.SecondOptional | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor)) + cron.New( + cron.WithParser( + cron.NewParser( + cron.SecondOptional | cron.Minute | cron.Hour | cron.Dom | cron.Month | cron.Dow | cron.Descriptor))) + +Since adding Seconds is the most common modification to the standard cron spec, +cron provides a builtin function to do that, which is equivalent to the custom +parser you saw earlier, except that its seconds field is REQUIRED: + + cron.New(cron.WithSeconds()) -The most popular alternative Cron expression format is Quartz: +That emulates Quartz, the most popular alternative Cron schedule format: http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html Special Characters @@ -150,7 +169,7 @@ The prefix "TZ=(TIME ZONE)" is also supported for legacy compatibility. Be aware that jobs scheduled during daylight-savings leap-ahead transitions will not be run! -Job Wrappers / Chain +Job Wrappers A Cron runner may be configured with a chain of job wrappers to add cross-cutting functionality to all submitted jobs. For example, they may be used diff --git a/vendor/github.com/robfig/cron/v3/option.go b/vendor/github.com/robfig/cron/v3/option.go index 07638201..09e4278e 100644 --- a/vendor/github.com/robfig/cron/v3/option.go +++ b/vendor/github.com/robfig/cron/v3/option.go @@ -23,7 +23,7 @@ func WithSeconds() Option { } // WithParser overrides the parser used for interpreting job schedules. -func WithParser(p Parser) Option { +func WithParser(p ScheduleParser) Option { return func(c *Cron) { c.parser = p } diff --git a/vendor/modules.txt b/vendor/modules.txt index 96c6a0cb..f85a0ed9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -62,7 +62,7 @@ github.com/cyphar/filepath-securejoin # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/devtron-labs/common-lib v0.0.16-0.20240318063710-69cb957d019a +# github.com/devtron-labs/common-lib v0.0.16-0.20240503082245-7ab933f8381f ## explicit; go 1.20 github.com/devtron-labs/common-lib/constants github.com/devtron-labs/common-lib/monitoring @@ -252,7 +252,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/robfig/cron/v3 v3.0.0 +# github.com/robfig/cron/v3 v3.0.1 ## explicit; go 1.12 github.com/robfig/cron/v3 # github.com/sergi/go-diff v1.1.0 diff --git a/wire_gen.go b/wire_gen.go index c7b7edf5..341f4f58 100644 --- a/wire_gen.go +++ b/wire_gen.go @@ -41,7 +41,10 @@ func InitializeApp() (*app.App, error) { gitProviderRepositoryImpl := sql.NewGitProviderRepositoryImpl(db) ciPipelineMaterialRepositoryImpl := sql.NewCiPipelineMaterialRepositoryImpl(db, sugaredLogger) repositoryLocker := internals.NewRepositoryLocker(sugaredLogger) - pubSubClientServiceImpl := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) + pubSubClientServiceImpl, err := pubsub_lib.NewPubSubClientServiceImpl(sugaredLogger) + if err != nil { + return nil, err + } webhookEventRepositoryImpl := sql.NewWebhookEventRepositoryImpl(db) webhookEventParsedDataRepositoryImpl := sql.NewWebhookEventParsedDataRepositoryImpl(db) webhookEventDataMappingRepositoryImpl := sql.NewWebhookEventDataMappingRepositoryImpl(db)