feat(tekton): add PipelineRun troubleshooting tools#1245
Conversation
ddb9101 to
c1a5942
Compare
c1a5942 to
c6577bf
Compare
|
👋 Heads up — this pull request changes files owned by @ksimon1. You are listed as an owner of one or more of the changed areas in |
7e9426b to
bd16b28
Compare
| }).String() | ||
| events, err := params.CoreV1().Events(namespace).List(params.Context, metav1.ListOptions{FieldSelector: selector}) | ||
| if err != nil { | ||
| return fmt.Sprintf("*Error listing events for %s %s: %v*", target.kind, target.name, err) |
There was a problem hiding this comment.
Would it make sense to just log this error instead of returning and continue gathering other events? Because like this, it will ignore other targets if first target fails e.g. due to RBAC issues.
| return api.NewToolCallResult(sb.String(), nil), nil | ||
| } | ||
|
|
||
| func listPipelineRunTaskRuns(params api.ToolHandlerParams, namespace, pipelineRunName string) ([]tektonv1.TaskRun, error) { |
There was a problem hiding this comment.
Is this FN necessary? It just calls another FN.
|
@waveywaves can you please resolve merge conflicts? |
Add PipelineRun cancel and log helpers, read-only Pipeline-as-Code Repository and TektonConfig tools, and a PipelineRun troubleshooting prompt. Update Tekton docs, eval tasks, snapshots, and MCP coverage for the new tools. Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
4a5afc3 to
ffc1248
Compare
| var sb strings.Builder | ||
| for _, taskRun := range taskRuns { | ||
| fmt.Fprintf(&sb, "### TaskRun: %s\n\n", taskRun.Name) | ||
| if status, err := output.MarshalYaml(taskRun.Status); err == nil { |
There was a problem hiding this comment.
Nit: if marshalling fails, then there is no record of it. It would be probably good to log it
Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
ffc1248 to
bb64bd9
Compare
|
/lgtm |
|
@manusa can you please check this PR? |
Cali0707
left a comment
There was a problem hiding this comment.
@waveywaves are you able to fix the merge conflicts?
Beyond those, LGTM
What
tekton_pipelinerun_cancelto cancel a PipelineRun by settingspec.status=Cancelled.tekton_pipelinerun_logsto collect logs from TaskRuns owned by a PipelineRun.pipeline-troubleshootprompt to gather PipelineRun status, related TaskRuns, logs, events, Pipeline-as-Code Repository resources, and TektonConfig resources.resources_list/resources_getfor PAC Repository and TektonConfig visibility.Why
PipelineRun cancellation and log collection are Tekton workflows that require domain-specific behavior beyond plain resource get/list. PAC Repository and TektonConfig visibility is handled without thin wrapper tools: generic resource tools cover direct reads, and the troubleshooting prompt pre-fetches those resources when diagnosing PipelineRuns.
Testing
make update-readme-toolsgo test ./pkg/toolsets/tekton -count=1go test ./pkg/mcp -run 'TestTektonMcp|TestToolsets' -count=1go test ./...(fails locally: linker reportsno space left on devicewhile building several test binaries)Notes
No repository or organization PR template is configured; this body follows the repository contribution guidance: background, user-facing changes, tests, and docs.