Skip to content

Improve run details step summary: bullet points, aw version, and full aw_info rendering#20989

Merged
pelikhan merged 4 commits intomainfrom
copilot/update-run-details-summary
Mar 14, 2026
Merged

Improve run details step summary: bullet points, aw version, and full aw_info rendering#20989
pelikhan merged 4 commits intomainfrom
copilot/update-run-details-summary

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

The run details step summary used markdown tables, was missing the gh-aw version, and only showed a subset of workflow metadata.

Changes

  • json_object_to_markdown.cjs (new helper): Converts any plain JavaScript object to a Markdown bullet list. Handles nested objects (indented sub-lists), arrays (sub-bullets or (none) for empty), and primitives (null/""(none)). Keys are humanified by replacing _ and - with spaces (e.g. engine_idengine id).

  • generate_workflow_overview.cjs: Replaced manual table/bullet construction with the new helper. The <summary> tag now includes engine_id and version (e.g. Run details - copilot v1.2.3). All fields from aw_info.json are rendered — nothing is omitted.

Before

<summary>Run details</summary>

#### Engine Configuration
| Property | Value |
|----------|-------|
| Engine ID | copilot |
| Engine Name | GitHub Copilot CLI |
| Model | (default) |

After

<summary>Run details - copilot v1.2.3</summary>

- **engine id**: copilot
- **engine name**: GitHub Copilot CLI
- **model**: gpt-4
- **version**: v1.2.3
- **firewall enabled**: true
- **allowed domains**:
  - example.com
- **steps**:
  - **firewall**: iptables
...
  • generate_workflow_overview.test.cjs: Updated assertions to match the new format (summary label, bullet-point field rendering with humanified keys, nested objects and arrays).

  • json_object_to_markdown.test.cjs (new): 11 unit tests covering flat key-value pairs, booleans, null/empty values, arrays, empty arrays, nested objects, invalid inputs, and key humanification.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 14, 2026 21:25
… field

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@@ -32,17 +32,14 @@ async function generateWorkflowOverview(core) {
"<details>\n" +
"<summary>Run details</summary>\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.

@copilot

  • show engine_id and version in summary
  • show all fields in rendered markdown by rendering all files from aw_info.json using a javascript helper (look for existing json object to markdown helper)

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 in 3c922a6:

  • The <summary> tag now includes engine_id and version, e.g. Run details - copilot v1.2.3
  • Created a new json_object_to_markdown.cjs helper that converts any JS object to a Markdown bullet list (handles nested objects, arrays, primitives, empty values)
  • generate_workflow_overview.cjs now uses this helper to render all fields from aw_info.json — nothing is omitted

…s via json_object_to_markdown helper

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Improve run details step summary: bullet points + aw version Improve run details step summary: bullet points, aw version, and full aw_info rendering Mar 14, 2026
Copilot AI requested a review from pelikhan March 14, 2026 21:44
@pelikhan
Copy link
Contributor

@copilot humanify key in json to markdown (replace -_ with whitespace)

…spaces)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 14, 2026

@copilot humanify key in json to markdown (replace -_ with whitespace)

Done in f57cc36. Added humanifyKey() to json_object_to_markdown.cjs which replaces _ and - with spaces, e.g.:

  • engine_idengine id
  • firewall_enabledfirewall enabled
  • awf_versionawf version

@pelikhan pelikhan marked this pull request as ready for review March 14, 2026 22:47
Copilot AI review requested due to automatic review settings March 14, 2026 22:47
@pelikhan pelikhan merged commit 62f815e into main Mar 14, 2026
@pelikhan pelikhan deleted the copilot/update-run-details-summary branch March 14, 2026 22:47
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

Updates the GitHub Actions step summary for workflow “Run details” to use a bullet-list rendering of aw_info.json, and includes engine/version in the <summary> label.

Changes:

  • Added json_object_to_markdown.cjs helper to render arbitrary objects as nested Markdown bullet lists (with key humanification).
  • Refactored generate_workflow_overview.cjs to render the full aw_info.json payload via the helper and include engine_id/version in the collapsible summary label.
  • Updated and added Vitest coverage to assert the new summary format and helper behavior.

Reviewed changes

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

File Description
actions/setup/js/json_object_to_markdown.cjs New helper to convert objects/arrays/primitives into nested Markdown bullet lists.
actions/setup/js/json_object_to_markdown.test.cjs New unit tests for key humanification and markdown rendering behaviors.
actions/setup/js/generate_workflow_overview.cjs Switches step summary rendering from tables to bullet lists and updates <summary> label.
actions/setup/js/generate_workflow_overview.test.cjs Updates assertions to match the new summary label and bullet-list rendering.
Comments suppressed due to low confidence (1)

actions/setup/js/json_object_to_markdown.cjs:72

  • Empty objects currently render as a label line followed by an empty string (e.g., "- key:" with nothing under it) because the recursive call can return "" and is still appended. It would be clearer to render empty objects as "(none)" (or skip them) and avoid pushing empty lines into the output.
    } else if (typeof value === "object" && value !== null) {
      lines.push(`${indent}- **${label}**:`);
      lines.push(jsonObjectToMarkdown(/** @type {Record<string, unknown>} */ value, depth + 1));
    } else {

💡 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 +61 to +66
for (const item of value) {
if (typeof item === "object" && item !== null) {
lines.push(jsonObjectToMarkdown(/** @type {Record<string, unknown>} */ item, depth + 1));
} else {
lines.push(`${" ".repeat(depth + 1)}- ${String(item)}`);
}
Comment on lines +21 to +29
// Build the collapsible summary label with engine_id and version
const engineLabel = [awInfo.engine_id, awInfo.version].filter(Boolean).join(" ");
const summaryLabel = engineLabel ? `Run details - ${engineLabel}` : "Run details";

// Render all aw_info fields as markdown bullet points
const details = jsonObjectToMarkdown(awInfo);

// Build summary using string concatenation to avoid YAML parsing issues with template literals
const summary =
"<details>\n" +
"<summary>Run details</summary>\n\n" +
"#### Engine Configuration\n" +
"| Property | Value |\n" +
"|----------|-------|\n" +
`| Engine ID | ${awInfo.engine_id} |\n` +
`| Engine Name | ${awInfo.engine_name} |\n` +
`| Model | ${awInfo.model || "(default)"} |\n` +
"\n" +
"#### Network Configuration\n" +
"| Property | Value |\n" +
"|----------|-------|\n" +
`| Firewall | ${awInfo.firewall_enabled ? "✅ Enabled" : "❌ Disabled"} |\n` +
`| Firewall Version | ${awInfo.awf_version || "(latest)"} |\n` +
"\n" +
(networkDetails ? `##### Allowed Domains\n${networkDetails}\n` : "") +
"</details>";
const summary = "<details>\n" + `<summary>${summaryLabel}</summary>\n\n` + details + "\n" + "</details>";
"\n" +
(networkDetails ? `##### Allowed Domains\n${networkDetails}\n` : "") +
"</details>";
const summary = "<details>\n" + `<summary>${summaryLabel}</summary>\n\n` + details + "\n" + "</details>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants