Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(flakybot): notify users when no logs are found #4679

Merged
merged 3 commits into from
Nov 21, 2022
Merged

Conversation

tbpg
Copy link
Contributor

@tbpg tbpg commented Nov 15, 2022

No description provided.

}
if len(logs) == 0 {
log.Printf("No sponge_log.xml files found in %s. Did you forget to generate sponge_log.xml?", cfg.logsDir)
os.Exit(0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this to return a successful exit code?

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 debated and am open to changing it. It might not be an error if there is no sponge_log.xml file? But, on the other hand, why would you call flakybot if you didn't have logs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to have the binary throw a failing return exit code otherwise maintainers won't notice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

@tbpg tbpg left a comment

Choose a reason for hiding this comment

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

Thanks! Please take another look.

}
if len(logs) == 0 {
log.Printf("No sponge_log.xml files found in %s. Did you forget to generate sponge_log.xml?", cfg.logsDir)
os.Exit(0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

logs, err := findLogs(cfg.logsDir)
if err != nil {
log.Printf("Error searching for logs: %v", err)
os.Exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: consider using different non-zero exit codes for different error scenarios

@chingor13 chingor13 enabled auto-merge (squash) November 21, 2022 19:23
@chingor13 chingor13 merged commit bc6fdd9 into main Nov 21, 2022
@chingor13 chingor13 deleted the flakybot-no-logs branch November 21, 2022 19:25
@release-please release-please bot mentioned this pull request Feb 27, 2023
@release-please release-please bot mentioned this pull request Aug 21, 2023
@release-please release-please bot mentioned this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants