Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API changes: fix Go-type convention, fix required fields, remove undocumented old parameters #1504

Merged

Conversation

SaschaSchwarze0
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 commented Feb 23, 2024

Changes

  • Make Build.Spec.Source optional
  • Rename Build.Spec.Source.GitSource to Git (go-type only)
  • Rename Build.Spec.Source.LocalSource to Local (go-type only)
  • Rename BuildRun.Spec.Build.Build to Spec (go-type only)
  • Rename BuildRun.Spec.Source.LocalSource to Local (go-type only)
  • Remove the undocumented CONTEXT_DIR parameter
  • Remove the undocumented build.output.image and build.source.contextDir replacement variables
  • Declare Build.Spec.Source.Type as required
  • Declare BuildRun.Spec.Source.Type as required
  • Add missing documentation to API fields

Fixes #1484
Fixes #1490

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

Release Notes

You can now define a Build without any source. This is for example useful when you want to run this build only with local source. Also, some corrections have been made to the Go types.

@openshift-ci openshift-ci bot added release-note Label for when a PR has specified a release note do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 23, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 23, 2024
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.13.0 milestone Feb 23, 2024
@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 Feb 24, 2024
@SaschaSchwarze0 SaschaSchwarze0 added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Feb 24, 2024
@SaschaSchwarze0 SaschaSchwarze0 force-pushed the sascha-api-changes branch 4 times, most recently from 2eebdd0 to 1e39df0 Compare February 24, 2024 15:26
@SaschaSchwarze0 SaschaSchwarze0 changed the title WIP API changes API changes Feb 24, 2024
@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 Feb 24, 2024
@HeavyWombat
Copy link
Contributor

@SaschaSchwarze0 Following the discussion we had on naming things, shouldn't the embedded build specification here also be renamed to something like "BuildSpec"? We actually have one place where we use it like buildRun.Spec.Build.Build, which looks counterintuitive.

@SaschaSchwarze0
Copy link
Member Author

@SaschaSchwarze0 Following the discussion we had on naming things, shouldn't the embedded build specification here also be renamed to something like "BuildSpec"? We actually have one place where we use it like buildRun.Spec.Build.Build, which looks counterintuitive.

Good catch. It should actually be Spec as that's the json field name.

@qu1queee
Copy link
Contributor

qu1queee commented Feb 27, 2024

@adambkaplan I saw some of the docs in OpenShift, I think you should take a look on this PR as well. for example making the Build.Spec.Source.Type as required, might be of your interest.

@SaschaSchwarze0
Copy link
Member Author

@adambkaplan I saw some of the docs in OpenShift, I think you should take a look on this PR as well. for example making the Build.Spec.Source.Type as required, might be of your interest.

+1 I pinged it privately to Adam already that the OpenShift docs miss the type field. :-) But, code-wise, the source.type is already required. Basically this code,

// create the step for spec.source, either Git or Bundle
switch build.Spec.Source.Type {
case buildv1beta1.OCIArtifactType:
if build.Spec.Source.OCIArtifact != nil {
appendSourceTimestampResult(taskSpec)
sources.AppendBundleStep(cfg, taskSpec, build.Spec.Source.OCIArtifact, defaultSourceName)
}
case buildv1beta1.GitType:
if build.Spec.Source.GitSource != nil {
appendSourceTimestampResult(taskSpec)
sources.AppendGitStep(cfg, taskSpec, *build.Spec.Source.GitSource, defaultSourceName)
}
}
, would not work if you don't have the type set. This PR here only declares it as required.

Copy link
Contributor

@HeavyWombat HeavyWombat left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2024
@HeavyWombat
Copy link
Contributor

@SaschaSchwarze0 Maybe the PR title should be edited to be a bit more telling.

@SaschaSchwarze0 SaschaSchwarze0 changed the title API changes API changes: fix Go-type convention, fox require parameters, remove undocumented old parameters Feb 28, 2024
@SaschaSchwarze0 SaschaSchwarze0 changed the title API changes: fix Go-type convention, fox require parameters, remove undocumented old parameters API changes: fix Go-type convention, fix require parameters, remove undocumented old parameters Feb 29, 2024
@SaschaSchwarze0 SaschaSchwarze0 changed the title API changes: fix Go-type convention, fix require parameters, remove undocumented old parameters API changes: fix Go-type convention, fix required fields, remove undocumented old parameters Feb 29, 2024
- Make Build.Spec.Source optional
- Rename Build.Spec.Source.GitSource to Git (go-type only)
- Rename Build.Spec.Source.LocalSource to Local (go-type only)
- Rename BuildRun.Spec.Build.Build to Spec (go-type only)
- Rename BuildRun.Spec.Source.LocalSource to Local (go-type only)
- Remove the undocumented CONTEXT_DIR parameter
- Remove the undocumented `build.output.image` and `build.source.contextDir` replacement variables
- Declare Build.Spec.Source.Type as required
- Declare BuildRun.Spec.Source.Type as required
- Add missing documentation to API fields
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 29, 2024
@SaschaSchwarze0
Copy link
Member Author

Rebased to resolve conflicts.

Copy link
Contributor

@HeavyWombat HeavyWombat left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2024
Copy link
Contributor

@HeavyWombat HeavyWombat left a comment

Choose a reason for hiding this comment

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

/approve

Copy link
Contributor

openshift-ci bot commented Mar 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HeavyWombat

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

The pull request process is described here

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 Mar 1, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0ca3792 into shipwright-io:main Mar 1, 2024
12 checks passed
@SaschaSchwarze0 SaschaSchwarze0 deleted the sascha-api-changes branch March 1, 2024 15:30
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Archived in project
3 participants