Bug 1473067 - bkr workflow-simple example command in documentation errors
Summary: bkr workflow-simple example command in documentation errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: develop
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: 24.4
Assignee: Anwesha Chatterjee
QA Contact: Dan Callaghan
URL:
Whiteboard:
: 1473068 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-20 00:56 UTC by Anwesha Chatterjee
Modified: 2017-10-03 03:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1473068 (view as bug list)
Environment:
Last Closed: 2017-10-03 03:57:54 UTC
Embargoed:


Attachments (Terms of Use)

Description Anwesha Chatterjee 2017-07-20 00:56:51 UTC
Description of problem:
The example command in the man page for bkr workflow-simple 
https://beaker-project.org/docs/man/bkr-workflow-simple.html
produces an error 

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. run bkr workflow-simple --arch x86_64 --random \
        --family RedHatEnterpriseLinux6 --variant Server \
        --package apache --package tomcat6

( ensure that you have that distro --family and --arch available in your running application)


Actual results:
You must specify a package, type or task to run

Expected results:
Since a package is included in the command, I would expect the error message to refer to a task /task type. Or I would expect the command to function as it is.


Additional info:
My config for the client is set up for beaker in a box.

I'm not sure if this is a documentation error, or if there is a need for update in the code to be in line with what the documentation says.
Basically right now the commands works *only* if there is a task specified. 
So should the error message (and hence the example in the docs) be updated to  "You must specify a task to run"?

Comment 1 Anwesha Chatterjee 2017-07-20 01:04:32 UTC
version: 24.3-1.fc25

Comment 2 Dan Callaghan 2017-07-20 01:28:13 UTC
I guess the problem with the example is it assumes you have tasks in your task library which are declared with

    RunFor: apache

or

    RunFor: tomcat6

So when the example is run against our internal production Beaker instance, that will be the case. But on a freshly created Beaker it won't be.

We should probably replace the "--package apache --package tomcat6" options with "--task /some/example/task" so that hopefully it is clear that the command is not supposed to work *as is* out of the box. You would only use it if you have some actual tasks you want to run.

We could also improve the error message in the case where the user passes --package, but that doesn't match anything. Right now the error message wording *looks* like a mistake because it's telling you you must pass a package but you *did* pass a package.

Maybe print a warning to stderr if a --package option is given but Beaker returns no tasks matching that package?

And then we change the error message to be something like:

    No tasks specified to be run
    Hint: Use --task, --package, or --type to select tasks

Comment 3 Anwesha Chatterjee 2017-07-20 23:44:16 UTC
https://gerrit.beaker-project.org/#/c/5756/

Comment 4 Anwesha Chatterjee 2017-07-21 03:08:10 UTC
*** Bug 1473068 has been marked as a duplicate of this bug. ***

Comment 5 Dan Callaghan 2017-08-21 07:37:14 UTC
This bug fix is included in beaker-client-24.4-0.git.17.9c963d813 which is currently available for download here:

https://beaker-project.org/nightlies/release-24/

Comment 6 Dan Callaghan 2017-09-19 05:17:53 UTC
Verified that the error messages make sense now:

$ bkr workflow-simple --dry-run --family RedHatEnterpriseLinux7 --arch x86_64
Usage: bkr workflow-simple [options]

bkr: error: No tasks specified to be run
Hint: Use --task, --package, --taskfile or --task-type to select tasks

$ bkr workflow-simple --dry-run --family RedHatEnterpriseLinux7 --arch x86_64 --package asdfasdf
No tasks match the specified option(s)

Comment 7 Dan Callaghan 2017-10-03 03:57:54 UTC
Beaker 24.4 has been released.


Note You need to log in before you can comment on or make changes to this bug.