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

Bugfix Returns an error if no pipelines found #194

Merged
merged 1 commit into from
Aug 1, 2019
Merged

Bugfix Returns an error if no pipelines found #194

merged 1 commit into from
Aug 1, 2019

Conversation

pradeepitm12
Copy link
Contributor

@pradeepitm12 pradeepitm12 commented Jul 31, 2019

Returns an error with proper message if no pipelines found
Adds example message
Adds test for no pipelines

Signed-off-by: Pradeep Kumar pradkuma@redhat.com

Changes

Submitter Checklist

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

See the contribution guide
for more details.

Release Notes

release-note

Returns an error with proper message if no pipelines found
Adds example message
Adds test for no pipelines

Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 31, 2019
@vdemeester
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 31, 2019
@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/logs.go 54.3% 60.2% 5.9

@@ -53,15 +53,25 @@ func logCommand(p cli.Params) *cobra.Command {
}

eg := `
# show the logs of the latest pipelinerun of given pipeline
tkn pipeline logs foo -n bar
# show logs interactively for no inputs
Copy link
Member

Choose a reason for hiding this comment

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

this needs to rephrased, how about: "interactive mode: shows log of the selected pipeline run"


# show logs interactively for given pipeline
Copy link
Member

Choose a reason for hiding this comment

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

same as above: "interactive mode: shows log of the pipeline-run of the given pipeline"

tkn pipeline logs pipeline_name -n namespace

# show logs of given pipeline for last run
tkn pipeline logs pipeline_name -n namespace --last
Copy link
Member

Choose a reason for hiding this comment

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

I prefer pipeline to pipeline_name as a pipeline is known by its name - right?

@@ -193,7 +203,9 @@ func allPipelines(p cli.Params) ([]string, error) {
if err != nil {
return nil, err
}

if len(ps.Items) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

in an interactive mode, why is this an error? if the user has not specified a pipeline then this shouldn't be an error.

Copy link
Member

@sthaha sthaha left a comment

Choose a reason for hiding this comment

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

I think,

  • tkn p logs -n ns should not return an error when there are no pipelines

  • tkn p logs -n ns pipeline should return an error if the the pipeline cannot be found

  • tkn p logs -n ns pipeline should not return an error if the pipeline exits but there aren't any pipeline-runs; just show a message "no pipeline runs found for pipeline"

  • tkn p logs -n ns pipeline -l should return an error if the pipeline exits but there aren't any pipeline-runs as the user has requested for the last pipelinerun which does not exist

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pradeepitm12, 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 Aug 1, 2019
@tekton-robot tekton-robot merged commit a5dc18f into tektoncd:master Aug 1, 2019
@vdemeester vdemeester added this to the 0.2.0 🐱 milestone Aug 1, 2019
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. cla: yes lgtm Indicates that a PR is ready to be merged. 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.

5 participants