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

Adding a check for the set bundle max used in the pipeline controller. #1572

Merged
merged 1 commit into from
Aug 1, 2022

Conversation

williamlfish
Copy link
Contributor

@williamlfish williamlfish commented May 23, 2022

Currently a user does not know when they might have added too many objects until they attempt to run an image. Adding to the bundle cmd will at least give them feedback before attempting to use the bundle.

Changes

Adding a quick check to the bundle to make sure its layers don't go over the max allowed in the pipeline controller. This is really more for devs using the cli, as it can be a poor ux to create a bundle and not know its unusable till attempting to 😅 .
There is a pr to double the current allowed about here so there is a potential for these to be out of sync and not sure if that should be addressed considering bundles are still in alpha.

Also added some tests 😸

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

The cli will error if attempting to create a bundle with more objects than allowed by the pipeline controller.

@tekton-robot tekton-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 23, 2022
@tekton-robot
Copy link
Contributor

Hi @williamlfish. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed 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/test-infra repository.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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 May 23, 2022
@vinamra28
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 25, 2022
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/bundle/builder.go 71.9% 70.6% -1.3

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 25, 2022
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/bundle/builder.go 71.9% 81.1% 9.2

Comment on lines 134 to 149
func TestTooManyObjects(t *testing.T) {
task := v1beta1.Task{
TypeMeta: metav1.TypeMeta{
APIVersion: "tekton.dev/v1beta1",
Kind: "Task",
},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Spec: v1beta1.TaskSpec{Description: "foobar"},
}

raw, err := yaml.Marshal(task)
if err != nil {
t.Error(err)
return
}
// no error for less then max
_, err = BuildTektonBundle([]string{string(raw)}, &bytes.Buffer{})
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should be breaking this into multiple functions so that it is more readable?
/cc @piyush-garg @pradeepitm12 @vdemeester

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to do that, however I have a feeling we may toss this pr out 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

@williamlfish will be better to have one scenario in a test case

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/bundle/builder.go 71.9% 81.1% 9.2

@williamlfish
Copy link
Contributor Author

/retest

2 similar comments
@vinamra28
Copy link
Member

/retest

@williamlfish
Copy link
Contributor Author

/retest

@williamlfish
Copy link
Contributor Author

Is there any known issues with the e2e tests? Running locally I can get them to pass, but I personally noticed they can be a little brittle, mostly with the cluster wide resources, and hitting timeouts 😬

@piyush-garg
Copy link
Contributor

Is there any known issues with the e2e tests? Running locally I can get them to pass, but I personally noticed they can be a little brittle, mostly with the cluster wide resources, and hitting timeouts grimacing

tests seems to be working fine

@vdemeester
Copy link
Member

/retest

Currently a user does not know when they might have added to many objects untill they attempt to run an image. Adding to the bundle cmd will at least give them more imediate feedback before attempting to use the bundle.
@williamlfish
Copy link
Contributor Author

/assign @vdemeester

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2022
@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2022
@piyush-garg
Copy link
Contributor

/retest

@tekton-robot tekton-robot merged commit 417a52f into tektoncd:main Aug 1, 2022
@tekton-robot
Copy link
Contributor

@williamlfish: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-tekton-cli-integration-tests d0aa6ce link true /test pull-tekton-cli-integration-tests

Full PR test history. Your PR dashboard.

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/test-infra repository. I understand the commands that are listed here.

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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants