-
Notifications
You must be signed in to change notification settings - Fork 361
Description
Summary
Implement a new tool to fetch build timeline records by their refName.
Justification
Here's my scenario where I need this tool:
- start a new build,
- track the progress of the build and wait until the build succeeds,
- fetch the logs of one of the stages,
- retrieve certain info from the logs.
Step 3 can be done only by log ID. This log ID changes from build to build. Thus, I cannot hard code this log ID and need to look it up in the timeline record of the stage I'm interested in. Note that build timeline response can be very long for some builds (8k+ lines in my case). As a result, it can be truncated, and agents see only a part of it. To address this, I would like to retrieve only certain parts of the timeline. This is why I need the filter by refName.
I have already tested this approach by changing this Azure DevOps MCP and installing it locally. The approach works as expected. If this tool is approved, I have the change ready in my branch and can submit a PR.
Tools
Develop the following tool with full parameter support:
pipelines_get_build_timeline_records_by_refname: Fetches the timeline records of a specific build by reference name.
The tool should support the following parameters:
project: project ID or name to get the build timeline for (string, required),buildId: ID of the build to get the timeline for (number, required),refName: Reference name of the timeline record to retrieve (string, required).
This tool should use the already existing build API getBuildTimeline(project, buildId) and filter the result by the given refName. Note that refName may not be unique in the timeline, so the result should be a list of records, not a record.
Related issues
- [Enhancement] Add Timeline and Step Analysis to Build Log Retrieval Tool (get_build_log) - closed as not planned.
- [Feature Request] Scope timeline to errors only - closed as not planned.
- Implement Pipeline Get Timeline API as tool for much more accurate and fast pipeline debugging - implemented, but then reverted.