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-morotommaso-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 fieldRetainedDropped or compressedReason
pull_requestsPR numbersFull pull request objects; all nested fields except numberThe number is sufficient to call pull request tools; full PR objects duplicate a large amount of separately retrievable data.
actor, triggering_actorlogin, id, profile_url (from html_url), avatar_urlAll other user fields and API URLsThese fields preserve identity and navigation without embedding full user profiles.
head_commitmessageAll other commit fieldshead_sha remains top-level for commit/check lookup; the message preserves commit intent.
referenced_workflowspath, sha, refNothingAll 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.

ResponseBeforeAfterBytes savedReduction
1 workflow run4,342 B1,015 B3,327 B76.6%
10 workflow runs43,106 B9,836 B33,270 B77.2%
1 workflow job1,205 B908 B297 B24.6%
10 workflow jobs11,736 B8,766 B2,970 B25.3%
10 runs and 10 jobs combined54,842 B18,602 B36,240 B66.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 ownerAugust 10, 2026 14:01
CopilotAI balanced review requested due to automatic review settings August 10, 2026 14:01

CopilotAI 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
FileDescription
pkg/github/minimal_types.goDefines and converts minimal Actions response types.
pkg/github/actions.goReturns minimal workflow run and job lists.
pkg/github/actions_test.goUpdates list-handler response tests.
pkg/github/actions_minimal_test.goTests 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

@mattdhollowaymattdholloway 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 mainAug 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 freeto 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

@tommaso-moro@mattdholloway@alirezainanlosalehi7-lgtm