Skip to content

feat: shp buildrun gather subcommand to extract the details of the failed BuildRun#380

Merged
openshift-merge-bot[bot] merged 5 commits into
shipwright-io:mainfrom
kaizakin:feat/shp-gather
Jun 15, 2026
Merged

feat: shp buildrun gather subcommand to extract the details of the failed BuildRun#380
openshift-merge-bot[bot] merged 5 commits into
shipwright-io:mainfrom
kaizakin:feat/shp-gather

Conversation

@kaizakin

@kaizakin kaizakin commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Changes

  • added dynamic client support in params to fetch taskrun objects
  • added buildrun gather command that collects buildrun taskrun pod Objects and individual pod logs
  • --output flag determines the output location, default value is . currect directory.
  • --archive flag determines the output to be compressed as .tar.gz

Edit:

  • gather now supports PipelineRun executor as well
  • added options helper for dynamicClient and extended WithClientset NewParamsForTest to support dynamicClient
  • added unit tests

Fixes #250


Type of PR

/kind feature

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

TaskRun

2026-03-22.20-23-03.mp4

PipelineRun

2026-03-31.02-28-01.mp4

Release Notes

Add "shp buildrun gather" subcommand

@pull-request-size pull-request-size Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 21, 2026
@openshift-ci openshift-ci Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note labels Mar 21, 2026
@openshift-ci

openshift-ci Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

@kaizakin: The label(s) kind/your-label-here cannot be applied, because the repository doesn't have them.

Details

In response to this:

Changes

Fixes #250

Related Issue

Fixes #

Type of PR

/kind your-label-here

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Kind label has been set
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

your release note here

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pull-request-size pull-request-size Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 22, 2026
@kaizakin kaizakin changed the title Feat: add shp buildrun gather subcommand feat: shp buildrun gather subcommand to extract the details of the failed BuildRun Mar 22, 2026
@kaizakin kaizakin marked this pull request as ready for review March 22, 2026 16:03
Copilot AI review requested due to automatic review settings March 22, 2026 16:03
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 22, 2026
@openshift-ci openshift-ci Bot requested review from HeavyWombat and qu1queee March 22, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new shp buildrun gather subcommand to collect BuildRun diagnostics (BuildRun/TaskRun/Pod objects + pod logs) into a directory or .tar.gz archive, to help debug failed BuildRuns (Fixes #250).

Changes:

  • Add a dynamic.Interface client to CLI params for fetching Tekton objects.
  • Introduce shp buildrun gather subcommand with --output and --archive flags to export YAMLs and logs.
  • Add generated CLI docs for the new subcommand and link it from shp buildrun docs.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/shp/params/params.go Adds dynamic client support for retrieving Tekton resources (TaskRuns).
pkg/shp/cmd/buildrun/gather.go Implements the new gather subcommand, YAML/log collection, and optional tar.gz archiving.
pkg/shp/cmd/buildrun/buildrun.go Registers gather under the buildrun command group.
docs/shp_buildrun_gather.md Adds generated documentation for shp buildrun gather.
docs/shp_buildrun.md Links the new gather subcommand in the BuildRun command index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/shp_buildrun_gather.md Outdated
Comment thread pkg/shp/params/params.go
Comment thread pkg/shp/cmd/buildrun/gather.go
Comment thread pkg/shp/cmd/buildrun/gather.go
Comment thread pkg/shp/cmd/buildrun/gather.go Outdated
Comment thread pkg/shp/cmd/buildrun/gather.go Outdated
Comment thread pkg/shp/cmd/buildrun/gather.go Outdated

@IrvingMg IrvingMg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @kaizakin!

I have a few suggestions for the first pass:

  1. Please address Copilot’s review comments.
  2. Fix the linter issues reported by CI.
  3. Feel free to squash the commits as well.

Regarding your questions:

  1. IIUC, supporting PipelineRun would add more complexity. So, in my opinion, it would be better to keep this PR focused on BuildRun, but I’d like to hear others’ opinions.
  2. It would be nice to have unit tests, at least for basic scenarios.

@pull-request-size pull-request-size Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 26, 2026
@kaizakin

Copy link
Copy Markdown
Contributor Author

requesting review @IrvingMg

Comment thread pkg/shp/params/params.go Outdated
Comment thread pkg/shp/cmd/buildrun/gather_test.go Outdated
Comment thread pkg/shp/params/params.go Outdated
kaizakin added 2 commits April 1, 2026 23:56
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
@kaizakin kaizakin force-pushed the feat/shp-gather branch 2 times, most recently from b14b390 to d3e65e2 Compare April 1, 2026 18:29
@kaizakin

kaizakin commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @IrvingMg
suggested changes has been made 😁

Comment thread pkg/shp/cmd/buildrun/gather.go Outdated
Comment thread pkg/shp/cmd/buildrun/gather.go
Comment thread pkg/shp/cmd/buildrun/gather.go Outdated
Comment thread pkg/shp/cmd/buildrun/gather.go Outdated
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>

@IrvingMg IrvingMg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thank you!

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 13, 2026
@IrvingMg

Copy link
Copy Markdown
Member

@shipwright-io/approvers Friendly ping on this PR when you have a moment.

@SaschaSchwarze0 SaschaSchwarze0 added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 15, 2026
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.20.0 milestone Jun 15, 2026

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2026
@openshift-merge-bot openshift-merge-bot Bot merged commit 838d1a9 into shipwright-io:main Jun 15, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Issues Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Debug utility command: shp buildrun gather

5 participants