feat: Added GitHub Actions integration and documentation#2639
feat: Added GitHub Actions integration and documentation#2639SaptarshiSarkar12 wants to merge 9 commits into
Conversation
- Add GitHubActionsTool for querying workflow runs and job details - Add tool tests with mock GitHub API responses - Add user-facing documentation for GitHub Actions integration - Update docs.json to register new integration page Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Greptile code reviewThis repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md. Run a review — add a PR comment with: Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5. Optional: automate with the greploop skill. |
|
@greptile review |
Greptile SummaryThis PR adds a GitHub Actions integration to OpenSRE, exposing four new tools for listing workflow runs, active runs, job/step outcomes, and fetching step log output — all backed by the GitHub MCP server. It also adds corresponding unit tests and documentation.
Confidence Score: 5/5Safe to merge; the new tools are additive, well-tested, and the production code paths are straightforward wrappers over the existing GitHub MCP infrastructure. All four tools follow the established pattern in the codebase, error paths return structured payloads rather than raising, and the test suite covers happy paths and log-parsing edge cases. The two open items (assert statements and step_number indexing) are non-breaking style and edge-case concerns that can be addressed in a follow-up without blocking the feature. app/tools/GitHubActionsTool/init.py — the assert statements and step_number section-index mismatch are worth a second look before the tool sees heavy agent usage. Important Files Changed
Sequence DiagramsequenceDiagram
participant Agent
participant GitHubActionsTool
participant _resolve_config
participant call_github_mcp_tool
participant GitHub MCP Server
Agent->>GitHubActionsTool: list_github_actions_workflow_runs(owner, repo, ...)
GitHubActionsTool->>_resolve_config: github_url, github_mode, github_token
_resolve_config-->>GitHubActionsTool: "GitHubMCPConfig | None"
GitHubActionsTool->>call_github_mcp_tool: actions_list / list_workflow_runs
call_github_mcp_tool->>GitHub MCP Server: HTTP / stdio
GitHub MCP Server-->>call_github_mcp_tool: {structured_content: {workflow_runs: [...]}}
call_github_mcp_tool-->>GitHubActionsTool: result dict
GitHubActionsTool->>GitHubActionsTool: _normalize_run() per item
GitHubActionsTool-->>Agent: "{available, workflow_runs, total}"
Agent->>GitHubActionsTool: list_github_actions_active_runs(owner, repo)
GitHubActionsTool->>call_github_mcp_tool: actions_list / queued
GitHubActionsTool->>call_github_mcp_tool: actions_list / in_progress
GitHubActionsTool->>GitHubActionsTool: deduplicate by run_id
GitHubActionsTool-->>Agent: "{available, workflow_runs, total}"
Agent->>GitHubActionsTool: get_github_actions_step_log(owner, repo, run_id, job_id)
GitHubActionsTool->>call_github_mcp_tool: actions_get / get_workflow_job
GitHub MCP Server-->>call_github_mcp_tool: job metadata + steps
GitHubActionsTool->>call_github_mcp_tool: "get_job_logs (tail_lines=500)"
GitHub MCP Server-->>call_github_mcp_tool: raw log text
GitHubActionsTool->>GitHubActionsTool: "_extract_log_sections() (##[group] parsing)"
GitHubActionsTool->>GitHubActionsTool: extract_step_log() by step_name or step_number
GitHubActionsTool-->>Agent: "{step_name, log_text, sections, ungrouped_sections}"
Reviews (5): Last reviewed commit: "fix: fixed formatting issue and improved..." | Re-trigger Greptile |
Greptile SummaryThis PR adds a new
Confidence Score: 3/5The new tool module is functionally useful but has a log-parsing correctness issue that could cause silent data loss in the primary diagnostic path. The _extract_log_sections function drops log lines outside ##[group]/##[endgroup] markers once a group is seen, directly affecting the diagnostic quality of get_github_actions_step_log. The private-import coupling is a maintenance risk, and the duplicate trigger/event field is a minor inconsistency. app/tools/GitHubActionsTool/init.py warrants another look, specifically the _extract_log_sections function and the shared-helpers import strategy. Important Files Changed
Sequence DiagramsequenceDiagram
participant LLM as LLM / Agent
participant Tool as GitHubActionsTool
participant MCP as GitHub MCP Server
LLM->>Tool: list_github_actions_workflow_runs(owner, repo, ...)
Tool->>MCP: "call_github_mcp_tool(actions_list, method=list_workflow_runs)"
MCP-->>Tool: structured_content with workflow_runs list
Tool-->>LLM: "available=true, normalized workflow_runs"
LLM->>Tool: list_github_actions_run_jobs(owner, repo, run_id)
Tool->>MCP: "call_github_mcp_tool(actions_list, method=list_workflow_jobs)"
MCP-->>Tool: structured_content with jobs list
Tool-->>LLM: "available=true, normalized jobs"
LLM->>Tool: get_github_actions_step_log(owner, repo, run_id, job_id)
Tool->>MCP: "call_github_mcp_tool(actions_get, method=get_workflow_job)"
MCP-->>Tool: job metadata with steps
Tool->>MCP: "call_github_mcp_tool(get_job_logs, job_id, return_content=true)"
MCP-->>Tool: raw log text
Tool-->>LLM: step_name, log_text, truncated flag, section index
Reviews (2): Last reviewed commit: "Merge branch 'Tracer-Cloud:main' into is..." | Re-trigger Greptile |
|
@SaptarshiSarkar12 demo is missing and greptile score 5/5 needed |
… github actions log lines from the end Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ptarshiSarkar12/opensre into issue/2570-add-gh-actions-integration
…d after start and end of groups in log output Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
|
@greptile review |
|
@muddlebee I have completed all the reviews. I had two questions to clarify:
|
|
Good work @SaptarshiSarkar12
|
… test Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
…log lines in order to prevent overwriting previously accumulated ungrouped log lines Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
|
@Davidson3556 Thank you for reviewing the PR. I have made all the required changes. Please review when you're available. |
|
@SaptarshiSarkar12 need to see the entire flow from a full e2e demo is needed :) |
|
basically the flow should work from CLI, including env setups etc |
…accumulating all ungrouped log lines under `ungrouped_sections` in the log result Signed-off-by: Saptarshi Sarkar <saptarshi.programmer@gmail.com>
|
@muddlebee I have attached the |
|
@greptile review |
Fixes #2570
Describe the changes you have made in this PR -
This pull request adds documentation and comprehensive tests for the GitHub Actions integration in OpenSRE. The main changes include new documentation describing the integration's capabilities and configuration, as well as a new test suite that verifies the functionality of the GitHub Actions toolset, including workflow run listing, job/step retrieval, and log extraction.
Demo/Screenshot for feature changes and bug fixes
Demo for
opensre onboard:demo.of.opensre.onboard.mp4
Demo for opensre investigating github actions failed workflow:
recording_new.mp4
Screencast.From.2026-05-29.09-14-49.mp4
Screencast.From.2026-05-29.09-18-05.mp4
Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?
If you used AI assistance:
Explain your implementation approach:
Currently, opensre is not capable of accessing GitHub Actions workflow details. So, my code implements that feature.
My approach is to use GitHub MCP server to fetch workflow details, and some helper methods normalize the result based on the requirements specified by the input to the tool methods.
An alternative to the GitHub MCP based method is using the GitHub REST APIs. I followed this approach previously, but it has some issues like handling http requests manually, more code for authentication, etc. So, I extended the GitHub MCP code for fetching GitHub Actions workflow details using the
call_github_mcp_tool()method.The key components in my changes are:
GitHubActionsTool/__init__.py: The file responsible for exposing the tool with typed input schema and normalising the GitHub MCP tool call results.test_github_actions_tool.py: This file contains mock tests for the GitHub Actions Tool.docs/integrations/github-actions.mdx: Documented usage and examples for the new GitHub Actions Tool.Checklist before requesting a review
Notes to Reviewers
I had two questions two clarify:
tail_lineswith that length. In the response of log content, a parameteroriginal_lengthis present which tells the length of log text content. Should two requests be made to get the complete log text content? Or should a predefined higher length (like a 1000-line limit) parameter be sent?Note: Please check Allow edits from maintainers if you would like us to assist in the PR.