Skip to content

Commit 6bc044b

Browse files
committed
fix(KONFLUX-141173): remove footnotes on git reporters
- notes column now displays TEST_OUTPUT.note - footnotes are now duplicating this data - footnotes are misleading in some git reporters - removing them as they are no longer required assisted by ai: Cursor Signed-off-by: nbyrne <nbyrne@redhat.com>
1 parent eb20c77 commit 6bc044b

3 files changed

Lines changed: 4 additions & 47 deletions

File tree

status/format.go

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ const summaryTemplate = `
5151
| <a href="{{ formatTaskLogURL $tr $pipelineRunName $namespace $logger }}">{{ formatTaskName $tr }}</a> | {{ $tr.GetDuration.String }} | {{ formatNamespace $tr }} | {{ formatStatus $tr }} | {{ formatDetails $tr }} | {{ formatNote $tr }} |
5252
{{- end }}
5353
54-
{{ formatFootnotes .TaskRuns }}
5554
{{ if .ComponentSnapshotInfos}}
5655
The group snapshot is generated for pr group {{ .PRGroup }} and the component snasphots as below:
5756
| Component | Snapshot | BuildPipelineRun | PullRequest |
@@ -103,7 +102,6 @@ func FormatTestsSummary(taskRuns []*helpers.TaskRun, pipelineRunName string, nam
103102
"formatNote": FormatNote,
104103
"formatPipelineURL": FormatPipelineURL,
105104
"formatTaskLogURL": FormatTaskLogURL,
106-
"formatFootnotes": FormatFootnotes,
107105
"formatPullRequestURL": FormatPullRequestURL,
108106
"formatRepoURL": FormatRepoURL,
109107
}
@@ -123,7 +121,6 @@ func FormatShortTestsSummary(pipelineRunName string, namespace string, component
123121
"formatStatus": FormatStatus,
124122
"formatDetails": FormatDetails,
125123
"formatPipelineURL": FormatPipelineURL,
126-
"formatFootnotes": FormatFootnotes,
127124
"formatPullRequestURL": FormatPullRequestURL,
128125
"formatRepoURL": FormatRepoURL,
129126
}
@@ -197,24 +194,9 @@ func FormatStatus(taskRun *helpers.TaskRun) (string, error) {
197194
return emoji + " " + result.TestOutput.Result, nil
198195
}
199196

200-
// FormatTaskName accepts a TaskRun and returns a Markdown friendly representation of its name.
197+
// FormatTaskName accepts a TaskRun and returns its name.
201198
func FormatTaskName(taskRun *helpers.TaskRun) (string, error) {
202-
result, err := taskRun.GetTestResult()
203-
if err != nil {
204-
return "", err
205-
}
206-
207-
name := taskRun.GetPipelineTaskName()
208-
209-
if result == nil || result.TestOutput == nil {
210-
return name, nil
211-
}
212-
213-
if result.TestOutput.Note == "" {
214-
return name, nil
215-
}
216-
217-
return name + "[^" + name + "]", nil
199+
return taskRun.GetPipelineTaskName(), nil
218200
}
219201

220202
// FormatNamespace accepts a TaskRun and returns a Markdown friendly representation of its test suite, if any.
@@ -285,26 +267,6 @@ func FormatNote(taskRun *helpers.TaskRun) (string, error) {
285267
return result.TestOutput.Note, nil
286268
}
287269

288-
// FormatResults accepts a list of TaskRuns and returns a Markdown friendly representation of their footnotes, if any.
289-
func FormatFootnotes(taskRuns []*helpers.TaskRun) (string, error) {
290-
footnotes := []string{}
291-
for _, tr := range taskRuns {
292-
result, err := tr.GetTestResult()
293-
if err != nil {
294-
return "", err
295-
}
296-
297-
if result == nil || result.TestOutput == nil {
298-
continue
299-
}
300-
301-
if result.TestOutput.Note != "" {
302-
footnotes = append(footnotes, "[^"+tr.GetPipelineTaskName()+"]: "+result.TestOutput.Note)
303-
}
304-
}
305-
return strings.Join(footnotes, "\n"), nil
306-
}
307-
308270
// Console URL env vars (CONSOLE_URL, CONSOLE_URL_TASKLOG) use literal placeholder substitution only.
309271
// Operator-controlled values are not evaluated as Go templates (avoids CWE-94 / server-side template injection).
310272
//

status/format_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@ const expectedSummary = `<ul>
4141
| --- | --- | --- | --- | --- | --- |
4242
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-1">example-task-1</a> | 5m30s | example-namespace-1 | :heavy_check_mark: SUCCESS | :heavy_check_mark: 2 success(es)<br>:warning: 1 warning(s) | |
4343
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-2">example-task-2</a> | 2m0s | | :heavy_check_mark: Reason: Succeeded | :heavy_check_mark: Reason: Succeeded | |
44-
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-3">example-task-3[^example-task-3]</a> | 1s | example-namespace-3 | :x: FAILURE | :x: 1 failure(s) | example note 3 |
45-
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-4">example-task-4[^example-task-4]</a> | 1s | example-namespace-4 | :warning: WARNING | :warning: 1 warning(s) | example note 4 |
44+
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-3">example-task-3</a> | 1s | example-namespace-3 | :x: FAILURE | :x: 1 failure(s) | example note 3 |
45+
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-4">example-task-4</a> | 1s | example-namespace-4 | :warning: WARNING | :warning: 1 warning(s) | example note 4 |
4646
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-5">example-task-5</a> | 5m0s | example-namespace-5 | :white_check_mark: SKIPPED | | |
4747
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-6">example-task-6</a> | 1s | example-namespace-6 | :heavy_exclamation_mark: ERROR | | |
4848
49-
[^example-task-3]: example note 3
50-
[^example-task-4]: example note 4
5149
`
5250

5351
const expectedTaskLogURL = `https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/pipelinerun-component-sample/logs/example-task-1`

status/status_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ var _ = Describe("Status Adapter", func() {
715715
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/test-pipelinerun/logs/pipeline1-task1">pipeline1-task1</a> | 5m0s | | :heavy_check_mark: SUCCESS | :heavy_check_mark: 10 success(es) | |
716716
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/test-pipelinerun/logs/pipeline1-task2">pipeline1-task2</a> | 5m0s | | :white_check_mark: SKIPPED | | |
717717
718-
719718
`
720719
expectedTestReport := status.TestReport{
721720
FullName: "Red Hat Konflux / scenario1 / component-sample",
@@ -754,7 +753,6 @@ var _ = Describe("Status Adapter", func() {
754753
| --- | --- | --- | --- | --- | --- |
755754
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/test-pipelinerun-warning/logs/pipeline2-task1">pipeline2-task1</a> | 5m0s | | :warning: WARNING | :heavy_check_mark: 10 success(es)<br>:warning: 1 warning(s) | |
756755
757-
758756
`
759757
expectedTestReport := status.TestReport{
760758
FullName: "Red Hat Konflux / scenario2 / component-sample",
@@ -794,7 +792,6 @@ var _ = Describe("Status Adapter", func() {
794792
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/test-pipelinerun/logs/pipeline1-task1">pipeline1-task1</a> | 5m0s | | :heavy_check_mark: SUCCESS | :heavy_check_mark: 10 success(es) | |
795793
| <a href="https://definetly.not.prod/preview/application-pipeline/ns/default/pipelinerun/test-pipelinerun/logs/pipeline1-task2">pipeline1-task2</a> | 5m0s | | :white_check_mark: SKIPPED | | |
796794
797-
798795
`
799796
expectedTestReport := status.TestReport{
800797
FullName: "Red Hat Konflux / scenario1 / component-sample",

0 commit comments

Comments
 (0)