diff --git a/obs-staging-bot/main.go b/obs-staging-bot/main.go index 2892cc4..7a1f39a 100644 --- a/obs-staging-bot/main.go +++ b/obs-staging-bot/main.go @@ -362,7 +362,8 @@ func processPullNotification(gitea common.Gitea, thread *models.NotificationThre } }() - git, err := common.CreateGitHandler(GitAuthor, "noaddress@suse.de", BotName) + gh := common.GitHandlerImpl{} + git, err := gh.CreateGitHandler(GitAuthor, "noaddress@suse.de", BotName) if err != nil { log.Panicln(err) } diff --git a/workflow-pr/maintainership.go b/workflow-pr/maintainership.go index 06727cf..5ff42c5 100644 --- a/workflow-pr/maintainership.go +++ b/workflow-pr/maintainership.go @@ -64,13 +64,14 @@ prjMaintainer: func CheckIfMaintainersApproved(gitea GiteaMaintainershipInterface, config common.AutogitConfig, prjGitPRNumber int64) (bool, error) { gitea.GetPullRequestAndReviews(config.Organization, config.GitProjectName, prjGitPRNumber) - gitea.FetchMaintainershipFile(config.Organization, config.GitProjectName, config.Branch) + data, _ := gitea.FetchMaintainershipFile(config.Organization, config.GitProjectName, config.Branch) + parseMaintainershipData(data) /* - pr, reviews, _ := gitea.GetPullRequestAndReviews(config.Organization, config.GitProjectName, prjGitPRNumber) - data, _ := gitea.FetchMaintainershipFile(config.Organization, config.GitProjectName, config.Branch) + pr, reviews, _ := gitea.GetPullRequestAndReviews(config.Organization, config.GitProjectName, prjGitPRNumber) + data, _ := gitea.FetchMaintainershipFile(config.Organization, config.GitProjectName, config.Branch) - maintainers, _ := parseMaintainershipData(data) - */ + maintainers, _ := parseMaintainershipData(data) +*/ return false, nil } diff --git a/workflow-pr/pr.go b/workflow-pr/pr.go new file mode 100644 index 0000000..cd57c71 --- /dev/null +++ b/workflow-pr/pr.go @@ -0,0 +1,5 @@ +package main + +//go:generate mockgen -source=pr.go -destination=mock/pr.go -typed + + diff --git a/workflow-pr/pr_processor.go b/workflow-pr/pr_processor.go index a14384c..b08459c 100644 --- a/workflow-pr/pr_processor.go +++ b/workflow-pr/pr_processor.go @@ -1,6 +1,6 @@ package main -//go:generate mockgen -source=pr.go -destination=mock/pr.go -typed +//go:generate mockgen -source=pr_processor.go -destination=mock/pr_processor.go -typed import ( "fmt" diff --git a/workflow-pr/pr_test.go b/workflow-pr/pr_test.go new file mode 100644 index 0000000..cad7c9b --- /dev/null +++ b/workflow-pr/pr_test.go @@ -0,0 +1,10 @@ +package main + +import "testing" + +func TestPR(t *testing.T) { + t.Run("Test simple PR to PrjGit checkout", func(t *testing.T) { + + }) +} +