From fa61af0db6bd4a5a7af2b24a8fd623c93b035548cf1429e898d8740e43b90e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 5 May 2025 11:26:07 +0200 Subject: [PATCH] Implement detection for local repositories Repositories which build against another repo in the same project need to do so also in the forked project. This is eg for consuming rpms from one repo in an image build from same project. --- obs-staging-bot/main.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/obs-staging-bot/main.go b/obs-staging-bot/main.go index ea184f1..8085da4 100644 --- a/obs-staging-bot/main.go +++ b/obs-staging-bot/main.go @@ -300,10 +300,20 @@ func GenerateObsPrjMeta(git common.Git, gitea common.Gitea, pr *models.PullReque // set paths to parent project for idx, r := range meta.Repositories { - meta.Repositories[idx].Paths = []common.RepositoryPathMeta{{ - Project: buildPrj, - Repository: r.Name, - }} + localRepository := false + for pidx, path := range r.Paths { + // Check for path building against a repo in template project itself + if path.Project == buildPrj { + meta.Repositories[idx].Paths[pidx].Project = meta.Name + localRepository = true + } + } + if localRepository != true { + meta.Repositories[idx].Paths = []common.RepositoryPathMeta{{ + Project: buildPrj, + Repository: r.Name, + }} + } } return meta, nil } -- 2.51.1