diff --git a/cmd/downloadBadgeSVGs/get-badges-from-shields.html b/cmd/downloadBadgeSVGs/get-badges-from-shields.html
index 2bd4ef9..96e8509 100644
--- a/cmd/downloadBadgeSVGs/get-badges-from-shields.html
+++ b/cmd/downloadBadgeSVGs/get-badges-from-shields.html
@@ -4,29 +4,20 @@
Load shields.io badges
-
-
-
Welcome to shields.io badges for arc42 status-page
+
-
-
-
-
-
-
-
-
+
Bugs
diff --git a/cmd/downloadBadgeSVGs/main.go b/cmd/downloadBadgeSVGs/main.go
index 3a2852d..a1eae86 100644
--- a/cmd/downloadBadgeSVGs/main.go
+++ b/cmd/downloadBadgeSVGs/main.go
@@ -23,24 +23,19 @@ import (
// SVGBadgePath is the constant path to the directory where SVG files for badges are stored.
const SVGBadgePath = "./svgs/"
-const IssueBadgeFileNameSuffix = "-issues.svg"
-const BugBadgeFileNameSuffix = "-bugs.svg"
-
const issuesColor = "CEA41E"
const bugsColor = "DC143C"
-const issueName = "issue"
-const bugName = "bug"
-
const badgeDownloadURLPrefix = "https://img.shields.io/badge/"
// svgFileNameForKindOf creates the filename for the downloaded issue-svg files.
+// These are required both for the downloading process AND for creating the URLs in the final output HTML
func svgFileNameForKindOf(kindOf string, count int) string {
switch kindOf {
- case issueName:
- return strconv.Itoa(count) + IssueBadgeFileNameSuffix
- case bugName:
- return strconv.Itoa(count) + BugBadgeFileNameSuffix
+ case badge.IssueName:
+ return strconv.Itoa(count) + badge.IssueBadgeFileNameSuffix
+ case badge.BugName:
+ return strconv.Itoa(count) + badge.BugBadgeFileNameSuffix
default:
log.Error().Msgf("error creating filename for count %d and kindOf %s", count, kindOf)
return "_error-" + strconv.Itoa(count)
@@ -49,9 +44,9 @@ func svgFileNameForKindOf(kindOf string, count int) string {
func badgeColorForKindOf(kindOf string) string {
switch kindOf {
- case issueName:
+ case badge.IssueName:
return issuesColor
- case bugName:
+ case badge.BugName:
return bugsColor
default:
return issuesColor
@@ -138,7 +133,7 @@ func main() {
// so we have a filesystem location to store SVG files
createSVGBadgeDirIfNotPresent(SVGBadgePath)
- downloadSVGBadgesForKindof(issueName)
- downloadSVGBadgesForKindof(bugName)
+ downloadSVGBadgesForKindof(badge.IssueName)
+ downloadSVGBadgesForKindof(badge.BugName)
}
diff --git a/internal/badge/badges.go b/internal/badge/badges.go
index 213c3fb..5634784 100644
--- a/internal/badge/badges.go
+++ b/internal/badge/badges.go
@@ -11,10 +11,16 @@ import (
"strconv"
)
-const ShieldsGithubIssuesURL = "https://img.shields.io/github/issues-raw/arc42/"
+// after ADR-0006, we don't need the following URLs any more:
+// const ShieldsGithubIssuesURL = "https://img.shields.io/github/issues-raw/arc42/"
+// const ShieldsGithubBugsURLPrefix = "https://img.shields.io/github/issues-search/arc42/"
+// const ShieldsBugSuffix = "?query=label%3Abug%20is%3Aopen&label=bugs&color=red"
-const ShieldsGithubBugsURLPrefix = "https://img.shields.io/github/issues-search/arc42/"
-const ShieldsBugSuffix = "?query=label%3Abug%20is%3Aopen&label=bugs&color=red"
+const IssueName = "issue"
+const BugName = "bug"
+
+const IssueBadgeFileNameSuffix = "-issues.svg"
+const BugBadgeFileNameSuffix = "-bugs.svg"
// LocalBadgeLocation is the constant for the file path of local badge images.
// we use these local versions to save remote-requests to shields.io
@@ -24,8 +30,9 @@ const LocalBugBadgePrefix = LocalBadgeLocation + "bugs-" +
""
const LocalBadgeSvgThreshold = 20
-// bugBadgeURL returns a badge URL, which is either a local URL or a hyperlink to shields.io.
-// if the bug-count is >= 0, create a link to a badge, otherwise NO bug badge shall be shown.
+// bugBadgeURL returns a badge URL, which always refers to a local image
+// as these have been pre-generated (see ADR-0006)
+// if the nrOfBugs is >= 0, create a link to a badge, otherwise NO bug badge shall be shown.
func bugBadgeURL(site string, nrOfBugs int) string {
// shields.io bug URLS look like that:https://img.shields.io/github/issues-search/arc42/quality.arc42.org-site?query=label%3Abug%20is%3Aopen&label=bugs&color=red