Skip to content

feat: add --step-resources and --buildrun-name to build upload - #416

Open
psrvere wants to merge 1 commit into
shipwright-io:mainfrom
psrvere:worktree-build-upload-step-resources
Open

psrvere wants to merge 1 commit into
shipwright-io:mainfrom
psrvere:worktree-build-upload-step-resources

Conversation

@psrvere

@psrvere psrvere commented Sep 16, 2026

Copy link
Copy Markdown

Changes

Closes #415.

shp build upload previously created its own BuildRun and exposed only a fixed set of BuildRun fields as flags. As a result, a Local-source build could not request per-step compute resources, and there was no way to stream a local directory into a BuildRun created some other way. This surfaced while migrating OpenShift BuildConfigs (with spec.resources) to Shipwright with the crane plugin.

This PR adds both flags proposed in the issue:

  • --step-resources (repeatable): sets BuildRunSpec.StepResources, using the format <step>=<limits|requests>.<resource>=<quantity> (e.g. build-and-push=limits.memory=2Gi). Repeated entries for the same step merge. Wired through BuildRunSpecFromFlags, so it is also available on shp build run and shp buildrun create (StepResources is a BuildRun field).
  • --buildrun-name: streams the local source into an existing BuildRun instead of creating one, covering any BuildRun field the CLI does not expose as a flag. Guarded against combination with creation-only flags, and against source-bundle builds (streaming/Local path only).

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • 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

`shp build upload` gains `--step-resources` to override per-step compute resources and `--buildrun-name` to stream local source into an existing BuildRun.

Co-authored-by: Claude

@pull-request-size pull-request-size Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 16, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 16, 2026
@openshift-ci

openshift-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign saschaschwarze0 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@psrvere
psrvere force-pushed the worktree-build-upload-step-resources branch from 5503744 to 8d412aa Compare September 16, 2026 11:41
@psrvere psrvere changed the title Add --step-resources and --buildrun-name flags to build upload feat: add --step-resources and --buildrun-name to build upload Sep 16, 2026
@openshift-ci openshift-ci Bot added release-note and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 16, 2026
@psrvere

psrvere commented Sep 16, 2026

Copy link
Copy Markdown
Author

/kind feature

@openshift-ci openshift-ci Bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 16, 2026
`shp build upload` created its own BuildRun and exposed only a fixed set
of BuildRun fields, so a Local-source build could not request step
compute resources and could not be streamed into a BuildRun created
elsewhere. This closes the gap flagged when migrating OpenShift
BuildConfigs (with spec.resources) to Shipwright.

- --step-resources (repeatable): sets BuildRunSpec.StepResources as
  <step>=<limits|requests>.<resource>=<quantity>, e.g.
  build-and-push=limits.memory=2Gi. Wired through BuildRunSpecFromFlags,
  so it is also available on `build run` and `buildrun create`.
- --buildrun-name: streams the local source into an existing BuildRun
  instead of creating one, covering any BuildRun field the CLI does not
  expose as a flag. Guarded against combination with creation-only flags
  and against source-bundle builds.

Adds unit tests for the flag parser and upload flow, plus e2e cases, and
regenerates the command docs.

Closes: shipwright-io#415

Co-authored-by: Claude
Signed-off-by: Prateek Singh Rathore <prateek.singh.rathore@gmail.com>
@psrvere
psrvere force-pushed the worktree-build-upload-step-resources branch from 8d412aa to 07e9276 Compare September 16, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[FEATURE] shp build upload: pass step resources, or stream into an existing BuildRun

2 participants