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

Improve BuildVersion verification and local checks in krel build #2024

Merged
merged 3 commits into from
Apr 29, 2021

Conversation

puerco
Copy link
Member

@puerco puerco commented Apr 28, 2021

What type of PR is this?

/kind cleanup
/kind feature

What this PR does / why we need it:

This PR improves the input validation in krel release by introducing the following changes:

  1. The release.IsValidReleaseBuild() function now enforces the versionBuildRE regexp to check the build version when it contains a plus sign.
  2. This same function is now used in the options validation in anago in addition to the SemVer parsing check.
  3. Finally, when invoking a command that would result in a cloud build Job, krel release will now perform a local validation of the options before running.

While the options are checked during the release process, double-checking them saves the release manager time in case of an error and resources by avoiding the execution of a job destined to fail.

Which issue(s) this PR fixes:

Stops a recurring problem with input encountered again during the v1.22.0-alpha.1 cut (kubernetes/sig-release#1547)

Special notes for your reviewer:

Does this PR introduce a user-facing change?

- `krel release` will now check its inputs locally before submitting a GCB job.
- The `release.IsValidReleaseBuild()` function will now do a better validation of the BuildVersion option.
- Options in krel now perform a better check of the BuildVersion string in addition to parsing it as SemVer

puerco added 3 commits April 28, 2021 18:05
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority area/release-eng Issues or PRs related to the Release Engineering subproject labels Apr 28, 2021
@k8s-ci-robot k8s-ci-robot requested review from cpanato and xmudrii April 28, 2021 23:21
@k8s-ci-robot k8s-ci-robot added sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 28, 2021
@puerco
Copy link
Member Author

puerco commented Apr 28, 2021

/milestone v1.22

@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Apr 28, 2021
@puerco puerco changed the title Check build input Improve BuildVersion verification and local checks in krel build Apr 28, 2021
@cpanato
Copy link
Member

cpanato commented Apr 29, 2021

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority labels Apr 29, 2021
Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, puerco

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

@k8s-ci-robot k8s-ci-robot merged commit b8b8813 into kubernetes:master Apr 29, 2021
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. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/release Categorizes an issue or PR as relevant to SIG Release. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants