Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1515813 - copr build-module command is not intuitive
Summary: copr build-module command is not intuitive
Keywords:
Status: NEW
Alias: None
Product: Copr
Classification: Community
Component: cli
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Kadlčík
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-21 12:26 UTC by Adam Samalik
Modified: 2017-12-05 10:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Adam Samalik 2017-11-21 12:26:33 UTC
Description of problem:

The 'copr build-module' command wants a URL, but complains when it gets a URL.

```
$ copr build-module --help
usage: copr build-module [-h] (--url URL | --yaml YAML) [copr]

positional arguments:
  copr         The copr repo to list the packages of. Can be just name of
               project or even in format owner/project.

optional arguments:
  -h, --help   show this help message and exit
  --url URL    SCM with modulemd file in yaml format
  --yaml YAML  Path to modulemd file in yaml format

$ copr build-module --url https://github.com/asamalik/testmodule

Something went wrong:
Error: Error from MBS: The submitted scmurl https://github.com/asamalik/testmodule is not valid
```

It expects a URL with a Git ref in it. The following command would work:

```
$ copr build-module --url https://github.com/asamalik/testmodule?#master
```


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

copr version 1.64


Expected results:

Ideally, it would accept the following URL. It would also support specifying a branch/git ref using a parameter.

```
$ copr build-module --url https://github.com/asamalik/testmodule
$ copr build-module --url https://github.com/asamalik/testmodule --ref master
```


Additional info:

I know this syntax is taken directly from MBS. However, the copr-cli could take a nice input and give MBS what it wants.

Comment 1 Miroslav Suchý 2017-12-01 13:32:46 UTC
Hmm, we should do better in documentation or in code.

Comment 2 Jakub Kadlčík 2017-12-05 10:21:38 UTC
Adam, thank you for the feedback.

> I know this syntax is taken directly from MBS.

That is right and it is the only reason why it expects such input URL. Copr itself doesn't validate the URL at all, the validation error comes from MBS.

> It expects a URL with a Git ref in it.

We can update the --help and man page to reflect this

> Ideally, it would accept the following URL. It would also support specifying a branch/git ref using a parameter.

Yes, the `copr build-module --url https://github.com/asamalik/testmodule --ref master` looks nice. We can have "master" as the default value, so the --ref parameter would be optional.

I prefer this over documenting the current state. At first, I thought that it will be confusing for a user to use just plain URL without ref when koji accepts URL with ref - but this is not true at all since a user doesn't specify any kind of URL for koji. See https://blog.samalik.com/building-modules-for-fedora-27/


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