Skip to content
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.

KM498 🐛 Move functions to GithubService #917

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/release_notes/0.0.92.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## Bugfixes

KM498 🐛 Move functions to GithubService (#917)

## Changes

## Other
Expand Down
5 changes: 0 additions & 5 deletions pkg/client/github_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ type DeleteGithubDeployKeyOpts struct {
type GithubService interface {
CreateGithubRepository(ctx context.Context, opts CreateGithubRepositoryOpts) (*GithubRepository, error)
DeleteGithubRepository(ctx context.Context, opts DeleteGithubRepositoryOpts) error
ListReleases(owner, repo string) ([]*github.RepositoryRelease, error)
}

// GithubAPI invokes the Github API
type GithubAPI interface {
CreateRepositoryDeployKey(opts CreateGithubDeployKeyOpts) (*GithubDeployKey, error)
DeleteRepositoryDeployKey(opts DeleteGithubDeployKeyOpts) error
ListReleases(owner, repo string) ([]*github.RepositoryRelease, error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ func (m mockGithubService) ListReleases(_, _ string) ([]*github.RepositoryReleas
return nil, nil
}

func (m mockGithubService) CreateRepositoryDeployKey(_ client.CreateGithubDeployKeyOpts) (*client.GithubDeployKey, error) {
return nil, nil
}

func (m mockGithubService) DeleteRepositoryDeployKey(_ client.DeleteGithubDeployKeyOpts) error {
return nil
}

type mockArgoCDState struct {
exists bool
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/upgrade/testhelper_github_service_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ type githubServiceMock struct {
releases []*github.RepositoryRelease
}

func (g githubServiceMock) CreateRepositoryDeployKey(_ client.CreateGithubDeployKeyOpts) (*client.GithubDeployKey, error) {
panic("not needed by mock")
}

func (g githubServiceMock) DeleteRepositoryDeployKey(_ client.DeleteGithubDeployKeyOpts) error {
panic("not needed by mock")
}

func (g githubServiceMock) CreateGithubRepository(context.Context, client.CreateGithubRepositoryOpts) (*client.GithubRepository, error) {
panic("not needed by mock")
}
Expand Down