Skip to content

[rendering-scripts] Render message/reason fields in safe-outputs step-summary preview - #53087

Merged
pelikhan merged 1 commit into
mainfrom
fix/copilot-safe-outputs-preview-message-field-9d8d834e72e4614f
Aug 16, 2026
Merged

[rendering-scripts] Render message/reason fields in safe-outputs step-summary preview#53087
pelikhan merged 1 commit into
mainfrom
fix/copilot-safe-outputs-preview-message-field-9d8d834e72e4614f

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

The formatSafeOutputsPreview function in log_parser_shared.cjs did not render the message or reason fields carried by noop, missing_tool, and missing_data safe-output entries, leaving their primary content invisible in step-summary previews. This change adds rendering for both fields in plain-text and markdown preview modes, with matching test coverage.

Change Classification

  • Type: feature
  • Scope: actions/setup/js (log parser / safe-outputs step-summary rendering)
  • Breaking: No

Key Changes

File Change Impact
actions/setup/js/log_parser_shared.cjs Adds Message:/Reason: line rendering (plain text) and **Message:**/**Reason:** blocks (markdown) for entries with message or reason fields Medium
actions/setup/js/log_parser_shared.test.cjs Adds 3 tests covering noop message rendering (plain text and markdown) and missing_tool/missing_data reason rendering Medium

Impact Assessment

  • Step-summary previews for noop, missing_tool, and missing_data safe-output entries now surface their diagnostic message/reason text (truncated to 80 chars in plain text, 200 chars in markdown), improving visibility for workflow debugging.
  • No change to safe-output schema, data model, or existing title/body rendering paths; purely additive to the preview formatter.
  • No downstream API or CLI behavior changes; effect is limited to GitHub Actions step-summary rendering.

Commits

58e46a1e8 Render message/reason fields in safe-outputs step-summary preview
```> Generated by [PR Description Updater](https://github.com/github/gh-aw/actions/runs/31948090747) for #53087 · auto · 44.5 AIC · ⌖ 2.97 AIC · ⊞ 7.5K · [◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw+%22gh-aw-workflow-call-id%3A+github%2Fgh-aw%2Fpr-description-caveman%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Description Updater, engine: copilot, model: auto, id: 31948090747, workflow_id: pr-description-caveman, run: https://github.com/github/gh-aw/actions/runs/31948090747 -->

noop, missing_tool, and missing_data safe outputs store their primary
content in message/reason fields rather than title/body, so the
preview silently rendered only the type name with no content for
these types.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added automated-fix javascript Pull requests that update javascript code rendering labels Aug 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 Great work on this rendering fix!

This PR looks solid — it tackles a real rendering gap where noop, missing_tool, and missing_data safe outputs were silently dropping their message/reason content from the step-summary preview.

What we are seeing:

  • ✅ Clear root-cause analysis and fix explanation
  • ✅ Comprehensive before/after demo (real run data)
  • ✅ Full test coverage: 3 new regression tests, all passing
  • ✅ Tight, focused diff (55 lines, two files)
  • ✅ Additive fix — entries without these fields render exactly as before

The changes are clean and ready for merge review. Well done tracking this down from the daily verification runs!

Generated by ✅ Contribution Check · auto · 51.6 AIC · ⌖ 3.66 AIC · ⊞ 9.1K ·

@pelikhan
pelikhan marked this pull request as ready for review August 16, 2026 12:32
Copilot AI balanced review requested due to automatic review settings August 16, 2026 12:32
@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer completed successfully!

Lean already. Ship. Diff mirrors existing title/body duplication pattern in the same function; message/reason handling is symmetric, minimal, and adds no new abstractions, deps, or dead flexibility.

Generated by Ponytail Reviewer for #53087

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The changes are correct and well-tested. Both plain-text and markdown rendering of message/reason fields are consistent with the existing body handling pattern (newline-flattening for plain-text, no flattening for markdown). Tests cover all three new code paths (noop message plain-text, noop message markdown, missing_tool reason). LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 11.6 AIC · ⌖ 7.88 AIC · ⊞ 5.6K

@github-actions

github-actions Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Extends safe-output previews so diagnostic content from noop, missing_tool, and missing_data entries is visible.

Changes:

  • Renders and truncates message and reason fields in plain-text and Markdown previews.
  • Adds regression coverage for both output formats.
Show a summary per file
File Description
actions/setup/js/log_parser_shared.cjs Adds message/reason preview rendering.
actions/setup/js/log_parser_shared.test.cjs Tests the new rendering behavior.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /tdd and /diagnosing-bugs — one minor test gap found; otherwise approving.

📋 Key Themes & Highlights

Key Themes

  • Test name/coverage mismatch: The new missing_tool/missing_data test only exercises missing_tool, leaving missing_data's reason path implicitly trusted but untested.
  • Truncation limits are consistent: plain-text message/reason use 80 chars (matching body); markdown uses 200 chars (matching body). ✅

Positive Highlights

  • ✅ Excellent root-cause diagnosis: PR traces the gap from real production run → log parser → field schema → fix
  • ✅ Additive, backward-compatible change — existing entries unaffected (confirmed by the unchanged existing tests)
  • ✅ Both rendering branches (plain-text and markdown) are handled symmetrically
  • ✅ Regression tests added for message (noop) and reason (missing_tool) in both modes

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 30 AIC · ⌖ 6.79 AIC · ⊞ 7.7K
Comment /matt to run again

expect(plain).toContain("Reason: Docker is not available");
expect(markdown).toContain("**Reason:** Docker is not available");
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[/tdd] Test name promises missing_tool/missing_data coverage but only exercises missing_toolmissing_data has a different schema (data_type, context, alternatives) and its reason rendering is untested.

💡 Suggested addition
it('should surface the reason field for missing_data entries', async () => {
  const { formatSafeOutputsPreview } = await import('./log_parser_shared.cjs');

  const safeOutputs = JSON.stringify({ type: 'missing_data', data_type: 'pr_number', reason: 'PR number not found in context' });
  const plain = formatSafeOutputsPreview(safeOutputs, { isPlainText: true });
  const markdown = formatSafeOutputsPreview(safeOutputs, { isPlainText: false });

  expect(plain).toContain('Reason: PR number not found in context');
  expect(markdown).toContain('**Reason:** PR number not found in context');
});

@copilot please address this.

@github-actions

Copy link
Copy Markdown
Contributor Author

Comment Memory

reviewed_at: 2026-08-16T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable issues found
files_reviewed:
  - actions/setup/js/log_parser_shared.cjs
  - actions/setup/js/log_parser_shared.test.cjs
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 3.27 AIC · ⌖ 6.13 AIC · ⊞ 6.9K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Verdict

Non-blocking change; I didn't find a correctness or maintainability issue in the diff.

Notes

The implementation is additive, preserves the existing title/body/data rendering paths, and the new tests cover both plain-text and markdown output for the new fields.

🔎 Code quality review by PR Code Quality Reviewer · gpt54 · 3.27 AIC · ⌖ 6.13 AIC · ⊞ 6.9K
Comment /review to run again

@pelikhan
pelikhan merged commit d600f7a into main Aug 16, 2026
65 of 73 checks passed
@pelikhan
pelikhan deleted the fix/copilot-safe-outputs-preview-message-field-9d8d834e72e4614f branch August 16, 2026 12:49
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.87.1

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

Labels

automated-fix javascript Pull requests that update javascript code rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants