Code re-factoring as per review comments
Details
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Looks good to me. I haven't checked the bitwise operations :-)
run_abipkgdiff.py | ||
---|---|---|
160 | This might have been left here as a debug printout by accident. |
Thanks Kamil for the review :)
run_abipkgdiff.py | ||
---|---|---|
160 | Ah, yes. Forgot to remove print statement after debugging. |
A few minor questions, otherwise looks good to me. Very much looking forward to getting this running in production.
libabigail.yml | ||
---|---|---|
12 | Out of curiosity, is yum going to be a long term requirement? | |
run_abipkgdiff.py | ||
154 | Why is the check.ReportType.BODHI_UPDATE part hardcoded? Shouldn't this be reported as check.ReportType.KOJI_BUILD? |
Thanks Tim for the review :)
libabigail.yml | ||
---|---|---|
12 | As per usecase, it was easy to use splitFilename provided by rpmUtils.miscutils module. If there is some issues with keeping yum as dependency then I can remove it. | |
run_abipkgdiff.py | ||
154 | Ah, that's because initially (before discussion started on qa-devel ML) plan was to run task only on bodhi updates. Slipped from mind to update it to check.ReportType.KOJI_BUILD. Fixed it in commit https://github.com/sinnykumari/task-libabigail/commit/e203c0d86d84a716c38d1a58b89daa7a77bffd8e |
This was done (modulo some trailing comments), I'm closing this so that it gets removed from the queue.
Sinny, one last comment below.
libabigail.yml | ||
---|---|---|
12 | I think Tim is asking because Fedora in general is trying to steer away from yum towards dnf (the transition is almost complete). Yum is going to be deprecated in the future. However, for this particular use case and for the mid-term future, I don't think it matters much. If you wanted to switch, you can do this: from libtaskotron.ext.fedora import rpm_utils nevra = rpm[:-len('.rpm')] name = rpm_utils.rpmformat(nevra, fmt='n', end_arch=True) or this (add a dependency on python2-hawkey): import hawkey nevra = rpm[:-len('.rpm')] name = hawkey.split_nevra(nevra).name You don't actually use anything else than name in your code (you don't use version, release, epoch, etc). If you did, it's trivial to do with hawkey (it returns an object), and we could easily add it to rpm_utils.rpmformat as well, if requested. Regardless of whether you do this or not, I'd recommend you to edit lines 34 and 50 and add a safety check that only rpm files are processed, like this: for rpm in os.listdir(stable_rpmsdir): if not rpm.endswith('.rpm'): continue ... |
Out of curiosity, is yum going to be a long term requirement?