Skip to content

[Sync] Update project files from source repository (5417792)#289

Merged
mrz1836 merged 1 commit intomasterfrom
chore/sync-files-bitcoin-schema-20260303-163447-5417792
Mar 3, 2026
Merged

[Sync] Update project files from source repository (5417792)#289
mrz1836 merged 1 commit intomasterfrom
chore/sync-files-bitcoin-schema-20260303-163447-5417792

Conversation

@mrz1836
Copy link
Copy Markdown
Member

@mrz1836 mrz1836 commented Mar 3, 2026

What Changed

  • Updated GO_PRE_COMMIT_VERSION from v1.6.2 to v1.7.0 in .github/env/10-pre-commit.env
  • Added error output logging to persist cleaned pre-commit check output to pre-commit-output.log file when checks fail, using multiple sed commands to strip ANSI escape sequences and control characters
  • Enhanced GitHub Actions workflow summary generation to display error details from the log file in an expandable section (showing first 200 lines) when pre-commit checks fail
  • Added handling for early workflow failures where log file doesn't exist, displaying a warning message in the summary instead
  • Modified success message logic to check for log file presence and failure conditions before showing passed checks summary

Why It Was Necessary

  • The pre-commit tool version bump ensures the workflow uses the latest features and bug fixes from the upstream tool
  • Capturing and displaying pre-commit failure output in the GitHub Actions summary improves debugging visibility without requiring users to dig through raw workflow logs
  • Stripping ANSI escape codes from the output ensures the log file and summary display are clean and readable in GitHub's markdown renderer

Testing Performed

  • Verify the workflow successfully downloads and executes pre-commit tool version v1.7.0
  • Test failure scenarios to confirm the log file is created with cleaned output and appears correctly in the GitHub Actions summary
  • Validate that early failure cases (before log creation) properly display the fallback warning message
  • Confirm successful pre-commit runs still display the appropriate success summary without error sections

Impact / Risk

  • Low Risk: Version bump is a minor update; log file creation only occurs on failure path and doesn't affect success scenarios
  • Improved Developer Experience: Failed pre-commit checks now show actionable error details directly in the workflow summary
  • No Breaking Changes: Existing workflow behavior is preserved; enhancements are additive only

Copilot AI review requested due to automatic review settings March 3, 2026 21:35
@mrz1836 mrz1836 self-assigned this Mar 3, 2026
@mrz1836 mrz1836 added automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps labels Mar 3, 2026
@github-actions github-actions Bot added size/M Medium change (51–200 lines) update General updates labels Mar 3, 2026
Copy link
Copy Markdown

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

Updates the GoFortress pre-commit workflow to improve failure diagnostics by persisting cleaned check output to a log file, surfacing it in the GitHub Actions job summary, and uploading it as an artifact; also bumps the go-pre-commit tool version.

Changes:

  • Bump GO_PRE_COMMIT_VERSION to v1.7.0.
  • On pre-commit failure, write cleaned output to pre-commit-output.log and show truncated details in the workflow summary.
  • Upload the failure log as a retained artifact for later inspection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/fortress-pre-commit.yml Adds failure log persistence, summary rendering of error output, and artifact upload of the log.
.github/env/10-pre-commit.env Updates go-pre-commit tool version to v1.7.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +693 to +700
# Persist cleaned output to log file for summary and artifact upload
# Use printf to avoid echo misinterpreting leading -n/-e in output
printf '%s\n' "$CHECKS_OUTPUT" | \
sed -E 's/\x1b\[[0-9;]*[mGKH]//g' | \
sed 's/\xc2\x9b\[[0-9;]*[mGKH]//g' | \
sed 's/�\[[0-9;]*[mGKH]//g' | \
sed 's/�//g' | \
tr -d '\033' > pre-commit-output.log
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The ANSI/control-character stripping pipeline is duplicated here and earlier in the step when printing output. Duplicating it increases the chance the console output and persisted log diverge over time; consider factoring this into a single reusable variable/function (e.g., compute cleaned output once, then both print and write the file).

Copilot uses AI. Check for mistakes.
Comment on lines +693 to +696
# Persist cleaned output to log file for summary and artifact upload
# Use printf to avoid echo misinterpreting leading -n/-e in output
printf '%s\n' "$CHECKS_OUTPUT" | \
sed -E 's/\x1b\[[0-9;]*[mGKH]//g' | \
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The comment says printf is used to avoid echo misinterpreting leading -n/-e, but the step still uses echo "$CHECKS_OUTPUT" | ... earlier to render the cleaned output to logs. Either update the earlier output path to use printf as well, or adjust this comment so it doesn't imply the problem is fully addressed.

Copilot uses AI. Check for mistakes.
Comment on lines +859 to +864
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary>Click to expand full output</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
head -200 pre-commit-output.log >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The summary text says "Click to expand full output", but the workflow only appends head -200 of the log. This is misleading; either include the full log content (if safe) or adjust the wording to indicate it is truncated (e.g., "first 200 lines").

Copilot uses AI. Check for mistakes.
Comment on lines +891 to +896
# --------------------------------------------------------------------
# Upload pre-commit results (only present on failure)
# --------------------------------------------------------------------
- name: 📤 Upload pre-commit results
if: always()
uses: ./.github/actions/upload-artifact-resilient
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

The section header says "Upload pre-commit results (only present on failure)", but this step runs unconditionally with if: always() (it just ignores missing files). Either make the step conditional on the log file existing, or update the header/comment to match the actual behavior.

Copilot uses AI. Check for mistakes.
@mrz1836
Copy link
Copy Markdown
Member Author

mrz1836 commented Mar 3, 2026

LGTM!

@mrz1836 mrz1836 merged commit 03bc0f9 into master Mar 3, 2026
51 checks passed
@github-actions github-actions Bot deleted the chore/sync-files-bitcoin-schema-20260303-163447-5417792 branch March 3, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-sync Automated sync PR, e.g. from a fork or external repo automerge Label to automatically merge pull requests that meet all required conditions chore Simple dependency updates or version bumps size/M Medium change (51–200 lines) update General updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants