Skip to content

Conversation

@christophermancini
Copy link
Contributor

  • include cluster information
  • include failure excerpts from logs
  • expand test coverage
  • add integration tests for sending slack messages

- include cluster information
- include failure excerpts from logs
- expand test coverage
- add integration tests for sending slack messages
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 29, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christophermancini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 29, 2026
failureBlocks := s.extractFailureBlocks(lines, 0, totalLines)
if len(failureBlocks) > 0 {
var result strings.Builder
result.WriteString(fmt.Sprintf("Found %d test failure(s):\n\n", len(failureBlocks)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result.WriteString(fmt.Sprintf("Found %d test failure(s):\n\n", len(failureBlocks)))
result.WriteString(fmt.Sprintf("====== Log Extract ======\n""))
result.WriteString(fmt.Sprintf("Found %d test failure(s):\n\n", len(failureBlocks)))

message.Channel = channel

var builder strings.Builder
builder.WriteString("====== ☸️ Cluster Information ======\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can cluster details be sent as a last response after the logs?

I think the notification sequence is best as

  1. What failed ( Test Suite Information) - main message
  2. Briefly why (LLM cause / reco) - reply
  3. Evidence (log excerpt) - reply
  4. cluster info if you want to debug. The cluster is ephemeral so it's not the utmost important. - reply

result.WriteString(fmt.Sprintf("Found %d test failure(s):\n\n", len(failureBlocks)))
for i, block := range failureBlocks {
if i > 0 {
result.WriteString("\n---\n\n")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result.WriteString("\n---\n\n")
result.WriteString("\n---\n\n```")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't apply as is, might get linter errors. But suggesting ``` to format logs as readable code in slack

result.WriteString("\n---\n\n")
}
result.WriteString(block)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
result.WriteString("```")
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't apply as is, might get linter errors. But suggesting ``` to format logs as readable code in slack

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a few different iterations of using the code block syntax but I couldn't get it to reliably work.

```bash
# Set environment variables
export LOG_ANALYSIS_SLACK_WEBHOOK="https://hooks.slack.com/workflows/..."
export LOG_ANALYSIS_SLACK_CHANNEL="C06HQR8HN0L"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to specify individual suite channels in TEST_SUITES json


// readTestOutput reads the test stdout from test_output.txt, test_output.log, or build-log.txt
func (s *SlackReporter) readTestOutput(reportDir string) string {
for _, filename := range []string{"test_output.txt", "test_output.log", "build-log.txt"} {
Copy link
Contributor

@varunraokadaparthi varunraokadaparthi Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var blocks []string

for i := startIdx; i < endIdx && len(blocks) < maxFailureBlocks; i++ {
if strings.Contains(lines[i], "[FAILED]") || strings.Contains(lines[i], "• [FAILED]") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 30, 2026

@christophermancini: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants