Skip to content

Reduce Actions workflow list response payloads - #3047

Merged
tommaso-moro merged 1 commit into
mainfrom
tommaso-moro-actions-minimal-types
Aug 10, 2026
Merged

Reduce Actions workflow list response payloads#3047
tommaso-moro merged 1 commit into
mainfrom
tommaso-moro-actions-minimal-types

Conversation

@tommaso-moro

@tommaso-moro tommaso-moro commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Return dedicated minimal response types from list_workflow_runs and list_workflow_jobs.
  • Preserve the existing response envelopes while removing heavyweight nested objects, node IDs, and redundant REST endpoint URLs from list items.
  • Retain the identifiers and diagnostic fields needed to inspect a run, select relevant runs/jobs, retrieve logs, and operate on a run through subsequent MCP tool calls.

Field contract

list_workflow_runs

Retained top-level fields: id, name, display_title, workflow_id, run_number, run_attempt, event, status, conclusion, head_branch, head_sha, path, html_url, created_at, updated_at, run_started_at.

Dropped top-level fields: node_id, check_suite_id, check_suite_node_id, url, jobs_url, logs_url, check_suite_url, artifacts_url, cancel_url, rerun_url, previous_attempt_url, workflow_url, repository, head_repository.

Nested field Retained Dropped or compressed Reason
pull_requests PR numbers Full pull request objects; all nested fields except number The number is sufficient to call pull request tools; full PR objects duplicate a large amount of separately retrievable data.
actor, triggering_actor login, id, profile_url (from html_url), avatar_url All other user fields and API URLs These fields preserve identity and navigation without embedding full user profiles.
head_commit message All other commit fields head_sha remains top-level for commit/check lookup; the message preserves commit intent.
referenced_workflows path, sha, ref Nothing All fields are retained because they identify the reusable workflow and resolved version.

The list envelope remains { "total_count": ..., "workflow_runs": [...] }.

list_workflow_jobs

Retained job fields: id, run_id, name, workflow_name, status, conclusion, head_branch, head_sha, html_url, run_attempt, runner_id, runner_name, runner_group_id, runner_group_name, labels, steps, created_at, started_at, completed_at.

Dropped job fields: run_url, node_id, url, check_run_url.

Every job-step field remains: name, status, conclusion, number, started_at, and completed_at. Runner and runner-group metadata is also retained for self-hosted-runner diagnosis.

The existing outer jobs response envelope and nested total_count/jobs result are preserved.

Why these fields are safe to remove from list responses

  • Current Actions tools accept repository coordinates plus workflow, run, job, or artifact IDs—not REST endpoint URLs.
  • Run id, workflow workflow_id/path, job id, and head_sha preserve the supported tool-chaining paths.
  • repository and head_repository duplicate the repository context supplied to the tool and can be retrieved separately when needed.
  • Node IDs and check-suite identifiers are not inputs to any current Actions follow-up tool. Check-oriented lookup uses the retained head_sha.
  • Human-facing html_url values remain, while repeated API endpoint URLs are removed.

Measured response-size reduction

Measurements use minified JSON from representative fixtures containing nested repository data, actors, one pull request, a head commit, one referenced workflow, runner/group metadata, and two job steps. Actual savings vary with populated nested fields and the number of steps.

Response Before After Bytes saved Reduction
1 workflow run 4,342 B 1,015 B 3,327 B 76.6%
10 workflow runs 43,106 B 9,836 B 33,270 B 77.2%
1 workflow job 1,205 B 908 B 297 B 24.6%
10 workflow jobs 11,736 B 8,766 B 2,970 B 25.3%
10 runs and 10 jobs combined 54,842 B 18,602 B 36,240 B 66.1%

The job reduction is intentionally smaller because all step fields and all runner/group metadata remain available.

Testing

  • script/lint
  • script/test
  • script/generate-docs

Return compact response types for workflow run and workflow job lists while retaining diagnostic, step, and runner metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0eecbca7-7271-4a04-8d28-d952c27ed9c1
@tommaso-moro
tommaso-moro marked this pull request as ready for review August 10, 2026 14:01
@tommaso-moro
tommaso-moro requested a review from a team as a code owner August 10, 2026 14:01
Copilot AI balanced review requested due to automatic review settings August 10, 2026 14:01

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

Reduces GitHub Actions list payload sizes while preserving fields needed for diagnostics and follow-up tool calls.

Changes:

  • Adds minimal workflow-run, job, step, and response types.
  • Converts Actions list responses to minimal representations.
  • Adds conversion and handler-level tests.
Show a summary per file
File Description
pkg/github/minimal_types.go Defines and converts minimal Actions response types.
pkg/github/actions.go Returns minimal workflow run and job lists.
pkg/github/actions_test.go Updates list-handler response tests.
pkg/github/actions_minimal_test.go Tests field retention and payload trimming.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

@mattdholloway mattdholloway 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.

Looks good to go! Great spot

@tommaso-moro
tommaso-moro merged commit eff4c3c into main Aug 10, 2026
20 checks passed
@tommaso-moro
tommaso-moro deleted the tommaso-moro-actions-minimal-types branch August 10, 2026 14:13
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.

4 participants