Skip to content

Conversation

@tcheeric
Copy link
Owner

Summary

  • capture Maven build output to a log file
  • print build errors before the log tail on failure

Testing

  • ./mvnw -q verify (fails: Network is unreachable)

https://chatgpt.com/codex/tasks/task_b_68a6ed11578c8331a3cf9a256362f5b6

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tcheeric tcheeric requested a review from Copilot August 21, 2025 10:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the CI workflow to capture and display Maven build output for better debugging when builds fail. The change improves the visibility of build errors by capturing output to a log file and displaying relevant error information on failure.

  • Captures Maven build output to a log file using tee
  • Adds a conditional step to display build errors and log tail when builds fail

cache: 'maven'
- name: Build with Maven
run: ./mvnw -q verify
run: ./mvnw -q verify |& tee build.log
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

The |& operator is a bash-specific feature that may not be available in all shell environments. Consider using 2>&1 | tee build.log for better portability across different shells.

Suggested change
run: ./mvnw -q verify |& tee build.log
run: ./mvnw -q verify 2>&1 | tee build.log

Copilot uses AI. Check for mistakes.
if: failure()
run: |
echo "Build error"
grep '^\[ERROR\]' build.log || true
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

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

[nitpick] The regex pattern ^\[ERROR\] assumes Maven's specific error message format. Consider making this more robust by also checking for other common error patterns or using Maven's built-in error reporting flags.

Suggested change
grep '^\[ERROR\]' build.log || true
egrep '^\[ERROR\]|BUILD FAILURE|Exception|Caused by:' build.log || true

Copilot uses AI. Check for mistakes.
@tcheeric tcheeric merged commit 6669f36 into develop Aug 21, 2025
2 of 3 checks passed
@tcheeric tcheeric deleted the codex/update-ci-workflow-to-log-build-errors branch August 21, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants