diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 252d98ae9a..fedbdf4331 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -4249,10 +4249,12 @@ const docTemplate = `{ "killed", "error", "blocked", - "declined" + "declined", + "created" ], "x-enum-comments": { "StatusBlocked": "waiting for approval", + "StatusCreated": "created / internal use only", "StatusDeclined": "blocked and declined", "StatusError": "error with the config / while parsing / some other system problem", "StatusFailure": "failed to finish (exit code != 0)", @@ -4271,7 +4273,8 @@ const docTemplate = `{ "StatusKilled", "StatusError", "StatusBlocked", - "StatusDeclined" + "StatusDeclined", + "StatusCreated" ] }, "Step": { diff --git a/server/forge/mocks/forge.go b/server/forge/mocks/forge.go index 612ed135ee..5f032c84a0 100644 --- a/server/forge/mocks/forge.go +++ b/server/forge/mocks/forge.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.37.1. DO NOT EDIT. +// Code generated by mockery v2.38.0. DO NOT EDIT. package mocks @@ -23,6 +23,10 @@ type Forge struct { func (_m *Forge) Activate(ctx context.Context, u *model.User, r *model.Repo, link string) error { ret := _m.Called(ctx, u, r, link) + if len(ret) == 0 { + panic("no return value specified for Activate") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { r0 = rf(ctx, u, r, link) @@ -37,6 +41,10 @@ func (_m *Forge) Activate(ctx context.Context, u *model.User, r *model.Repo, lin func (_m *Forge) Auth(ctx context.Context, token string, secret string) (string, error) { ret := _m.Called(ctx, token, secret) + if len(ret) == 0 { + panic("no return value specified for Auth") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(context.Context, string, string) (string, error)); ok { @@ -61,6 +69,10 @@ func (_m *Forge) Auth(ctx context.Context, token string, secret string) (string, func (_m *Forge) BranchHead(ctx context.Context, u *model.User, r *model.Repo, branch string) (string, error) { ret := _m.Called(ctx, u, r, branch) + if len(ret) == 0 { + panic("no return value specified for BranchHead") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) (string, error)); ok { @@ -85,6 +97,10 @@ func (_m *Forge) BranchHead(ctx context.Context, u *model.User, r *model.Repo, b func (_m *Forge) Branches(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]string, error) { ret := _m.Called(ctx, u, r, p) + if len(ret) == 0 { + panic("no return value specified for Branches") + } + var r0 []string var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]string, error)); ok { @@ -111,6 +127,10 @@ func (_m *Forge) Branches(ctx context.Context, u *model.User, r *model.Repo, p * func (_m *Forge) Deactivate(ctx context.Context, u *model.User, r *model.Repo, link string) error { ret := _m.Called(ctx, u, r, link) + if len(ret) == 0 { + panic("no return value specified for Deactivate") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, string) error); ok { r0 = rf(ctx, u, r, link) @@ -125,6 +145,10 @@ func (_m *Forge) Deactivate(ctx context.Context, u *model.User, r *model.Repo, l func (_m *Forge) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]*types.FileMeta, error) { ret := _m.Called(ctx, u, r, b, f) + if len(ret) == 0 { + panic("no return value specified for Dir") + } + var r0 []*types.FileMeta var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]*types.FileMeta, error)); ok { @@ -151,6 +175,10 @@ func (_m *Forge) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model func (_m *Forge) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, f string) ([]byte, error) { ret := _m.Called(ctx, u, r, b, f) + if len(ret) == 0 { + panic("no return value specified for File") + } + var r0 []byte var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, string) ([]byte, error)); ok { @@ -177,6 +205,10 @@ func (_m *Forge) File(ctx context.Context, u *model.User, r *model.Repo, b *mode func (_m *Forge) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.Pipeline, error) { ret := _m.Called(ctx, r) + if len(ret) == 0 { + panic("no return value specified for Hook") + } + var r0 *model.Repo var r1 *model.Pipeline var r2 error @@ -212,6 +244,10 @@ func (_m *Forge) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model func (_m *Forge) Login(ctx context.Context, w http.ResponseWriter, r *http.Request) (*model.User, error) { ret := _m.Called(ctx, w, r) + if len(ret) == 0 { + panic("no return value specified for Login") + } + var r0 *model.User var r1 error if rf, ok := ret.Get(0).(func(context.Context, http.ResponseWriter, *http.Request) (*model.User, error)); ok { @@ -238,6 +274,10 @@ func (_m *Forge) Login(ctx context.Context, w http.ResponseWriter, r *http.Reque func (_m *Forge) Name() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Name") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -252,6 +292,10 @@ func (_m *Forge) Name() string { func (_m *Forge) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) { ret := _m.Called(u, r) + if len(ret) == 0 { + panic("no return value specified for Netrc") + } + var r0 *model.Netrc var r1 error if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Netrc, error)); ok { @@ -278,6 +322,10 @@ func (_m *Forge) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error) { func (_m *Forge) Org(ctx context.Context, u *model.User, org string) (*model.Org, error) { ret := _m.Called(ctx, u, org) + if len(ret) == 0 { + panic("no return value specified for Org") + } + var r0 *model.Org var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.Org, error)); ok { @@ -304,6 +352,10 @@ func (_m *Forge) Org(ctx context.Context, u *model.User, org string) (*model.Org func (_m *Forge) OrgMembership(ctx context.Context, u *model.User, org string) (*model.OrgPerm, error) { ret := _m.Called(ctx, u, org) + if len(ret) == 0 { + panic("no return value specified for OrgMembership") + } + var r0 *model.OrgPerm var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, string) (*model.OrgPerm, error)); ok { @@ -330,6 +382,10 @@ func (_m *Forge) OrgMembership(ctx context.Context, u *model.User, org string) ( func (_m *Forge) PullRequests(ctx context.Context, u *model.User, r *model.Repo, p *model.ListOptions) ([]*model.PullRequest, error) { ret := _m.Called(ctx, u, r, p) + if len(ret) == 0 { + panic("no return value specified for PullRequests") + } + var r0 []*model.PullRequest var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.ListOptions) ([]*model.PullRequest, error)); ok { @@ -356,6 +412,10 @@ func (_m *Forge) PullRequests(ctx context.Context, u *model.User, r *model.Repo, func (_m *Forge) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRemoteID, owner string, name string) (*model.Repo, error) { ret := _m.Called(ctx, u, remoteID, owner, name) + if len(ret) == 0 { + panic("no return value specified for Repo") + } + var r0 *model.Repo var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, model.ForgeRemoteID, string, string) (*model.Repo, error)); ok { @@ -382,6 +442,10 @@ func (_m *Forge) Repo(ctx context.Context, u *model.User, remoteID model.ForgeRe func (_m *Forge) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error) { ret := _m.Called(ctx, u) + if len(ret) == 0 { + panic("no return value specified for Repos") + } + var r0 []*model.Repo var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Repo, error)); ok { @@ -408,6 +472,10 @@ func (_m *Forge) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error func (_m *Forge) Status(ctx context.Context, u *model.User, r *model.Repo, b *model.Pipeline, p *model.Workflow) error { ret := _m.Called(ctx, u, r, b, p) + if len(ret) == 0 { + panic("no return value specified for Status") + } + var r0 error if rf, ok := ret.Get(0).(func(context.Context, *model.User, *model.Repo, *model.Pipeline, *model.Workflow) error); ok { r0 = rf(ctx, u, r, b, p) @@ -422,6 +490,10 @@ func (_m *Forge) Status(ctx context.Context, u *model.User, r *model.Repo, b *mo func (_m *Forge) Teams(ctx context.Context, u *model.User) ([]*model.Team, error) { ret := _m.Called(ctx, u) + if len(ret) == 0 { + panic("no return value specified for Teams") + } + var r0 []*model.Team var r1 error if rf, ok := ret.Get(0).(func(context.Context, *model.User) ([]*model.Team, error)); ok { @@ -448,6 +520,10 @@ func (_m *Forge) Teams(ctx context.Context, u *model.User) ([]*model.Team, error func (_m *Forge) URL() string { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for URL") + } + var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() diff --git a/server/model/const.go b/server/model/const.go index 337c6a1380..89760d730d 100644 --- a/server/model/const.go +++ b/server/model/const.go @@ -61,6 +61,7 @@ const ( StatusError StatusValue = "error" // error with the config / while parsing / some other system problem StatusBlocked StatusValue = "blocked" // waiting for approval StatusDeclined StatusValue = "declined" // blocked and declined + StatusCreated StatusValue = "created" // created / internal use only ) // SCMKind represent different version control systems diff --git a/server/pipeline/create.go b/server/pipeline/create.go index b2c15f0ca5..d440eccb55 100644 --- a/server/pipeline/create.go +++ b/server/pipeline/create.go @@ -53,7 +53,7 @@ func Create(ctx context.Context, _store store.Store, repo *model.Repo, pipeline // update some pipeline fields pipeline.RepoID = repo.ID - pipeline.Status = model.StatusPending + pipeline.Status = model.StatusCreated setGatedState(repo, pipeline) err = _store.CreatePipeline(pipeline) if err != nil { @@ -81,9 +81,17 @@ func Create(ctx context.Context, _store store.Store, repo *model.Repo, pipeline if len(pipelineItems) == 0 { log.Debug().Str("repo", repo.FullName).Msg(ErrFiltered.Error()) + if err := _store.DeletePipeline(pipeline); err != nil { + log.Error().Str("repo", repo.FullName).Err(err).Msg("failed to delete empty pipeline") + } + return nil, ErrFiltered } + if err := updatePipelinePending(ctx, _store, pipeline, repo, repoUser); err != nil { + return nil, err + } + pipeline = setPipelineStepsOnPipeline(pipeline, pipelineItems) // persist the pipeline config for historical correctness, restarts, etc @@ -135,3 +143,17 @@ func updatePipelineWithErr(ctx context.Context, _store store.Store, pipeline *mo return nil } + +func updatePipelinePending(ctx context.Context, _store store.Store, pipeline *model.Pipeline, repo *model.Repo, repoUser *model.User) error { + pipeline.Status = model.StatusPending + dbErr := _store.UpdatePipeline(pipeline) + if dbErr != nil { + msg := fmt.Errorf("failed to save pipeline for %s", repo.FullName) + log.Error().Err(dbErr).Msg(msg.Error()) + return msg + } + + publishPipeline(ctx, pipeline, repo, repoUser) + + return nil +} diff --git a/server/store/datastore/pipeline.go b/server/store/datastore/pipeline.go index 7e6d2375af..438caf5d8d 100644 --- a/server/store/datastore/pipeline.go +++ b/server/store/datastore/pipeline.go @@ -136,7 +136,11 @@ func (s storage) UpdatePipeline(pipeline *model.Pipeline) error { return err } -func deletePipeline(sess *xorm.Session, pipelineID int64) error { +func (s storage) DeletePipeline(pipeline *model.Pipeline) error { + return s.deletePipeline(s.engine.NewSession(), pipeline.ID) +} + +func (s storage) deletePipeline(sess *xorm.Session, pipelineID int64) error { // delete related steps for startSteps := 0; ; startSteps += perPage { stepIDs := make([]int64, 0, perPage) diff --git a/server/store/datastore/repo.go b/server/store/datastore/repo.go index 37ba932205..4b0a624987 100644 --- a/server/store/datastore/repo.go +++ b/server/store/datastore/repo.go @@ -123,7 +123,7 @@ func (s storage) deleteRepo(sess *xorm.Session, repo *model.Repo) error { } for i := range pipelineIDs { - if err := deletePipeline(sess, pipelineIDs[i]); err != nil { + if err := s.deletePipeline(sess, pipelineIDs[i]); err != nil { return err } } diff --git a/server/store/mocks/store.go b/server/store/mocks/store.go index ab9d24189e..96dfa9193d 100644 --- a/server/store/mocks/store.go +++ b/server/store/mocks/store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.37.1. DO NOT EDIT. +// Code generated by mockery v2.38.0. DO NOT EDIT. package mocks @@ -16,6 +16,10 @@ type Store struct { func (_m *Store) AgentCreate(_a0 *model.Agent) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AgentCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { r0 = rf(_a0) @@ -30,6 +34,10 @@ func (_m *Store) AgentCreate(_a0 *model.Agent) error { func (_m *Store) AgentDelete(_a0 *model.Agent) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AgentDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { r0 = rf(_a0) @@ -44,6 +52,10 @@ func (_m *Store) AgentDelete(_a0 *model.Agent) error { func (_m *Store) AgentFind(_a0 int64) (*model.Agent, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AgentFind") + } + var r0 *model.Agent var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Agent, error)); ok { @@ -70,6 +82,10 @@ func (_m *Store) AgentFind(_a0 int64) (*model.Agent, error) { func (_m *Store) AgentFindByToken(_a0 string) (*model.Agent, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AgentFindByToken") + } + var r0 *model.Agent var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Agent, error)); ok { @@ -96,6 +112,10 @@ func (_m *Store) AgentFindByToken(_a0 string) (*model.Agent, error) { func (_m *Store) AgentList(p *model.ListOptions) ([]*model.Agent, error) { ret := _m.Called(p) + if len(ret) == 0 { + panic("no return value specified for AgentList") + } + var r0 []*model.Agent var r1 error if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Agent, error)); ok { @@ -122,6 +142,10 @@ func (_m *Store) AgentList(p *model.ListOptions) ([]*model.Agent, error) { func (_m *Store) AgentUpdate(_a0 *model.Agent) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for AgentUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Agent) error); ok { r0 = rf(_a0) @@ -136,6 +160,10 @@ func (_m *Store) AgentUpdate(_a0 *model.Agent) error { func (_m *Store) Close() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Close") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -150,6 +178,10 @@ func (_m *Store) Close() error { func (_m *Store) ConfigCreate(_a0 *model.Config) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ConfigCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Config) error); ok { r0 = rf(_a0) @@ -164,6 +196,10 @@ func (_m *Store) ConfigCreate(_a0 *model.Config) error { func (_m *Store) ConfigFindApproved(_a0 *model.Config) (bool, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ConfigFindApproved") + } + var r0 bool var r1 error if rf, ok := ret.Get(0).(func(*model.Config) (bool, error)); ok { @@ -188,6 +224,10 @@ func (_m *Store) ConfigFindApproved(_a0 *model.Config) (bool, error) { func (_m *Store) ConfigFindIdentical(repoID int64, hash string) (*model.Config, error) { ret := _m.Called(repoID, hash) + if len(ret) == 0 { + panic("no return value specified for ConfigFindIdentical") + } + var r0 *model.Config var r1 error if rf, ok := ret.Get(0).(func(int64, string) (*model.Config, error)); ok { @@ -214,6 +254,10 @@ func (_m *Store) ConfigFindIdentical(repoID int64, hash string) (*model.Config, func (_m *Store) ConfigsForPipeline(pipelineID int64) ([]*model.Config, error) { ret := _m.Called(pipelineID) + if len(ret) == 0 { + panic("no return value specified for ConfigsForPipeline") + } + var r0 []*model.Config var r1 error if rf, ok := ret.Get(0).(func(int64) ([]*model.Config, error)); ok { @@ -247,6 +291,10 @@ func (_m *Store) CreatePipeline(_a0 *model.Pipeline, _a1 ...*model.Step) error { _ca = append(_ca, _va...) ret := _m.Called(_ca...) + if len(ret) == 0 { + panic("no return value specified for CreatePipeline") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Pipeline, ...*model.Step) error); ok { r0 = rf(_a0, _a1...) @@ -261,6 +309,10 @@ func (_m *Store) CreatePipeline(_a0 *model.Pipeline, _a1 ...*model.Step) error { func (_m *Store) CreateRedirection(redirection *model.Redirection) error { ret := _m.Called(redirection) + if len(ret) == 0 { + panic("no return value specified for CreateRedirection") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Redirection) error); ok { r0 = rf(redirection) @@ -275,6 +327,10 @@ func (_m *Store) CreateRedirection(redirection *model.Redirection) error { func (_m *Store) CreateRepo(_a0 *model.Repo) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for CreateRepo") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { r0 = rf(_a0) @@ -289,6 +345,10 @@ func (_m *Store) CreateRepo(_a0 *model.Repo) error { func (_m *Store) CreateUser(_a0 *model.User) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for CreateUser") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.User) error); ok { r0 = rf(_a0) @@ -303,6 +363,10 @@ func (_m *Store) CreateUser(_a0 *model.User) error { func (_m *Store) CronCreate(_a0 *model.Cron) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for CronCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Cron) error); ok { r0 = rf(_a0) @@ -317,6 +381,10 @@ func (_m *Store) CronCreate(_a0 *model.Cron) error { func (_m *Store) CronDelete(_a0 *model.Repo, _a1 int64) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo, int64) error); ok { r0 = rf(_a0, _a1) @@ -331,6 +399,10 @@ func (_m *Store) CronDelete(_a0 *model.Repo, _a1 int64) error { func (_m *Store) CronFind(_a0 *model.Repo, _a1 int64) (*model.Cron, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronFind") + } + var r0 *model.Cron var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Cron, error)); ok { @@ -357,6 +429,10 @@ func (_m *Store) CronFind(_a0 *model.Repo, _a1 int64) (*model.Cron, error) { func (_m *Store) CronGetLock(_a0 *model.Cron, _a1 int64) (bool, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronGetLock") + } + var r0 bool var r1 error if rf, ok := ret.Get(0).(func(*model.Cron, int64) (bool, error)); ok { @@ -381,6 +457,10 @@ func (_m *Store) CronGetLock(_a0 *model.Cron, _a1 int64) (bool, error) { func (_m *Store) CronList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Cron, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronList") + } + var r0 []*model.Cron var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Cron, error)); ok { @@ -407,6 +487,10 @@ func (_m *Store) CronList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Cro func (_m *Store) CronListNextExecute(_a0 int64, _a1 int64) ([]*model.Cron, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronListNextExecute") + } + var r0 []*model.Cron var r1 error if rf, ok := ret.Get(0).(func(int64, int64) ([]*model.Cron, error)); ok { @@ -433,6 +517,10 @@ func (_m *Store) CronListNextExecute(_a0 int64, _a1 int64) ([]*model.Cron, error func (_m *Store) CronUpdate(_a0 *model.Repo, _a1 *model.Cron) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for CronUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo, *model.Cron) error); ok { r0 = rf(_a0, _a1) @@ -443,10 +531,32 @@ func (_m *Store) CronUpdate(_a0 *model.Repo, _a1 *model.Cron) error { return r0 } +// DeletePipeline provides a mock function with given fields: _a0 +func (_m *Store) DeletePipeline(_a0 *model.Pipeline) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for DeletePipeline") + } + + var r0 error + if rf, ok := ret.Get(0).(func(*model.Pipeline) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // DeleteRepo provides a mock function with given fields: _a0 func (_m *Store) DeleteRepo(_a0 *model.Repo) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for DeleteRepo") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { r0 = rf(_a0) @@ -461,6 +571,10 @@ func (_m *Store) DeleteRepo(_a0 *model.Repo) error { func (_m *Store) DeleteUser(_a0 *model.User) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for DeleteUser") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.User) error); ok { r0 = rf(_a0) @@ -475,6 +589,10 @@ func (_m *Store) DeleteUser(_a0 *model.User) error { func (_m *Store) GetActivePipelineList(repo *model.Repo) ([]*model.Pipeline, error) { ret := _m.Called(repo) + if len(ret) == 0 { + panic("no return value specified for GetActivePipelineList") + } + var r0 []*model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo) ([]*model.Pipeline, error)); ok { @@ -501,6 +619,10 @@ func (_m *Store) GetActivePipelineList(repo *model.Repo) ([]*model.Pipeline, err func (_m *Store) GetPipeline(_a0 int64) (*model.Pipeline, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetPipeline") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Pipeline, error)); ok { @@ -527,6 +649,10 @@ func (_m *Store) GetPipeline(_a0 int64) (*model.Pipeline, error) { func (_m *Store) GetPipelineCommit(_a0 *model.Repo, _a1 string, _a2 string) (*model.Pipeline, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for GetPipelineCommit") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string, string) (*model.Pipeline, error)); ok { @@ -553,6 +679,10 @@ func (_m *Store) GetPipelineCommit(_a0 *model.Repo, _a1 string, _a2 string) (*mo func (_m *Store) GetPipelineCount() (int64, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetPipelineCount") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func() (int64, error)); ok { @@ -577,6 +707,10 @@ func (_m *Store) GetPipelineCount() (int64, error) { func (_m *Store) GetPipelineLast(_a0 *model.Repo, _a1 string) (*model.Pipeline, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for GetPipelineLast") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { @@ -603,6 +737,10 @@ func (_m *Store) GetPipelineLast(_a0 *model.Repo, _a1 string) (*model.Pipeline, func (_m *Store) GetPipelineLastBefore(_a0 *model.Repo, _a1 string, _a2 int64) (*model.Pipeline, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for GetPipelineLastBefore") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string, int64) (*model.Pipeline, error)); ok { @@ -629,6 +767,10 @@ func (_m *Store) GetPipelineLastBefore(_a0 *model.Repo, _a1 string, _a2 int64) ( func (_m *Store) GetPipelineList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Pipeline, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for GetPipelineList") + } + var r0 []*model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Pipeline, error)); ok { @@ -655,6 +797,10 @@ func (_m *Store) GetPipelineList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*mo func (_m *Store) GetPipelineNumber(_a0 *model.Repo, _a1 int64) (*model.Pipeline, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for GetPipelineNumber") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, int64) (*model.Pipeline, error)); ok { @@ -681,6 +827,10 @@ func (_m *Store) GetPipelineNumber(_a0 *model.Repo, _a1 int64) (*model.Pipeline, func (_m *Store) GetPipelineQueue() ([]*model.Feed, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetPipelineQueue") + } + var r0 []*model.Feed var r1 error if rf, ok := ret.Get(0).(func() ([]*model.Feed, error)); ok { @@ -707,6 +857,10 @@ func (_m *Store) GetPipelineQueue() ([]*model.Feed, error) { func (_m *Store) GetPipelineRef(_a0 *model.Repo, _a1 string) (*model.Pipeline, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for GetPipelineRef") + } + var r0 *model.Pipeline var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Pipeline, error)); ok { @@ -733,6 +887,10 @@ func (_m *Store) GetPipelineRef(_a0 *model.Repo, _a1 string) (*model.Pipeline, e func (_m *Store) GetRedirection(_a0 string) (*model.Redirection, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetRedirection") + } + var r0 *model.Redirection var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Redirection, error)); ok { @@ -759,6 +917,10 @@ func (_m *Store) GetRedirection(_a0 string) (*model.Redirection, error) { func (_m *Store) GetRepo(_a0 int64) (*model.Repo, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetRepo") + } + var r0 *model.Repo var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Repo, error)); ok { @@ -785,6 +947,10 @@ func (_m *Store) GetRepo(_a0 int64) (*model.Repo, error) { func (_m *Store) GetRepoCount() (int64, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetRepoCount") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func() (int64, error)); ok { @@ -809,6 +975,10 @@ func (_m *Store) GetRepoCount() (int64, error) { func (_m *Store) GetRepoForgeID(_a0 model.ForgeRemoteID) (*model.Repo, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetRepoForgeID") + } + var r0 *model.Repo var r1 error if rf, ok := ret.Get(0).(func(model.ForgeRemoteID) (*model.Repo, error)); ok { @@ -835,6 +1005,10 @@ func (_m *Store) GetRepoForgeID(_a0 model.ForgeRemoteID) (*model.Repo, error) { func (_m *Store) GetRepoName(_a0 string) (*model.Repo, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetRepoName") + } + var r0 *model.Repo var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Repo, error)); ok { @@ -861,6 +1035,10 @@ func (_m *Store) GetRepoName(_a0 string) (*model.Repo, error) { func (_m *Store) GetRepoNameFallback(remoteID model.ForgeRemoteID, fullName string) (*model.Repo, error) { ret := _m.Called(remoteID, fullName) + if len(ret) == 0 { + panic("no return value specified for GetRepoNameFallback") + } + var r0 *model.Repo var r1 error if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.Repo, error)); ok { @@ -887,6 +1065,10 @@ func (_m *Store) GetRepoNameFallback(remoteID model.ForgeRemoteID, fullName stri func (_m *Store) GetUser(_a0 int64) (*model.User, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetUser") + } + var r0 *model.User var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.User, error)); ok { @@ -913,6 +1095,10 @@ func (_m *Store) GetUser(_a0 int64) (*model.User, error) { func (_m *Store) GetUserCount() (int64, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for GetUserCount") + } + var r0 int64 var r1 error if rf, ok := ret.Get(0).(func() (int64, error)); ok { @@ -937,6 +1123,10 @@ func (_m *Store) GetUserCount() (int64, error) { func (_m *Store) GetUserList(p *model.ListOptions) ([]*model.User, error) { ret := _m.Called(p) + if len(ret) == 0 { + panic("no return value specified for GetUserList") + } + var r0 []*model.User var r1 error if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.User, error)); ok { @@ -963,6 +1153,10 @@ func (_m *Store) GetUserList(p *model.ListOptions) ([]*model.User, error) { func (_m *Store) GetUserLogin(_a0 string) (*model.User, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GetUserLogin") + } + var r0 *model.User var r1 error if rf, ok := ret.Get(0).(func(string) (*model.User, error)); ok { @@ -989,6 +1183,10 @@ func (_m *Store) GetUserLogin(_a0 string) (*model.User, error) { func (_m *Store) GetUserRemoteID(_a0 model.ForgeRemoteID, _a1 string) (*model.User, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for GetUserRemoteID") + } + var r0 *model.User var r1 error if rf, ok := ret.Get(0).(func(model.ForgeRemoteID, string) (*model.User, error)); ok { @@ -1015,6 +1213,10 @@ func (_m *Store) GetUserRemoteID(_a0 model.ForgeRemoteID, _a1 string) (*model.Us func (_m *Store) GlobalSecretFind(_a0 string) (*model.Secret, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GlobalSecretFind") + } + var r0 *model.Secret var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Secret, error)); ok { @@ -1041,6 +1243,10 @@ func (_m *Store) GlobalSecretFind(_a0 string) (*model.Secret, error) { func (_m *Store) GlobalSecretList(_a0 *model.ListOptions) ([]*model.Secret, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for GlobalSecretList") + } + var r0 []*model.Secret var r1 error if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Secret, error)); ok { @@ -1067,6 +1273,10 @@ func (_m *Store) GlobalSecretList(_a0 *model.ListOptions) ([]*model.Secret, erro func (_m *Store) HasRedirectionForRepo(_a0 int64, _a1 string) (bool, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for HasRedirectionForRepo") + } + var r0 bool var r1 error if rf, ok := ret.Get(0).(func(int64, string) (bool, error)); ok { @@ -1091,6 +1301,10 @@ func (_m *Store) HasRedirectionForRepo(_a0 int64, _a1 string) (bool, error) { func (_m *Store) LogAppend(logEntry *model.LogEntry) error { ret := _m.Called(logEntry) + if len(ret) == 0 { + panic("no return value specified for LogAppend") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.LogEntry) error); ok { r0 = rf(logEntry) @@ -1105,6 +1319,10 @@ func (_m *Store) LogAppend(logEntry *model.LogEntry) error { func (_m *Store) LogDelete(_a0 *model.Step) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for LogDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Step) error); ok { r0 = rf(_a0) @@ -1119,6 +1337,10 @@ func (_m *Store) LogDelete(_a0 *model.Step) error { func (_m *Store) LogFind(_a0 *model.Step) ([]*model.LogEntry, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for LogFind") + } + var r0 []*model.LogEntry var r1 error if rf, ok := ret.Get(0).(func(*model.Step) ([]*model.LogEntry, error)); ok { @@ -1145,6 +1367,10 @@ func (_m *Store) LogFind(_a0 *model.Step) ([]*model.LogEntry, error) { func (_m *Store) LogSave(_a0 *model.Step, _a1 []*model.LogEntry) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for LogSave") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Step, []*model.LogEntry) error); ok { r0 = rf(_a0, _a1) @@ -1159,6 +1385,10 @@ func (_m *Store) LogSave(_a0 *model.Step, _a1 []*model.LogEntry) error { func (_m *Store) Migrate(_a0 bool) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for Migrate") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(_a0) @@ -1173,6 +1403,10 @@ func (_m *Store) Migrate(_a0 bool) error { func (_m *Store) OrgCreate(_a0 *model.Org) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Org) error); ok { r0 = rf(_a0) @@ -1187,6 +1421,10 @@ func (_m *Store) OrgCreate(_a0 *model.Org) error { func (_m *Store) OrgDelete(_a0 int64) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(int64) error); ok { r0 = rf(_a0) @@ -1201,6 +1439,10 @@ func (_m *Store) OrgDelete(_a0 int64) error { func (_m *Store) OrgFindByName(_a0 string) (*model.Org, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgFindByName") + } + var r0 *model.Org var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Org, error)); ok { @@ -1227,6 +1469,10 @@ func (_m *Store) OrgFindByName(_a0 string) (*model.Org, error) { func (_m *Store) OrgGet(_a0 int64) (*model.Org, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgGet") + } + var r0 *model.Org var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Org, error)); ok { @@ -1253,6 +1499,10 @@ func (_m *Store) OrgGet(_a0 int64) (*model.Org, error) { func (_m *Store) OrgList(_a0 *model.ListOptions) ([]*model.Org, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgList") + } + var r0 []*model.Org var r1 error if rf, ok := ret.Get(0).(func(*model.ListOptions) ([]*model.Org, error)); ok { @@ -1279,6 +1529,10 @@ func (_m *Store) OrgList(_a0 *model.ListOptions) ([]*model.Org, error) { func (_m *Store) OrgRepoList(_a0 *model.Org, _a1 *model.ListOptions) ([]*model.Repo, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for OrgRepoList") + } + var r0 []*model.Repo var r1 error if rf, ok := ret.Get(0).(func(*model.Org, *model.ListOptions) ([]*model.Repo, error)); ok { @@ -1305,6 +1559,10 @@ func (_m *Store) OrgRepoList(_a0 *model.Org, _a1 *model.ListOptions) ([]*model.R func (_m *Store) OrgSecretFind(_a0 int64, _a1 string) (*model.Secret, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for OrgSecretFind") + } + var r0 *model.Secret var r1 error if rf, ok := ret.Get(0).(func(int64, string) (*model.Secret, error)); ok { @@ -1331,6 +1589,10 @@ func (_m *Store) OrgSecretFind(_a0 int64, _a1 string) (*model.Secret, error) { func (_m *Store) OrgSecretList(_a0 int64, _a1 *model.ListOptions) ([]*model.Secret, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for OrgSecretList") + } + var r0 []*model.Secret var r1 error if rf, ok := ret.Get(0).(func(int64, *model.ListOptions) ([]*model.Secret, error)); ok { @@ -1357,6 +1619,10 @@ func (_m *Store) OrgSecretList(_a0 int64, _a1 *model.ListOptions) ([]*model.Secr func (_m *Store) OrgUpdate(_a0 *model.Org) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for OrgUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Org) error); ok { r0 = rf(_a0) @@ -1371,6 +1637,10 @@ func (_m *Store) OrgUpdate(_a0 *model.Org) error { func (_m *Store) PermDelete(perm *model.Perm) error { ret := _m.Called(perm) + if len(ret) == 0 { + panic("no return value specified for PermDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Perm) error); ok { r0 = rf(perm) @@ -1385,6 +1655,10 @@ func (_m *Store) PermDelete(perm *model.Perm) error { func (_m *Store) PermFind(user *model.User, repo *model.Repo) (*model.Perm, error) { ret := _m.Called(user, repo) + if len(ret) == 0 { + panic("no return value specified for PermFind") + } + var r0 *model.Perm var r1 error if rf, ok := ret.Get(0).(func(*model.User, *model.Repo) (*model.Perm, error)); ok { @@ -1411,6 +1685,10 @@ func (_m *Store) PermFind(user *model.User, repo *model.Repo) (*model.Perm, erro func (_m *Store) PermFlush(user *model.User, before int64) error { ret := _m.Called(user, before) + if len(ret) == 0 { + panic("no return value specified for PermFlush") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.User, int64) error); ok { r0 = rf(user, before) @@ -1425,6 +1703,10 @@ func (_m *Store) PermFlush(user *model.User, before int64) error { func (_m *Store) PermUpsert(perm *model.Perm) error { ret := _m.Called(perm) + if len(ret) == 0 { + panic("no return value specified for PermUpsert") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Perm) error); ok { r0 = rf(perm) @@ -1439,6 +1721,10 @@ func (_m *Store) PermUpsert(perm *model.Perm) error { func (_m *Store) Ping() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Ping") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -1453,6 +1739,10 @@ func (_m *Store) Ping() error { func (_m *Store) PipelineConfigCreate(_a0 *model.PipelineConfig) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for PipelineConfigCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.PipelineConfig) error); ok { r0 = rf(_a0) @@ -1467,6 +1757,10 @@ func (_m *Store) PipelineConfigCreate(_a0 *model.PipelineConfig) error { func (_m *Store) RegistryCreate(_a0 *model.Registry) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for RegistryCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { r0 = rf(_a0) @@ -1481,6 +1775,10 @@ func (_m *Store) RegistryCreate(_a0 *model.Registry) error { func (_m *Store) RegistryDelete(repo *model.Repo, addr string) error { ret := _m.Called(repo, addr) + if len(ret) == 0 { + panic("no return value specified for RegistryDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo, string) error); ok { r0 = rf(repo, addr) @@ -1495,6 +1793,10 @@ func (_m *Store) RegistryDelete(repo *model.Repo, addr string) error { func (_m *Store) RegistryFind(_a0 *model.Repo, _a1 string) (*model.Registry, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for RegistryFind") + } + var r0 *model.Registry var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Registry, error)); ok { @@ -1521,6 +1823,10 @@ func (_m *Store) RegistryFind(_a0 *model.Repo, _a1 string) (*model.Registry, err func (_m *Store) RegistryList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model.Registry, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for RegistryList") + } + var r0 []*model.Registry var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, *model.ListOptions) ([]*model.Registry, error)); ok { @@ -1547,6 +1853,10 @@ func (_m *Store) RegistryList(_a0 *model.Repo, _a1 *model.ListOptions) ([]*model func (_m *Store) RegistryUpdate(_a0 *model.Registry) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for RegistryUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Registry) error); ok { r0 = rf(_a0) @@ -1561,6 +1871,10 @@ func (_m *Store) RegistryUpdate(_a0 *model.Registry) error { func (_m *Store) RepoList(user *model.User, owned bool, active bool) ([]*model.Repo, error) { ret := _m.Called(user, owned, active) + if len(ret) == 0 { + panic("no return value specified for RepoList") + } + var r0 []*model.Repo var r1 error if rf, ok := ret.Get(0).(func(*model.User, bool, bool) ([]*model.Repo, error)); ok { @@ -1587,6 +1901,10 @@ func (_m *Store) RepoList(user *model.User, owned bool, active bool) ([]*model.R func (_m *Store) RepoListAll(active bool, p *model.ListOptions) ([]*model.Repo, error) { ret := _m.Called(active, p) + if len(ret) == 0 { + panic("no return value specified for RepoListAll") + } + var r0 []*model.Repo var r1 error if rf, ok := ret.Get(0).(func(bool, *model.ListOptions) ([]*model.Repo, error)); ok { @@ -1613,6 +1931,10 @@ func (_m *Store) RepoListAll(active bool, p *model.ListOptions) ([]*model.Repo, func (_m *Store) RepoListLatest(_a0 *model.User) ([]*model.Feed, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for RepoListLatest") + } + var r0 []*model.Feed var r1 error if rf, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { @@ -1639,6 +1961,10 @@ func (_m *Store) RepoListLatest(_a0 *model.User) ([]*model.Feed, error) { func (_m *Store) SecretCreate(_a0 *model.Secret) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for SecretCreate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { r0 = rf(_a0) @@ -1653,6 +1979,10 @@ func (_m *Store) SecretCreate(_a0 *model.Secret) error { func (_m *Store) SecretDelete(_a0 *model.Secret) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for SecretDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { r0 = rf(_a0) @@ -1667,6 +1997,10 @@ func (_m *Store) SecretDelete(_a0 *model.Secret) error { func (_m *Store) SecretFind(_a0 *model.Repo, _a1 string) (*model.Secret, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for SecretFind") + } + var r0 *model.Secret var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, string) (*model.Secret, error)); ok { @@ -1693,6 +2027,10 @@ func (_m *Store) SecretFind(_a0 *model.Repo, _a1 string) (*model.Secret, error) func (_m *Store) SecretList(_a0 *model.Repo, _a1 bool, _a2 *model.ListOptions) ([]*model.Secret, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for SecretList") + } + var r0 []*model.Secret var r1 error if rf, ok := ret.Get(0).(func(*model.Repo, bool, *model.ListOptions) ([]*model.Secret, error)); ok { @@ -1719,6 +2057,10 @@ func (_m *Store) SecretList(_a0 *model.Repo, _a1 bool, _a2 *model.ListOptions) ( func (_m *Store) SecretListAll() ([]*model.Secret, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for SecretListAll") + } + var r0 []*model.Secret var r1 error if rf, ok := ret.Get(0).(func() ([]*model.Secret, error)); ok { @@ -1745,6 +2087,10 @@ func (_m *Store) SecretListAll() ([]*model.Secret, error) { func (_m *Store) SecretUpdate(_a0 *model.Secret) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for SecretUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Secret) error); ok { r0 = rf(_a0) @@ -1759,6 +2105,10 @@ func (_m *Store) SecretUpdate(_a0 *model.Secret) error { func (_m *Store) ServerConfigDelete(_a0 string) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ServerConfigDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(_a0) @@ -1773,6 +2123,10 @@ func (_m *Store) ServerConfigDelete(_a0 string) error { func (_m *Store) ServerConfigGet(_a0 string) (string, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for ServerConfigGet") + } + var r0 string var r1 error if rf, ok := ret.Get(0).(func(string) (string, error)); ok { @@ -1797,6 +2151,10 @@ func (_m *Store) ServerConfigGet(_a0 string) (string, error) { func (_m *Store) ServerConfigSet(_a0 string, _a1 string) error { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for ServerConfigSet") + } + var r0 error if rf, ok := ret.Get(0).(func(string, string) error); ok { r0 = rf(_a0, _a1) @@ -1811,6 +2169,10 @@ func (_m *Store) ServerConfigSet(_a0 string, _a1 string) error { func (_m *Store) StepByUUID(_a0 string) (*model.Step, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for StepByUUID") + } + var r0 *model.Step var r1 error if rf, ok := ret.Get(0).(func(string) (*model.Step, error)); ok { @@ -1837,6 +2199,10 @@ func (_m *Store) StepByUUID(_a0 string) (*model.Step, error) { func (_m *Store) StepChild(_a0 *model.Pipeline, _a1 int, _a2 string) (*model.Step, error) { ret := _m.Called(_a0, _a1, _a2) + if len(ret) == 0 { + panic("no return value specified for StepChild") + } + var r0 *model.Step var r1 error if rf, ok := ret.Get(0).(func(*model.Pipeline, int, string) (*model.Step, error)); ok { @@ -1863,6 +2229,10 @@ func (_m *Store) StepChild(_a0 *model.Pipeline, _a1 int, _a2 string) (*model.Ste func (_m *Store) StepFind(_a0 *model.Pipeline, _a1 int) (*model.Step, error) { ret := _m.Called(_a0, _a1) + if len(ret) == 0 { + panic("no return value specified for StepFind") + } + var r0 *model.Step var r1 error if rf, ok := ret.Get(0).(func(*model.Pipeline, int) (*model.Step, error)); ok { @@ -1889,6 +2259,10 @@ func (_m *Store) StepFind(_a0 *model.Pipeline, _a1 int) (*model.Step, error) { func (_m *Store) StepList(_a0 *model.Pipeline) ([]*model.Step, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for StepList") + } + var r0 []*model.Step var r1 error if rf, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Step, error)); ok { @@ -1915,6 +2289,10 @@ func (_m *Store) StepList(_a0 *model.Pipeline) ([]*model.Step, error) { func (_m *Store) StepListFromWorkflowFind(_a0 *model.Workflow) ([]*model.Step, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for StepListFromWorkflowFind") + } + var r0 []*model.Step var r1 error if rf, ok := ret.Get(0).(func(*model.Workflow) ([]*model.Step, error)); ok { @@ -1941,6 +2319,10 @@ func (_m *Store) StepListFromWorkflowFind(_a0 *model.Workflow) ([]*model.Step, e func (_m *Store) StepLoad(_a0 int64) (*model.Step, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for StepLoad") + } + var r0 *model.Step var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Step, error)); ok { @@ -1967,6 +2349,10 @@ func (_m *Store) StepLoad(_a0 int64) (*model.Step, error) { func (_m *Store) StepUpdate(_a0 *model.Step) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for StepUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Step) error); ok { r0 = rf(_a0) @@ -1981,6 +2367,10 @@ func (_m *Store) StepUpdate(_a0 *model.Step) error { func (_m *Store) TaskDelete(_a0 string) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for TaskDelete") + } + var r0 error if rf, ok := ret.Get(0).(func(string) error); ok { r0 = rf(_a0) @@ -1995,6 +2385,10 @@ func (_m *Store) TaskDelete(_a0 string) error { func (_m *Store) TaskInsert(_a0 *model.Task) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for TaskInsert") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Task) error); ok { r0 = rf(_a0) @@ -2009,6 +2403,10 @@ func (_m *Store) TaskInsert(_a0 *model.Task) error { func (_m *Store) TaskList() ([]*model.Task, error) { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for TaskList") + } + var r0 []*model.Task var r1 error if rf, ok := ret.Get(0).(func() ([]*model.Task, error)); ok { @@ -2035,6 +2433,10 @@ func (_m *Store) TaskList() ([]*model.Task, error) { func (_m *Store) UpdatePipeline(_a0 *model.Pipeline) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for UpdatePipeline") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Pipeline) error); ok { r0 = rf(_a0) @@ -2049,6 +2451,10 @@ func (_m *Store) UpdatePipeline(_a0 *model.Pipeline) error { func (_m *Store) UpdateRepo(_a0 *model.Repo) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for UpdateRepo") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Repo) error); ok { r0 = rf(_a0) @@ -2063,6 +2469,10 @@ func (_m *Store) UpdateRepo(_a0 *model.Repo) error { func (_m *Store) UpdateUser(_a0 *model.User) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for UpdateUser") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.User) error); ok { r0 = rf(_a0) @@ -2077,6 +2487,10 @@ func (_m *Store) UpdateUser(_a0 *model.User) error { func (_m *Store) UserFeed(_a0 *model.User) ([]*model.Feed, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for UserFeed") + } + var r0 []*model.Feed var r1 error if rf, ok := ret.Get(0).(func(*model.User) ([]*model.Feed, error)); ok { @@ -2103,6 +2517,10 @@ func (_m *Store) UserFeed(_a0 *model.User) ([]*model.Feed, error) { func (_m *Store) WorkflowGetTree(_a0 *model.Pipeline) ([]*model.Workflow, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for WorkflowGetTree") + } + var r0 []*model.Workflow var r1 error if rf, ok := ret.Get(0).(func(*model.Pipeline) ([]*model.Workflow, error)); ok { @@ -2129,6 +2547,10 @@ func (_m *Store) WorkflowGetTree(_a0 *model.Pipeline) ([]*model.Workflow, error) func (_m *Store) WorkflowLoad(_a0 int64) (*model.Workflow, error) { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for WorkflowLoad") + } + var r0 *model.Workflow var r1 error if rf, ok := ret.Get(0).(func(int64) (*model.Workflow, error)); ok { @@ -2155,6 +2577,10 @@ func (_m *Store) WorkflowLoad(_a0 int64) (*model.Workflow, error) { func (_m *Store) WorkflowUpdate(_a0 *model.Workflow) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for WorkflowUpdate") + } + var r0 error if rf, ok := ret.Get(0).(func(*model.Workflow) error); ok { r0 = rf(_a0) @@ -2169,6 +2595,10 @@ func (_m *Store) WorkflowUpdate(_a0 *model.Workflow) error { func (_m *Store) WorkflowsCreate(_a0 []*model.Workflow) error { ret := _m.Called(_a0) + if len(ret) == 0 { + panic("no return value specified for WorkflowsCreate") + } + var r0 error if rf, ok := ret.Get(0).(func([]*model.Workflow) error); ok { r0 = rf(_a0) diff --git a/server/store/store.go b/server/store/store.go index 2806ff95ee..22075a3b8f 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -93,6 +93,8 @@ type Store interface { CreatePipeline(*model.Pipeline, ...*model.Step) error // UpdatePipeline updates a pipeline. UpdatePipeline(*model.Pipeline) error + // DeletePipeline deletes a pipeline. + DeletePipeline(*model.Pipeline) error // Feeds UserFeed(*model.User) ([]*model.Feed, error)