#189 Add requests-tests-repo command
Merged by cqi. Opened by mvadkert.
mvadkert/fedpkg issue/176  into  master

Download 189.patch

This patch adds a command for adding new repository in the tests
namespace. The only required parameter is the module name and the
description of the repository.

An example of issue filed by the new command:

https://stg.pagure.io/releng/fedora-scm-requests/issue/47

Resolves:

https://pagure.io/fedpkg/issue/176

Note:

I did not try to extend the current request-repo command, as the
required parameters for this request are not needed and the request
does not need an bugzilla.

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

There is fedpkg-stage that interacts with stg dist-git. src.fedoraproject.org should be the stg domain name when fedpkg-stage request-tests-repo -h.

https://src.fedoraproject.org/projects/rpms/fedpkg redirects to https://src.fedoraproject.org/rpms/fedpkg. I think the part projects/ is not necessary. But, I'm not sure if this also applies to tests/ repositories.

I think we can reuse existing _request_repo. Part of the arguments may not be necessary for requesting a tests repository. It should make sense to make them optional so that _request_repo is usable to request either normal or tests repository.

This should be a good idea. However, instead of requesting from https://src.fedoraproject.org/tests/{0}, is PDC a better source to confirm if the requested repository exists?

I'm thinking we can also reuse command request-repo with a new command line option for the request of a tests repo. What do you think?

Should this argument be a bug ID or an arbitrary text for a description?

Interesting

rebased onto c66ed50e6911885eb6009c7c3dc5dd0b60acf347

@cqi I tried to address all your comments. I now user the _request_repo function, to mitigate code duplication. I also try to extract the repository URL from the anongiturl config variable.

s/rhpkgError/rpkgError/

'{}' is not supported in Python 2.6. As we have to build and release EL6 package, fedpkg must be able to run with Python 2.6.

Although it would be good to write such defense code in case something wrong with anongiturl in configuration, self.cmd.anongiturl should be enough. The load_cmd handles it already. We can keep simple here.

These lines repeats what request-repo mentions. How about just give a message to reference request-repo's help message just like the message of request-branch? This can avoid maintaining same content in two places.

This still confuses me. Bug ID is not required for requesting a tests repo and from the test below it is just a text not a bug. It looks this help is not correct. Am I right?

I don't think leading and trailing '```' should be removed in this test. Instead, the actual issue content, which is sent to Pagure.io, should be asserted.

@mvadkert Thanks. It's much better to reuse _request_repo. Still have some comments.

In addition, there are also some issues detected by Jenkins job.

s/rhpkgError/rpkgError/

Fixed. thanks

'{}' is not supported in Python 2.6. As we have to build and release EL6 package, fedpkg must be able to run with Python 2.6.

Fixed on all places

Although it would be good to write such defense code in case something wrong with anongiturl in configuration, self.cmd.anongiturl should be enough. The load_cmd handles it already. We can keep simple here.

Why I did it this way, i.e. reading anongiturl from config, was that I needed it for help of the requests-tests-repo command, and in that time self.cmd.anongiturl is available. Anyway, I changed
the code to use self.cmd.anongiturl in one case, when it is

These lines repeats what request-repo mentions. How about just give a message to reference request-repo's help message just like the message of request-branch? This can avoid maintaining same content in two places.

Right, added :)

I don't think leading and trailing '```' should be removed in this test. Instead, the actual issue content, which is sent to Pagure.io, should be asserted.

This is already done the same way in the tests above actually. I would keep it for consistency if possible.

In addition, there are also some issues detected by Jenkins job.

All flake issues resolved

rebased onto a54a9d47c8363eb05bdd94b5a8c49f98e00446ee

rebased onto 34071ac112a22c6160ecb044e88818fc2d4ad3cb

pretty please pagure-ci rebuild

@cqi sorry, did not know I need to ask for rebuild :) I am glad it is passing now :)

Looks good to me. Thanks.

Commit fb4a3928 fixes this pull-request

Pull-Request has been merged by cqi

Pull-Request has been merged by cqi

Metadata