forked from adamm/autogits
Compare commits
3 Commits
main
...
generate-b
Author | SHA256 | Date | |
---|---|---|---|
|
8ce88be8c5
|
||
|
49a277e843
|
||
|
a9be9cbab2
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,3 @@
|
|||||||
mock
|
|
||||||
node_modules
|
node_modules
|
||||||
*.obscpio
|
*.obscpio
|
||||||
autogits-tmp.tar.zst
|
autogits-tmp.tar.zst
|
||||||
|
113
autogits.spec
113
autogits.spec
@@ -23,6 +23,7 @@ Summary: GitWorkflow utilities
|
|||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
URL: https://src.opensuse.org/adamm/autogits
|
URL: https://src.opensuse.org/adamm/autogits
|
||||||
Source1: vendor.tar.zst
|
Source1: vendor.tar.zst
|
||||||
|
BuildRequires: git
|
||||||
BuildRequires: golang-packaging
|
BuildRequires: golang-packaging
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: zstd
|
BuildRequires: zstd
|
||||||
@@ -33,6 +34,22 @@ Git Workflow tooling and utilities enabling automated handing of OBS projects
|
|||||||
as git repositories
|
as git repositories
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%package -n devel-importer
|
||||||
|
Summary: Imports devel projects from obs to git
|
||||||
|
|
||||||
|
%description -n devel-importer
|
||||||
|
Command-line tool to import devel projects from obs to git
|
||||||
|
|
||||||
|
|
||||||
|
%package -n doc
|
||||||
|
Summary: Common documentation files
|
||||||
|
|
||||||
|
%description -n doc
|
||||||
|
Common documentation files
|
||||||
|
|
||||||
|
|
||||||
%package -n gitea-events-rabbitmq-publisher
|
%package -n gitea-events-rabbitmq-publisher
|
||||||
Summary: Publishes Gitea webhook data via RabbitMQ
|
Summary: Publishes Gitea webhook data via RabbitMQ
|
||||||
|
|
||||||
@@ -42,18 +59,10 @@ with a topic
|
|||||||
<scope>.src.$organization.$webhook_type.[$webhook_action_type]
|
<scope>.src.$organization.$webhook_type.[$webhook_action_type]
|
||||||
|
|
||||||
|
|
||||||
%package -n doc
|
%package -n gitea-status-proxy
|
||||||
Summary: Common documentation files
|
Summary: gitea-status-proxy
|
||||||
|
|
||||||
%description -n doc
|
%description -n gitea-status-proxy
|
||||||
Common documentation files
|
|
||||||
|
|
||||||
|
|
||||||
%package -n devel-importer
|
|
||||||
Summary: Imports devel projects from obs to git
|
|
||||||
|
|
||||||
%description -n devel-importer
|
|
||||||
Command-line tool to import devel projects from obs to git
|
|
||||||
|
|
||||||
|
|
||||||
%package -n group-review
|
%package -n group-review
|
||||||
@@ -64,6 +73,12 @@ Is used to handle reviews associated with groups defined in the
|
|||||||
ProjectGit.
|
ProjectGit.
|
||||||
|
|
||||||
|
|
||||||
|
%package -n obs-forward-bot
|
||||||
|
Summary: obs-forward-bot
|
||||||
|
|
||||||
|
%description -n obs-forward-bot
|
||||||
|
|
||||||
|
|
||||||
%package -n obs-staging-bot
|
%package -n obs-staging-bot
|
||||||
Summary: Build a PR against a ProjectGit, if review is requested
|
Summary: Build a PR against a ProjectGit, if review is requested
|
||||||
|
|
||||||
@@ -98,18 +113,26 @@ cp -r /home/abuild/rpmbuild/SOURCES/* ./
|
|||||||
tar x --zstd -f %{SOURCE1}
|
tar x --zstd -f %{SOURCE1}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
go build \
|
|
||||||
-C gitea-events-rabbitmq-publisher \
|
|
||||||
-mod=vendor \
|
|
||||||
-buildmode=pie
|
|
||||||
go build \
|
go build \
|
||||||
-C devel-importer \
|
-C devel-importer \
|
||||||
-mod=vendor \
|
-mod=vendor \
|
||||||
-buildmode=pie
|
-buildmode=pie
|
||||||
|
go build \
|
||||||
|
-C gitea-events-rabbitmq-publisher \
|
||||||
|
-mod=vendor \
|
||||||
|
-buildmode=pie
|
||||||
|
go build \
|
||||||
|
-C gitea_status_proxy \
|
||||||
|
-mod=vendor \
|
||||||
|
-buildmode=pie
|
||||||
go build \
|
go build \
|
||||||
-C group-review \
|
-C group-review \
|
||||||
-mod=vendor \
|
-mod=vendor \
|
||||||
-buildmode=pie
|
-buildmode=pie
|
||||||
|
go build \
|
||||||
|
-C obs-forward-bot \
|
||||||
|
-mod=vendor \
|
||||||
|
-buildmode=pie
|
||||||
go build \
|
go build \
|
||||||
-C obs-staging-bot \
|
-C obs-staging-bot \
|
||||||
-mod=vendor \
|
-mod=vendor \
|
||||||
@@ -118,24 +141,36 @@ go build \
|
|||||||
-C obs-status-service \
|
-C obs-status-service \
|
||||||
-mod=vendor \
|
-mod=vendor \
|
||||||
-buildmode=pie
|
-buildmode=pie
|
||||||
#go build \
|
go build \
|
||||||
# -C workflow-direct \
|
-C workflow-direct \
|
||||||
# -mod=vendor \
|
-mod=vendor \
|
||||||
# -buildmode=pie
|
-buildmode=pie
|
||||||
#go build \
|
go build \
|
||||||
# -C workflow-pr \
|
-C workflow-pr \
|
||||||
# -mod=vendor \
|
-mod=vendor \
|
||||||
# -buildmode=pie
|
-buildmode=pie
|
||||||
|
|
||||||
|
%check
|
||||||
|
# TODO currently needs the source git history, maybe rewrite to create a git repo in the test?
|
||||||
|
#go test -C common
|
||||||
|
go test -C group-review
|
||||||
|
go test -C obs-staging-bot
|
||||||
|
go test -C obs-status-service
|
||||||
|
go test -C workflow-direct
|
||||||
|
# TODO build fails
|
||||||
|
go test -C workflow-pr
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
install -D -m0755 devel-importer/devel-importer %{buildroot}%{_bindir}/devel-importer
|
||||||
install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir}/gitea-events-rabbitmq-publisher
|
install -D -m0755 gitea-events-rabbitmq-publisher/gitea-events-rabbitmq-publisher %{buildroot}%{_bindir}/gitea-events-rabbitmq-publisher
|
||||||
install -D -m0644 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
install -D -m0644 systemd/gitea-events-rabbitmq-publisher.service %{buildroot}%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
||||||
install -D -m0755 devel-importer/devel-importer %{buildroot}%{_bindir}/devel-importer
|
install -D -m0755 gitea_status_proxy/gitea_status_proxy %{buildroot}%{_bindir}/gitea_status_proxy
|
||||||
install -D -m0755 group-review/group-review %{buildroot}%{_bindir}/group-review
|
install -D -m0755 group-review/group-review %{buildroot}%{_bindir}/group-review
|
||||||
|
install -D -m0755 obs-forward-bot/obs-forward-bot %{buildroot}%{_bindir}/obs-forward-bot
|
||||||
install -D -m0755 obs-staging-bot/obs-staging-bot %{buildroot}%{_bindir}/obs-staging-bot
|
install -D -m0755 obs-staging-bot/obs-staging-bot %{buildroot}%{_bindir}/obs-staging-bot
|
||||||
install -D -m0755 obs-status-service/obs-status-service %{buildroot}%{_bindir}/obs-status-service
|
install -D -m0755 obs-status-service/obs-status-service %{buildroot}%{_bindir}/obs-status-service
|
||||||
#install -D -m0755 workflow-direct/workflow-direct %{buildroot}%{_bindir}/workflow-direct
|
install -D -m0755 workflow-direct/workflow-direct %{buildroot}%{_bindir}/workflow-direct
|
||||||
#install -D -m0755 workflow-pr/workflow-pr %{buildroot}%{_bindir}/workflow-pr
|
install -D -m0755 workflow-pr/workflow-pr %{buildroot}%{_bindir}/workflow-pr
|
||||||
|
|
||||||
%pre -n gitea-events-rabbitmq-publisher
|
%pre -n gitea-events-rabbitmq-publisher
|
||||||
%service_add_pre gitea-events-rabbitmq-publisher.service
|
%service_add_pre gitea-events-rabbitmq-publisher.service
|
||||||
@@ -149,27 +184,35 @@ install -D -m0755 obs-status-service/obs-status-service
|
|||||||
%postun -n gitea-events-rabbitmq-publisher
|
%postun -n gitea-events-rabbitmq-publisher
|
||||||
%service_del_postun gitea-events-rabbitmq-publisher.service
|
%service_del_postun gitea-events-rabbitmq-publisher.service
|
||||||
|
|
||||||
%files -n gitea-events-rabbitmq-publisher
|
%files -n devel-importer
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc gitea-events-rabbitmq-publisher/README.md
|
%doc devel-importer/README.md
|
||||||
%{_bindir}/gitea-events-rabbitmq-publisher
|
%{_bindir}/devel-importer
|
||||||
%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
|
||||||
|
|
||||||
%files -n doc
|
%files -n doc
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc doc/README.md
|
%doc doc/README.md
|
||||||
%doc doc/workflows.md
|
%doc doc/workflows.md
|
||||||
|
|
||||||
%files -n devel-importer
|
%files -n gitea-events-rabbitmq-publisher
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc devel-importer/README.md
|
%doc gitea-events-rabbitmq-publisher/README.md
|
||||||
%{_bindir}/devel-importer
|
%{_bindir}/gitea-events-rabbitmq-publisher
|
||||||
|
%{_unitdir}/gitea-events-rabbitmq-publisher.service
|
||||||
|
|
||||||
|
%files -n gitea-status-proxy
|
||||||
|
%license COPYING
|
||||||
|
%{_bindir}/gitea_status_proxy
|
||||||
|
|
||||||
%files -n group-review
|
%files -n group-review
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc group-review/README.md
|
%doc group-review/README.md
|
||||||
%{_bindir}/group-review
|
%{_bindir}/group-review
|
||||||
|
|
||||||
|
%files -n obs-forward-bot
|
||||||
|
%license COPYING
|
||||||
|
%{_bindir}/obs-forward-bot
|
||||||
|
|
||||||
%files -n obs-staging-bot
|
%files -n obs-staging-bot
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc obs-staging-bot/README.md
|
%doc obs-staging-bot/README.md
|
||||||
@@ -183,10 +226,10 @@ install -D -m0755 obs-status-service/obs-status-service
|
|||||||
%files -n workflow-direct
|
%files -n workflow-direct
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc workflow-direct/README.md
|
%doc workflow-direct/README.md
|
||||||
#%{_bindir}/workflow-direct
|
%{_bindir}/workflow-direct
|
||||||
|
|
||||||
%files -n workflow-pr
|
%files -n workflow-pr
|
||||||
%license COPYING
|
%license COPYING
|
||||||
%doc workflow-pr/README.md
|
%doc workflow-pr/README.md
|
||||||
#%{_bindir}/workflow-pr
|
%{_bindir}/workflow-pr
|
||||||
|
|
||||||
|
120
common/mock/config.go
Normal file
120
common/mock/config.go
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: config.go
|
||||||
|
//
|
||||||
|
// Generated by this command:
|
||||||
|
//
|
||||||
|
// mockgen -source=config.go -destination=mock/config.go -typed
|
||||||
|
//
|
||||||
|
|
||||||
|
// Package mock_common is a generated GoMock package.
|
||||||
|
package mock_common
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "go.uber.org/mock/gomock"
|
||||||
|
models "src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockGiteaFileContentAndRepoFetcher is a mock of GiteaFileContentAndRepoFetcher interface.
|
||||||
|
type MockGiteaFileContentAndRepoFetcher struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockGiteaFileContentAndRepoFetcherMockRecorder
|
||||||
|
isgomock struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockGiteaFileContentAndRepoFetcherMockRecorder is the mock recorder for MockGiteaFileContentAndRepoFetcher.
|
||||||
|
type MockGiteaFileContentAndRepoFetcherMockRecorder struct {
|
||||||
|
mock *MockGiteaFileContentAndRepoFetcher
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockGiteaFileContentAndRepoFetcher creates a new mock instance.
|
||||||
|
func NewMockGiteaFileContentAndRepoFetcher(ctrl *gomock.Controller) *MockGiteaFileContentAndRepoFetcher {
|
||||||
|
mock := &MockGiteaFileContentAndRepoFetcher{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockGiteaFileContentAndRepoFetcherMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockGiteaFileContentAndRepoFetcher) EXPECT() *MockGiteaFileContentAndRepoFetcherMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRepository mocks base method.
|
||||||
|
func (m *MockGiteaFileContentAndRepoFetcher) GetRepository(org, repo string) (*models.Repository, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetRepository", org, repo)
|
||||||
|
ret0, _ := ret[0].(*models.Repository)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRepository indicates an expected call of GetRepository.
|
||||||
|
func (mr *MockGiteaFileContentAndRepoFetcherMockRecorder) GetRepository(org, repo any) *MockGiteaFileContentAndRepoFetcherGetRepositoryCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepository", reflect.TypeOf((*MockGiteaFileContentAndRepoFetcher)(nil).GetRepository), org, repo)
|
||||||
|
return &MockGiteaFileContentAndRepoFetcherGetRepositoryCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockGiteaFileContentAndRepoFetcherGetRepositoryCall wrap *gomock.Call
|
||||||
|
type MockGiteaFileContentAndRepoFetcherGetRepositoryCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryCall) Return(arg0 *models.Repository, arg1 error) *MockGiteaFileContentAndRepoFetcherGetRepositoryCall {
|
||||||
|
c.Call = c.Call.Return(arg0, arg1)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryCall) Do(f func(string, string) (*models.Repository, error)) *MockGiteaFileContentAndRepoFetcherGetRepositoryCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryCall) DoAndReturn(f func(string, string) (*models.Repository, error)) *MockGiteaFileContentAndRepoFetcherGetRepositoryCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRepositoryFileContent mocks base method.
|
||||||
|
func (m *MockGiteaFileContentAndRepoFetcher) GetRepositoryFileContent(org, repo, hash, path string) ([]byte, string, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetRepositoryFileContent", org, repo, hash, path)
|
||||||
|
ret0, _ := ret[0].([]byte)
|
||||||
|
ret1, _ := ret[1].(string)
|
||||||
|
ret2, _ := ret[2].(error)
|
||||||
|
return ret0, ret1, ret2
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRepositoryFileContent indicates an expected call of GetRepositoryFileContent.
|
||||||
|
func (mr *MockGiteaFileContentAndRepoFetcherMockRecorder) GetRepositoryFileContent(org, repo, hash, path any) *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRepositoryFileContent", reflect.TypeOf((*MockGiteaFileContentAndRepoFetcher)(nil).GetRepositoryFileContent), org, repo, hash, path)
|
||||||
|
return &MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall wrap *gomock.Call
|
||||||
|
type MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall) Return(arg0 []byte, arg1 string, arg2 error) *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall {
|
||||||
|
c.Call = c.Call.Return(arg0, arg1, arg2)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall) Do(f func(string, string, string, string) ([]byte, string, error)) *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall) DoAndReturn(f func(string, string, string, string) ([]byte, string, error)) *MockGiteaFileContentAndRepoFetcherGetRepositoryFileContentCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
1005
common/mock/git_utils.go
Normal file
1005
common/mock/git_utils.go
Normal file
File diff suppressed because it is too large
Load Diff
2953
common/mock/gitea_utils.go
Normal file
2953
common/mock/gitea_utils.go
Normal file
File diff suppressed because it is too large
Load Diff
155
common/mock/maintainership.go
Normal file
155
common/mock/maintainership.go
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: maintainership.go
|
||||||
|
//
|
||||||
|
// Generated by this command:
|
||||||
|
//
|
||||||
|
// mockgen -source=maintainership.go -destination=mock/maintainership.go -typed
|
||||||
|
//
|
||||||
|
|
||||||
|
// Package mock_common is a generated GoMock package.
|
||||||
|
package mock_common
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "go.uber.org/mock/gomock"
|
||||||
|
models "src.opensuse.org/autogits/common/gitea-generated/models"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockMaintainershipData is a mock of MaintainershipData interface.
|
||||||
|
type MockMaintainershipData struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockMaintainershipDataMockRecorder
|
||||||
|
isgomock struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockMaintainershipDataMockRecorder is the mock recorder for MockMaintainershipData.
|
||||||
|
type MockMaintainershipDataMockRecorder struct {
|
||||||
|
mock *MockMaintainershipData
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockMaintainershipData creates a new mock instance.
|
||||||
|
func NewMockMaintainershipData(ctrl *gomock.Controller) *MockMaintainershipData {
|
||||||
|
mock := &MockMaintainershipData{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockMaintainershipDataMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockMaintainershipData) EXPECT() *MockMaintainershipDataMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsApproved mocks base method.
|
||||||
|
func (m *MockMaintainershipData) IsApproved(pkg string, reviews []*models.PullReview, submitter string) bool {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "IsApproved", pkg, reviews, submitter)
|
||||||
|
ret0, _ := ret[0].(bool)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsApproved indicates an expected call of IsApproved.
|
||||||
|
func (mr *MockMaintainershipDataMockRecorder) IsApproved(pkg, reviews, submitter any) *MockMaintainershipDataIsApprovedCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsApproved", reflect.TypeOf((*MockMaintainershipData)(nil).IsApproved), pkg, reviews, submitter)
|
||||||
|
return &MockMaintainershipDataIsApprovedCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockMaintainershipDataIsApprovedCall wrap *gomock.Call
|
||||||
|
type MockMaintainershipDataIsApprovedCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockMaintainershipDataIsApprovedCall) Return(arg0 bool) *MockMaintainershipDataIsApprovedCall {
|
||||||
|
c.Call = c.Call.Return(arg0)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockMaintainershipDataIsApprovedCall) Do(f func(string, []*models.PullReview, string) bool) *MockMaintainershipDataIsApprovedCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockMaintainershipDataIsApprovedCall) DoAndReturn(f func(string, []*models.PullReview, string) bool) *MockMaintainershipDataIsApprovedCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPackageMaintainers mocks base method.
|
||||||
|
func (m *MockMaintainershipData) ListPackageMaintainers(pkg string) []string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ListPackageMaintainers", pkg)
|
||||||
|
ret0, _ := ret[0].([]string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListPackageMaintainers indicates an expected call of ListPackageMaintainers.
|
||||||
|
func (mr *MockMaintainershipDataMockRecorder) ListPackageMaintainers(pkg any) *MockMaintainershipDataListPackageMaintainersCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPackageMaintainers", reflect.TypeOf((*MockMaintainershipData)(nil).ListPackageMaintainers), pkg)
|
||||||
|
return &MockMaintainershipDataListPackageMaintainersCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockMaintainershipDataListPackageMaintainersCall wrap *gomock.Call
|
||||||
|
type MockMaintainershipDataListPackageMaintainersCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockMaintainershipDataListPackageMaintainersCall) Return(arg0 []string) *MockMaintainershipDataListPackageMaintainersCall {
|
||||||
|
c.Call = c.Call.Return(arg0)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockMaintainershipDataListPackageMaintainersCall) Do(f func(string) []string) *MockMaintainershipDataListPackageMaintainersCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockMaintainershipDataListPackageMaintainersCall) DoAndReturn(f func(string) []string) *MockMaintainershipDataListPackageMaintainersCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListProjectMaintainers mocks base method.
|
||||||
|
func (m *MockMaintainershipData) ListProjectMaintainers() []string {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ListProjectMaintainers")
|
||||||
|
ret0, _ := ret[0].([]string)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListProjectMaintainers indicates an expected call of ListProjectMaintainers.
|
||||||
|
func (mr *MockMaintainershipDataMockRecorder) ListProjectMaintainers() *MockMaintainershipDataListProjectMaintainersCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProjectMaintainers", reflect.TypeOf((*MockMaintainershipData)(nil).ListProjectMaintainers))
|
||||||
|
return &MockMaintainershipDataListProjectMaintainersCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockMaintainershipDataListProjectMaintainersCall wrap *gomock.Call
|
||||||
|
type MockMaintainershipDataListProjectMaintainersCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockMaintainershipDataListProjectMaintainersCall) Return(arg0 []string) *MockMaintainershipDataListProjectMaintainersCall {
|
||||||
|
c.Call = c.Call.Return(arg0)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockMaintainershipDataListProjectMaintainersCall) Do(f func() []string) *MockMaintainershipDataListProjectMaintainersCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockMaintainershipDataListProjectMaintainersCall) DoAndReturn(f func() []string) *MockMaintainershipDataListProjectMaintainersCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
85
common/mock/obs_utils.go
Normal file
85
common/mock/obs_utils.go
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: obs_utils.go
|
||||||
|
//
|
||||||
|
// Generated by this command:
|
||||||
|
//
|
||||||
|
// mockgen -source=obs_utils.go -destination=mock/obs_utils.go -typed
|
||||||
|
//
|
||||||
|
|
||||||
|
// Package mock_common is a generated GoMock package.
|
||||||
|
package mock_common
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "go.uber.org/mock/gomock"
|
||||||
|
common "src.opensuse.org/autogits/common"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockObsStatusFetcherWithState is a mock of ObsStatusFetcherWithState interface.
|
||||||
|
type MockObsStatusFetcherWithState struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockObsStatusFetcherWithStateMockRecorder
|
||||||
|
isgomock struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockObsStatusFetcherWithStateMockRecorder is the mock recorder for MockObsStatusFetcherWithState.
|
||||||
|
type MockObsStatusFetcherWithStateMockRecorder struct {
|
||||||
|
mock *MockObsStatusFetcherWithState
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockObsStatusFetcherWithState creates a new mock instance.
|
||||||
|
func NewMockObsStatusFetcherWithState(ctrl *gomock.Controller) *MockObsStatusFetcherWithState {
|
||||||
|
mock := &MockObsStatusFetcherWithState{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockObsStatusFetcherWithStateMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockObsStatusFetcherWithState) EXPECT() *MockObsStatusFetcherWithStateMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildStatusWithState mocks base method.
|
||||||
|
func (m *MockObsStatusFetcherWithState) BuildStatusWithState(project string, opts *common.BuildResultOptions, packages ...string) (*common.BuildResultList, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
varargs := []any{project, opts}
|
||||||
|
for _, a := range packages {
|
||||||
|
varargs = append(varargs, a)
|
||||||
|
}
|
||||||
|
ret := m.ctrl.Call(m, "BuildStatusWithState", varargs...)
|
||||||
|
ret0, _ := ret[0].(*common.BuildResultList)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// BuildStatusWithState indicates an expected call of BuildStatusWithState.
|
||||||
|
func (mr *MockObsStatusFetcherWithStateMockRecorder) BuildStatusWithState(project, opts any, packages ...any) *MockObsStatusFetcherWithStateBuildStatusWithStateCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
varargs := append([]any{project, opts}, packages...)
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BuildStatusWithState", reflect.TypeOf((*MockObsStatusFetcherWithState)(nil).BuildStatusWithState), varargs...)
|
||||||
|
return &MockObsStatusFetcherWithStateBuildStatusWithStateCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockObsStatusFetcherWithStateBuildStatusWithStateCall wrap *gomock.Call
|
||||||
|
type MockObsStatusFetcherWithStateBuildStatusWithStateCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockObsStatusFetcherWithStateBuildStatusWithStateCall) Return(arg0 *common.BuildResultList, arg1 error) *MockObsStatusFetcherWithStateBuildStatusWithStateCall {
|
||||||
|
c.Call = c.Call.Return(arg0, arg1)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockObsStatusFetcherWithStateBuildStatusWithStateCall) Do(f func(string, *common.BuildResultOptions, ...string) (*common.BuildResultList, error)) *MockObsStatusFetcherWithStateBuildStatusWithStateCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockObsStatusFetcherWithStateBuildStatusWithStateCall) DoAndReturn(f func(string, *common.BuildResultOptions, ...string) (*common.BuildResultList, error)) *MockObsStatusFetcherWithStateBuildStatusWithStateCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
BIN
vendor.tar.zst
(Stored with Git LFS)
BIN
vendor.tar.zst
(Stored with Git LFS)
Binary file not shown.
10
workflow-pr/mock/pr_processor.go
Normal file
10
workflow-pr/mock/pr_processor.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: pr_processor.go
|
||||||
|
//
|
||||||
|
// Generated by this command:
|
||||||
|
//
|
||||||
|
// mockgen -source=pr_processor.go -destination=mock/pr_processor.go -typed
|
||||||
|
//
|
||||||
|
|
||||||
|
// Package mock_main is a generated GoMock package.
|
||||||
|
package mock_main
|
157
workflow-pr/mock/state_checker.go
Normal file
157
workflow-pr/mock/state_checker.go
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: state_checker.go
|
||||||
|
//
|
||||||
|
// Generated by this command:
|
||||||
|
//
|
||||||
|
// mockgen -source=state_checker.go -destination=../mock/state_checker.go -typed -package mock_main
|
||||||
|
//
|
||||||
|
|
||||||
|
// Package mock_main is a generated GoMock package.
|
||||||
|
package mock_main
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "go.uber.org/mock/gomock"
|
||||||
|
common "src.opensuse.org/autogits/common"
|
||||||
|
interfaces "src.opensuse.org/autogits/workflow-pr/interfaces"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockStateChecker is a mock of StateChecker interface.
|
||||||
|
type MockStateChecker struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockStateCheckerMockRecorder
|
||||||
|
isgomock struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockStateCheckerMockRecorder is the mock recorder for MockStateChecker.
|
||||||
|
type MockStateCheckerMockRecorder struct {
|
||||||
|
mock *MockStateChecker
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockStateChecker creates a new mock instance.
|
||||||
|
func NewMockStateChecker(ctrl *gomock.Controller) *MockStateChecker {
|
||||||
|
mock := &MockStateChecker{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockStateCheckerMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockStateChecker) EXPECT() *MockStateCheckerMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckRepos mocks base method.
|
||||||
|
func (m *MockStateChecker) CheckRepos() error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "CheckRepos")
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckRepos indicates an expected call of CheckRepos.
|
||||||
|
func (mr *MockStateCheckerMockRecorder) CheckRepos() *MockStateCheckerCheckReposCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckRepos", reflect.TypeOf((*MockStateChecker)(nil).CheckRepos))
|
||||||
|
return &MockStateCheckerCheckReposCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockStateCheckerCheckReposCall wrap *gomock.Call
|
||||||
|
type MockStateCheckerCheckReposCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockStateCheckerCheckReposCall) Return(arg0 error) *MockStateCheckerCheckReposCall {
|
||||||
|
c.Call = c.Call.Return(arg0)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockStateCheckerCheckReposCall) Do(f func() error) *MockStateCheckerCheckReposCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockStateCheckerCheckReposCall) DoAndReturn(f func() error) *MockStateCheckerCheckReposCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConsistencyCheckProcess mocks base method.
|
||||||
|
func (m *MockStateChecker) ConsistencyCheckProcess() error {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "ConsistencyCheckProcess")
|
||||||
|
ret0, _ := ret[0].(error)
|
||||||
|
return ret0
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConsistencyCheckProcess indicates an expected call of ConsistencyCheckProcess.
|
||||||
|
func (mr *MockStateCheckerMockRecorder) ConsistencyCheckProcess() *MockStateCheckerConsistencyCheckProcessCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsistencyCheckProcess", reflect.TypeOf((*MockStateChecker)(nil).ConsistencyCheckProcess))
|
||||||
|
return &MockStateCheckerConsistencyCheckProcessCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockStateCheckerConsistencyCheckProcessCall wrap *gomock.Call
|
||||||
|
type MockStateCheckerConsistencyCheckProcessCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockStateCheckerConsistencyCheckProcessCall) Return(arg0 error) *MockStateCheckerConsistencyCheckProcessCall {
|
||||||
|
c.Call = c.Call.Return(arg0)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockStateCheckerConsistencyCheckProcessCall) Do(f func() error) *MockStateCheckerConsistencyCheckProcessCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockStateCheckerConsistencyCheckProcessCall) DoAndReturn(f func() error) *MockStateCheckerConsistencyCheckProcessCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// VerifyProjectState mocks base method.
|
||||||
|
func (m *MockStateChecker) VerifyProjectState(configs *common.AutogitConfig) ([]*interfaces.PRToProcess, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "VerifyProjectState", configs)
|
||||||
|
ret0, _ := ret[0].([]*interfaces.PRToProcess)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// VerifyProjectState indicates an expected call of VerifyProjectState.
|
||||||
|
func (mr *MockStateCheckerMockRecorder) VerifyProjectState(configs any) *MockStateCheckerVerifyProjectStateCall {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyProjectState", reflect.TypeOf((*MockStateChecker)(nil).VerifyProjectState), configs)
|
||||||
|
return &MockStateCheckerVerifyProjectStateCall{Call: call}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockStateCheckerVerifyProjectStateCall wrap *gomock.Call
|
||||||
|
type MockStateCheckerVerifyProjectStateCall struct {
|
||||||
|
*gomock.Call
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return rewrite *gomock.Call.Return
|
||||||
|
func (c *MockStateCheckerVerifyProjectStateCall) Return(arg0 []*interfaces.PRToProcess, arg1 error) *MockStateCheckerVerifyProjectStateCall {
|
||||||
|
c.Call = c.Call.Return(arg0, arg1)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do rewrite *gomock.Call.Do
|
||||||
|
func (c *MockStateCheckerVerifyProjectStateCall) Do(f func(*common.AutogitConfig) ([]*interfaces.PRToProcess, error)) *MockStateCheckerVerifyProjectStateCall {
|
||||||
|
c.Call = c.Call.Do(f)
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// DoAndReturn rewrite *gomock.Call.DoAndReturn
|
||||||
|
func (c *MockStateCheckerVerifyProjectStateCall) DoAndReturn(f func(*common.AutogitConfig) ([]*interfaces.PRToProcess, error)) *MockStateCheckerVerifyProjectStateCall {
|
||||||
|
c.Call = c.Call.DoAndReturn(f)
|
||||||
|
return c
|
||||||
|
}
|
Reference in New Issue
Block a user