#212 Avoid branch detection for 'rpkg sources'
Merged by cqi. Opened by praiskup.
praiskup/rpkg lazier-sources-command  into  master

Download 212.patch

After CentOS change 7a006813224aebdf3ce1d0d1667f97949af4c7a2, it
was impossible (without explicit --release option) to download
sources in unclean git branch.

It would be pity to have such limitation everywhere, even for
non-CentOS dist-git instances where branch info is not used for
source location. So let's make this feature optional:

[cpkg]
lookaside_kwargs = branch

Also, the original motivation was that it a bit complicates 'rpkg'
re-usability (rhbz#1410403).

rebased

rebased

@praiskup Hi, I don't quite understand the "Lazier download". Can you give a concrete use case?

The way branch_merge is evaluated is the "lazy" approach ... (on demand). And for rpkg sources it is (except for centos) useless to try to guess what the git branch is ... but TBH, the sources command is not really more lazy here. I'll try to rephrase ...

rebased

@cqi, thanks for having a look, rephrased -- PTAL.

Looks good to me. It might be nice to put the documentation somewhere else than just the commit message (maybe a commented out part of the example config in etc/rpkg/rpkg.conf?)

I'll update accordingly, thanks for having a look!

Can we make "Additional kwargs" more specific?

Can you help to explain what problem these lines of code solves? I don't understand why set branch to self.branch_merge if name branch is present in self.lookaside_kwargs, then only pass branch to self.lookasidecache.download and ignore others listed in lookaside_kwargs option.

After reading pr description again, I think I get the point. And it would be good to comment out these lines of code.

@praiskup

Any update so far?

A suggestion to the name of lookaside_kwargs. How about let us rename it? Setting values to this option is for constructing lookaside request URL with optional paramters. Meanwhile, kwargs is usually a Python convention to name keyword paramters. From my point of view, when I looked at name lookaside_kwargs for the first time, it does not give me too much information. Would lookaside_request_params be a better name? That would be clear and easy to understand what this option is used for.

EDIT: whatever the name is, as long as it could be informative as much as possible I think.

rebased

PTAL, sorry for the delay.

Looks good to me.

Pull-Request has been merged by cqi

Metadata