Unverified Commit ba7b18b8 authored by shendongdong's avatar shendongdong Committed by GitHub
Browse files

add repo namespace saving logic (#1779)

Signed-off-by: default avatarallenshen <shendongdong@koderover.com>
parent 833e6db6
Showing with 17 additions and 4 deletions
+17 -4
......@@ -335,6 +335,12 @@ func FindWorkflow(workflowName string, log *zap.SugaredLogger) (*commonmodels.Wo
}
}
for _, module := range resp.BuildStage.Modules {
for _, bf := range module.BranchFilter {
bf.RepoNamespace = bf.GetNamespace()
}
}
return resp, nil
}
......
......@@ -65,14 +65,21 @@ type Repository struct {
type BranchFilterInfo struct {
// repository identifier
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
CodehostID int `bson:"codehost_id" json:"codehost_id"`
RepoOwner string `bson:"repo_owner" json:"repo_owner"`
RepoName string `bson:"repo_name" json:"repo_name"`
RepoNamespace string `bson:"repo_namespace" json:"repo_namespace"`
// actual regular expression filter
FilterRegExp string `bson:"filter_regexp" json:"filter_regexp"`
}
func (bf *BranchFilterInfo) GetNamespace() string {
if len(bf.RepoNamespace) > 0 {
return bf.RepoNamespace
}
return bf.RepoOwner
}
// GetReleaseCandidateTag 返回待发布对象Tag
// Branch: 20060102150405-{TaskID}-master
// PR: 20060102150405-{TaskID}-pr-1765
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment