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 completion for remaining Eventing resources #1567

Merged
merged 15 commits into from
Jan 18, 2022

Conversation

vyasgun
Copy link
Contributor

@vyasgun vyasgun commented Jan 13, 2022

Description

Context specific autocompletion for eventing resources

Changes

  • Added the ValidArgs function for the following resources
    • triggers
    • source:
      • ping
      • sinkbinding
      • apiserver
      • container
    • channel
    • subscription

Reference

Fixes #1373

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@vyasgun: 4 warnings.

In response to this:

Description

Context specific autocompletion for eventing resources

Changes

  • Added the ValidArgs function for the following resources
    • triggers
    • source:
      • ping
      • sinkbinding
      • apiserver
      • container
    • channel
    • subscription

Reference

Fixes #1373

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.

)

var (
testApiServerSource1 = sourcesv1.ApiServerSource{
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: var testApiServerSource1 should be testAPIServerSource1. More info.

},
ObjectMeta: metav1.ObjectMeta{Name: "test-ApiServer-source-1", Namespace: testNs},
}
testApiServerSource2 = sourcesv1.ApiServerSource{
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: var testApiServerSource2 should be testAPIServerSource2. More info.

},
ObjectMeta: metav1.ObjectMeta{Name: "test-ApiServer-source-2", Namespace: testNs},
}
testApiServerSource3 = sourcesv1.ApiServerSource{
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: var testApiServerSource3 should be testAPIServerSource3. More info.

},
ObjectMeta: metav1.ObjectMeta{Name: "test-ApiServer-source-3", Namespace: testNs},
}
testNsApiServerSources = []sourcesv1.ApiServerSource{testApiServerSource1, testApiServerSource2, testApiServerSource3}
Copy link
Contributor

Choose a reason for hiding this comment

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

Golint naming: var testNsApiServerSources should be testNsAPIServerSources. More info.

@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 13, 2022
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #1567 (9d5fd7d) into main (a96ecf5) will increase coverage by 0.09%.
The diff coverage is 87.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1567      +/-   ##
==========================================
+ Coverage   79.70%   79.79%   +0.09%     
==========================================
  Files         163      163              
  Lines        8686     8820     +134     
==========================================
+ Hits         6923     7038     +115     
- Misses       1078     1089      +11     
- Partials      685      693       +8     
Impacted Files Coverage Δ
pkg/kn/commands/completion_helper.go 86.40% <83.18%> (-3.17%) ⬇️
pkg/kn/commands/channel/delete.go 90.00% <100.00%> (+0.52%) ⬆️
pkg/kn/commands/channel/describe.go 75.00% <100.00%> (+0.53%) ⬆️
pkg/kn/commands/source/apiserver/delete.go 83.33% <100.00%> (+0.72%) ⬆️
pkg/kn/commands/source/apiserver/describe.go 73.33% <100.00%> (+0.45%) ⬆️
pkg/kn/commands/source/apiserver/update.go 78.18% <100.00%> (+0.40%) ⬆️
pkg/kn/commands/source/binding/delete.go 80.00% <100.00%> (+1.05%) ⬆️
pkg/kn/commands/source/binding/describe.go 80.64% <100.00%> (+0.31%) ⬆️
pkg/kn/commands/source/binding/update.go 64.81% <100.00%> (+0.66%) ⬆️
pkg/kn/commands/source/container/delete.go 83.33% <100.00%> (+0.72%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a96ecf5...9d5fd7d. Read the comment docs.

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 13, 2022
}

var pingSourcesClient clientv1beta2.KnPingSourcesClient
if config.params.NewSourcesV1beta2Client == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any specific reason to initialize only SourcesV1beta2Client, but other completion functions don't follow this pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ehm, I see...it isn't properly done. Please fix that by adding it here:
https://github.com/knative/client/blob/main/pkg/kn/commands/types.go#L69

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed.

@vyasgun
Copy link
Contributor Author

vyasgun commented Jan 17, 2022

/retest

@dsimansk
Copy link
Contributor

/retest

1 similar comment
@dsimansk
Copy link
Contributor

/retest

@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/kn/commands/completion_helper.go 94.9% 92.9% -2.1
pkg/kn/commands/types.go 94.0% 94.2% 0.1

Copy link
Contributor

@dsimansk dsimansk left a comment

Choose a reason for hiding this comment

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

Thanks!

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2022
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, vyasgun

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2022
@knative-prow-robot knative-prow-robot merged commit a1079df into knative:main Jan 18, 2022
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context sensitive Bash completion
4 participants