SHA256
1
0

2 Commits

Author SHA256 Message Date
Michal Suchanek
d110024ff5 Add link to blocked BR in package summary 2025-11-06 18:01:16 +01:00
20e1109602 spec: packaging fixes
* Update Version to 1, since we now have devel project and updates
should have version bump instead of downgrade
* other fixes
2025-11-05 16:38:15 +01:00
3 changed files with 52 additions and 16 deletions

View File

@@ -17,7 +17,7 @@
Name: autogits
Version: 0
Version: 1
Release: 0
Summary: GitWorkflow utilities
License: GPL-2.0-or-later
@@ -41,6 +41,7 @@ Command-line tool to import devel projects from obs to git
%package doc
Summary: Common documentation files
BuildArch: noarch
%description -n autogits-doc
Common documentation files
@@ -56,10 +57,11 @@ with a topic
%package gitea-status-proxy
Summary: gitea-status-proxy
Summary: Proxy for setting commit status in Gitea
%description gitea-status-proxy
Setting commit status requires code write access token. This proxy
is middleware that delegates status setting without access to other APIs
%package group-review
Summary: Reviews of groups defined in ProjectGit
@@ -213,6 +215,18 @@ install -D -m0755 utils/hujson/hujson
%postun obs-status-service
%service_del_postun obs-status-service.service
%pre workflow-pr
%service_add_pre workflow-direct@.service
%post workflow-pr
%service_add_post workflow-direct@.service
%preun workflow-pr
%service_del_preun workflow-direct@.service
%postun workflow-pr
%service_del_postun workflow-direct@.service
%files devel-importer
%license COPYING
%doc devel-importer/README.md

View File

@@ -103,16 +103,6 @@ func ProjectStatusSummarySvg(res []*common.BuildResult) []byte {
return ret.GenerateSvg()
}
func LinkToBuildlog(R *common.BuildResult, S *common.PackageBuildStatus) string {
if R != nil && S != nil {
switch S.Code {
case "succeeded", "failed", "building":
return "/buildlog/" + url.PathEscape(R.Project) + "/" + url.PathEscape(S.Package) + "/" + url.PathEscape(R.Repository) + "/" + url.PathEscape(R.Arch)
}
}
return ""
}
func DeleteExceptPkg(pkg string) func(*common.PackageBuildStatus) bool {
return func(item *common.PackageBuildStatus) bool {
multibuild_prefix := pkg + ":"
@@ -155,8 +145,7 @@ func PackageStatusSummarySvg(pkg string, res []*common.BuildResult) []byte {
for _, s := range r.Status {
if s.Package == pkg {
link := LinkToBuildlog(r, s)
ret.WritePackageStatus(link, r.Arch, s.Code, s.Details)
ret.WritePackageStatus(r, s)
}
}
}

View File

@@ -6,6 +6,8 @@ import (
"html"
"net/url"
"slices"
"src.opensuse.org/autogits/common"
)
type SvgWriter struct {
@@ -19,6 +21,23 @@ const (
SvgType_Project
)
func LinkToBuildlogAlways(R *common.BuildResult, S *common.PackageBuildStatus) string {
if R != nil && S != nil {
return "/buildlog/" + url.PathEscape(R.Project) + "/" + url.PathEscape(S.Package) + "/" + url.PathEscape(R.Repository) + "/" + url.PathEscape(R.Arch)
}
return ""
}
func LinkToBuildlog(R *common.BuildResult, S *common.PackageBuildStatus) string {
if R != nil && S != nil {
switch S.Code {
case "succeeded", "failed", "building":
LinkToBuildlogAlways(R, S)
}
}
return ""
}
func NewSvg(SvgType int) *SvgWriter {
svg := &SvgWriter{}
svg.header = []byte(`<svg version="2.0" overflow="auto" width="40ex" height="`)
@@ -89,7 +108,11 @@ func (svg *SvgWriter) WriteSubtitle(subtitle string) {
svg.ypos += 2
}
func (svg *SvgWriter) WritePackageStatus(loglink, arch, status, detail string) {
func (svg *SvgWriter) WritePackageStatus(r *common.BuildResult, s *common.PackageBuildStatus) {
loglink := LinkToBuildlogAlways(r, s)
arch := r.Arch
status := s.Code
detail := s.Details
StatusToSVG := func(S string) string {
switch S {
case "succeeded":
@@ -112,8 +135,18 @@ func (svg *SvgWriter) WritePackageStatus(loglink, arch, status, detail string) {
return "un"
}
if len(loglink) > 0 {
u, err := url.Parse(loglink)
if err == nil {
svg.out.WriteString(`<a href="` + u.String() + `" target="_blank" rel="noopener">`)
}
}
svg.out.WriteString(`<text fill="#113" x="5ex" y="` + fmt.Sprint(svg.ypos-.6) + `em">` + html.EscapeString(arch) + `</text>`)
if len(loglink) > 0 {
svg.out.WriteString(`</a>`)
}
svg.out.WriteString(`<g>`)
loglink = LinkToBuildlog(r, s)
if len(loglink) > 0 {
u, err := url.Parse(loglink)
if err == nil {