From 68218b948bf947ab399004ec3691cbf89325eb5a Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Thu, 25 Apr 2024 12:52:23 +0200 Subject: [PATCH] fix: correct formatting for provenance --- pkg/trustyapi/trustyapi.go | 6 +++--- pkg/trustyapi/trustyapi_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/trustyapi/trustyapi.go b/pkg/trustyapi/trustyapi.go index 2175ce2..619f76a 100644 --- a/pkg/trustyapi/trustyapi.go +++ b/pkg/trustyapi/trustyapi.go @@ -171,9 +171,9 @@ func ProcessDependency(dep string, ecosystem string, scoreThreshold float64) (st } else { // need to write regular provenance info reportBuilder.WriteString("### :key: Proof of origin (Provenance):\n") - reportBuilder.WriteString(fmt.Sprintf("# versions: %.0f\n", result.Provenance.Description.Hp.Versions)) - reportBuilder.WriteString(fmt.Sprintf("# tags: %.0f\n", result.Provenance.Description.Hp.Tags)) - reportBuilder.WriteString(fmt.Sprintf("# matched: %.0f\n", result.Provenance.Description.Hp.Common)) + reportBuilder.WriteString(fmt.Sprintf("· Number of versions: %.0f\n", result.Provenance.Description.Hp.Versions)) + reportBuilder.WriteString(fmt.Sprintf("· Number of Git Tags/Releases: %.0f\n", result.Provenance.Description.Hp.Tags)) + reportBuilder.WriteString(fmt.Sprintf("· Number of versions matched to Git Tags/Releases: %.0f\n", result.Provenance.Description.Hp.Common)) } reportBuilder.WriteString("[Learn more about source of origin provenance](https://docs.stacklok.com/trusty/understand/provenance)\n") diff --git a/pkg/trustyapi/trustyapi_test.go b/pkg/trustyapi/trustyapi_test.go index 7bf9eab..39af669 100644 --- a/pkg/trustyapi/trustyapi_test.go +++ b/pkg/trustyapi/trustyapi_test.go @@ -86,13 +86,13 @@ func TestProcessHistoricalProvenance(t *testing.T) { scoreThreshold := 10.0 report, _ := ProcessDependency("openpgp", ecosystem, scoreThreshold) - if !strings.Contains(report, "# versions") { + if !strings.Contains(report, "Number of versions") { t.Errorf("Versions for historical provenance not populated") } - if !strings.Contains(report, "# tags") { + if !strings.Contains(report, "Number of Git Tags/Releases") { t.Errorf("Tags for historical provenance not populated") } - if !strings.Contains(report, "# matched") { + if !strings.Contains(report, "Number of versions matched to Git Tags/Releases") { t.Errorf("Matched for historical provenance not populated") }