Bug 1473067 - bkr workflow-simple example command in documentation errors
bkr workflow-simple example command in documentation errors
Product: Beaker
Classification: Community
Component: command line (Show other bugs)
Unspecified Unspecified
unspecified Severity low (vote)
: 24.4
: ---
Assigned To: Anwesha Chatterjee
Dan Callaghan
: Patch
: 1473068 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2017-07-19 20:56 EDT by Anwesha Chatterjee
Modified: 2017-10-02 23:57 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1473068 (view as bug list)
Last Closed: 2017-10-02 23:57:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Anwesha Chatterjee 2017-07-19 20:56:51 EDT
Description of problem:
The example command in the man page for bkr workflow-simple 
produces an error 

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

How reproducible:

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-19 21:04:32 EDT
version: 24.3-1.fc25
Comment 2 Dan Callaghan 2017-07-19 21:28:13 EDT
I guess the problem with the example is it assumes you have tasks in your task library which are declared with

    RunFor: apache


    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 19:44:16 EDT
Comment 4 Anwesha Chatterjee 2017-07-20 23:08:10 EDT
*** Bug 1473068 has been marked as a duplicate of this bug. ***
Comment 5 Dan Callaghan 2017-08-21 03:37:14 EDT
This bug fix is included in beaker-client-24.4-0.git.17.9c963d813 which is currently available for download here:

Comment 6 Dan Callaghan 2017-09-19 01:17:53 EDT
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-02 23:57:54 EDT
Beaker 24.4 has been released.

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