Bug 772751

Summary: Review Request: git-review - Helper for Gerrit
Product: [Fedora] Fedora Reporter: Pete Zaitcev <zaitcev>
Component: Package ReviewAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: notting, package-review, rkukura, spencerandrewjackson
Target Milestone: ---Flags: rkukura: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-09 00:40:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pete Zaitcev 2012-01-09 21:17:49 UTC
Spec URL: http://people.redhat.com/zaitcev/tmp/git-review-1.9-2.fc16.spec
SRPM URL: http://people.redhat.com/zaitcev/tmp/git-review-1.9-2.fc16.src.rpm
Description:
An extension for source control system git that creates and manages review
requests in the patch management system Gerrit. It replaces the rfc.sh script.

Comment 1 Spencer Jackson 2012-01-13 19:59:52 UTC
Hi, I'm neither sponsored, nor a reviewer. So, this is just an informal review.

[PASS] MUST: rpmlint must be run on the source rpm and all binary rpms the build produces. The output should be posted in the review.

[makerpm@khezef rpmbuild]$ rpmlint RPMS/noarch/git-review-1.9-2.fc16.noarch.rpm SRPMS/git-review-1.9-2.fc16.src.rpm
git-review.noarch: W: name-repeated-in-summary C git-review
git-review.noarch: W: spelling-error %description -l en_US rfc -> RFC, rec, Pfc
git-review.noarch: W: no-version-in-last-changelog
git-review.noarch: W: wrong-file-end-of-line-encoding /usr/share/doc/git-review-1.9/LICENSE
git-review.src: W: name-repeated-in-summary C git-review
git-review.src: W: spelling-error %description -l en_US rfc -> RFC, rec, Pfc
git-review.src: W: no-version-in-last-changelog
git-review.src:11: W: macro-in-comment %{version}
git-review.src: W: invalid-url Source0: openstack-ci-git-review-1.9-0-ga28af31.tar.gz
2 packages and 0 specfiles checked; 0 errors, 9 warnings.

[PASS] MUST: The package must be named according to the Package Naming Guidelines .

[PASS] MUST: The spec file name must match the base package %{name}, in the format %{name}.spec unless your package has an exemption.

[FAIL] MUST: The package must meet the Packaging Guidelines .
        -> Invalid changelog format
        -> Macro forms of system executables should not be used
        -> First line of install uses a $ macro, while % is used elsewhere
        -> BuildRequires should specify either python2-devel or python3-devel

[PASS] MUST: The package must be licensed with a Fedora approved license and meet the Licensing Guidelines .

[PASS] MUST: The License field in the package spec file must match the actual license.

[PASS] MUST: If (and only if) the source package includes the text of the license(s) in its own file, then that file, containing the text of the license(s) for the package must be included in %doc.

[PASS] MUST: The spec file must be written in American English.

[PASS] MUST: The spec file for the package MUST be legible.

[PASS] MUST: The sources used to build the package must match the upstream source, as provided in the spec URL. Reviewers should use md5sum for this task. If no upstream URL can be specified for this package, please see the Source URL Guidelines for how to deal with this.

[PASS] MUST: The package MUST successfully compile and build into binary rpms on at least one primary architecture.

[PASS] MUST: If the package does not successfully compile, build or work on an architecture, then those architectures should be listed in the spec in ExcludeArch. Each architecture listed in ExcludeArch MUST have a bug filed in bugzilla, describing the reason that the package does not compile/build/work on that architecture. The bug number MUST be placed in a comment, next to the corresponding ExcludeArch line.

[PASS] MUST: All build dependencies must be listed in BuildRequires, except for any that are listed in the exceptions section of the Packaging Guidelines ; inclusion of those as BuildRequires is optional. Apply common sense.

[PASS] MUST: The spec file MUST handle locales properly. This is done by using the %find_lang macro. Using %{_datadir}/locale/* is strictly forbidden.

[PASS] MUST: Every binary RPM package (or subpackage) which stores shared library files (not just symlinks) in any of the dynamic linker's default paths, must call ldconfig in %post and %postun.

[PASS] MUST: Packages must NOT bundle copies of system libraries.

[PASS] MUST: If the package is designed to be relocatable, the packager must state this fact in the request for review, along with the rationalization for relocation of that specific package. Without this, use of Prefix: /usr is considered a blocker.

[PASS] MUST: A package must own all directories that it creates. If it does not create a directory that it uses, then it should require a package which does create that directory.

[PASS] MUST: A Fedora package must not list a file more than once in the spec file's %files listings. (Notable exception: license texts in specific situations)

[PASS] MUST: Permissions on files must be set properly. Executables should be set with executable permissions, for example.

[FAIL] MUST: Each package must consistently use macros.
        Pick a macro stye and conform to it. First line of %install uses $RPM_BUILD_ROOT, while %{buildroot} is used elsewhere.

[PASS] MUST: The package must contain code, or permissable content.

[PASS] MUST: Large documentation files must go in a -doc subpackage. (The definition of large is left up to the packager's best judgement, but is not restricted to size. Large can refer to either size or quantity).

[PASS] MUST: If a package includes something as %doc, it must not affect the runtime of the application. To summarize: If it is in %doc, the program must run properly if it is not present.

[PASS] MUST: Header files must be in a -devel package.

[PASS] MUST: Static libraries must be in a -static package.

[PASS] MUST: If a package contains library files with a suffix (e.g. libfoo.so.1.1), then library files that end in .so (without suffix) must go in a -devel package.

[PASS] MUST: In the vast majority of cases, devel packages must require the base package using a fully versioned dependency: Requires: %{name}%{?_isa} = %{version}-%{release}

[PASS] MUST: Packages must NOT contain any .la libtool archives, these must be removed in the spec if they are built.

[PASS] MUST: Packages containing GUI applications must include a %{name}.desktop file, and that file must be properly installed with desktop-file-install in the %install section. If you feel that your packaged GUI application does not need a .desktop file, you must put a comment in the spec file with your explanation.[PASS] MUST: Packages must not own files or directories already owned by other packages. The rule of thumb here is that the first package to be installed should own the files or directories that other packages may rely upon. This means, for example, that no package in Fedora should ever share ownership with any of the files or directories owned by the filesystem or man package. If you feel that you have a good reason to own a file or directory that another package owns, then please present that at package review time.

[PASS] MUST: All filenames in rpm packages must be valid UTF-8.


[PASS] SHOULD: If the source package does not include license text(s) as a separate file from upstream, the packager SHOULD query upstream to include it.

[PASS] SHOULD: The description and summary sections in the package spec file should contain translations for supported Non-English languages, if available.

[PASS] SHOULD: The reviewer should test that the package builds in mock.

[makerpm@khezef rpmbuild]$ mock SRPMS/git-review-1.9-2.fc16.src.rpm 
INFO: mock.py version 1.1.18 starting...
State Changed: init plugins
INFO: selinux enabled
State Changed: start
INFO: Start(SRPMS/git-review-1.9-2.fc16.src.rpm)  Config(fedora-16-x86_64)
State Changed: lock buildroot
State Changed: clean
INFO: chroot (/var/lib/mock/fedora-16-x86_64) unlocked and deleted
State Changed: unlock buildroot
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.18
INFO: Mock Version: 1.1.18
INFO: calling preinit hooks
INFO: enabled root cache
State Changed: unpacking root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: unlock buildroot
INFO: Installed packages:
State Changed: setup
State Changed: build
INFO: Done(SRPMS/git-review-1.9-2.fc16.src.rpm) Config(default) 1 minutes 13 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-16-x86_64/result
State Changed: end


[PASS] SHOULD: The package should compile and build into binary rpms on all supported architectures.
Note. My use of Mock here to cross this for testing isn't ideal... But it is noarch.

[makerpm@khezef rpmbuild]$ mock -r fedora-16-i386 SRPMS/git-review-1.9-2.fc16.src.rpm
INFO: mock.py version 1.1.18 starting...
State Changed: init plugins
INFO: selinux enabled
State Changed: start
INFO: Start(SRPMS/git-review-1.9-2.fc16.src.rpm)  Config(fedora-16-i386)
State Changed: lock buildroot
State Changed: clean
State Changed: unlock buildroot
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.18
INFO: Mock Version: 1.1.18
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: creating cache
State Changed: unlock buildroot
INFO: Installed packages:
State Changed: setup
State Changed: build
INFO: Done(SRPMS/git-review-1.9-2.fc16.src.rpm) Config(fedora-16-i386) 4 minutes 36 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-16-i386/result

[PASS] SHOULD: The reviewer should test that the package functions as described. A package should not segfault instead of running, for example.

[PASS] SHOULD: If scriptlets are used, those scriptlets must be sane. This is vague, and left up to the reviewers judgement to determine sanity.

[PASS] SHOULD: Usually, subpackages other than devel should require the base package using a fully versioned dependency.

[PASS] SHOULD: The placement of pkgconfig(.pc) files depends on their usecase, and this is usually for development purposes, so should be placed in a -devel pkg. A reasonable exception is that the main pkg itself is a devel tool not installed in a user runtime, e.g. gcc or gdb.

[PASS] SHOULD: If the package has file dependencies outside of /etc, /bin, /sbin, /usr/bin, or /usr/sbin consider requiring the package which provides the file instead of the file itself.

[PASS] SHOULD: your package should contain man pages for binaries/scripts. If it doesn't, work with upstream to add them where they make sense.


Additionally, the neither the %clean or %defattr sections are required. The %doc statement will install documentation from the build directory into the buildroot automatically, so there's no need to copy it over in %install. Your rpmlint warnings should also be addressed.

Comment 2 Pete Zaitcev 2012-01-18 02:41:38 UTC
I reviewed Spenser's informal review and fixed up the submission. The
failed check points are fully addressed, but with non-mandatory things,
I had to maneuver a little:
 - the spelling fail is due to "rfc.sh", so left it untouched
 - not sure if we want to run dos2unix on LICENSE ...
 - %clean is left in place for EPEL

For some reason it was a complete news to me that %doc installs, sorry.

RPMs are updated, here:
 http://people.redhat.com/zaitcev/tmp/git-review-1.9-3.fc16.src.rpm
 http://people.redhat.com/zaitcev/tmp/git-review-1.9-3.fc16.spec

Comment 3 Spencer Jackson 2012-01-18 17:48:41 UTC
Ah, my bad on the EPEL support. As for the LICENSE encoding, http://fedoraproject.org/wiki/Common_Rpmlint_issues#wrong-file-end-of-line-encoding describes how to fix the issue using sed.

Comment 4 Pete Zaitcev 2012-01-18 20:00:38 UTC
Implemented the sed fix in %build for 1.9-4. Oh that blasted github...

[root@lembas zaitcev]# rpmlint rpms/SPECS/git-review.spec
rpms/SPECS/git-review.spec: W: invalid-url Source0: openstack-ci-git-review-1.9-0-ga28af31.tar.gz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.
[root@lembas zaitcev]# rpm -U rpms/RPMS/noarch/git-review-1.9-4.fc16.noarch.rpm
[root@lembas zaitcev]# rpmlint git-review
git-review.noarch: W: spelling-error %description -l en_US rfc -> RFC, rec, Pfc
1 packages and 0 specfiles checked; 0 errors, 1 warnings.
[root@lembas zaitcev]#

Comment 5 Pete Zaitcev 2012-02-01 01:06:21 UTC
Update to git-review-1.12

http://people.redhat.com/zaitcev/tmp/git-review-1.12-1.fc16.spec
http://people.redhat.com/zaitcev/tmp/git-review-1.12-1.fc16.src.rpm

This fixes what I promised Spenser, but adds a whitespace error (to be fixed).

Comment 6 Bob Kukura 2012-02-07 16:58:22 UTC
Pete,

This is close to ready. Here are this questions/issues I found:

1) Is the python_sitelib definition on the 1st line needed? If not, please remove it.

2) Why is Group commented out in the spec? Enable it unless there is a reason not to.

3) List BuildRequires each on separate lines.

4) Use python-setuptools rather than python-setuptools-devel in BuildRequires.

5) Add any needed Requires lines for runtime (i.e. "Requires: git").

6) Add "%dir %{_sysconfdir}/git-review" so that the RPM owns the /etc/git-review directory.

7) Replace spaces with tabs on line 15.

8) Replace "%" with "%%" in comment on line 48, or remove comment if not needed.

-Bob

Comment 7 Pete Zaitcev 2012-02-07 19:42:21 UTC
1) I swear python_sitelib wasn't cargo-culted: it was in Packaging:Python.
However now it says "only for RHEL 5". Removed.

2) Group was commented as TODO to find the appropriate grou.
Using Development/Tools.

3) Fixed, split BuildRequires

4) Indeed apparently the syntax was incorrect, too. I do not have
"python-setuptools-devel" installed even, and RPM was building fine.

5) Added Requires: git. Nothing else comes to mind... Note that git-review
can form ssh:// URLs for git, but I do not want to saddle the package with
an extra requirement like this.

I have verified that all imported modules come from the standard library
and do not require additional Requires:.

6) Added %dir %{_sysconfdir}/git-review

7) Made tab-clean

8) Removed comment with %

Comment 9 Bob Kukura 2012-02-07 20:15:54 UTC
Looks fine to me. The following rpmlint output is all justified:

$ rpmlint SPECS/git-review.spec 
SPECS/git-review.spec: W: invalid-url Source0: openstack-ci-git-review-1.12-0-ge852960.tar.gz
0 packages and 1 specfiles checked; 0 errors, 1 warnings.
$ rpmlint SRPMS/git-review-1.12-2.fc16.src.rpm 
git-review.src: W: spelling-error %description -l en_US rfc -> RFC, rec, Pfc
git-review.src: W: invalid-url Source0: openstack-ci-git-review-1.12-0-ge852960.tar.gz
1 packages and 0 specfiles checked; 0 errors, 2 warnings.
$ rpmlint RPMS/noarch/git-review-1.12-2.fc16.noarch.rpm 
git-review.noarch: W: spelling-error %description -l en_US rfc -> RFC, rec, Pfc
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

Approved!

Comment 10 Pete Zaitcev 2012-02-07 21:49:15 UTC
New Package SCM Request
=======================
Package Name: git-review
Short Description: A git helper for integration with Gerrit
Owners: zaitcev
Branches: f16
InitialCC:

Comment 11 Gwyn Ciesla 2012-02-08 13:13:09 UTC
Git done (by process-git-requests).

Comment 12 Pete Zaitcev 2012-04-11 22:02:35 UTC
Package Change Request
======================
Package Name: git-review
New Branches: f17
Owners: zaitcev

Bodhi says:
Creating a new update for  git-review-1.16-1.fc17 
AppError(PackageDBError, The package git-review is not in Collection Fedora 17., extras=None)

Hopefuly adding the branch is the right answer here.

Comment 13 Gwyn Ciesla 2012-04-12 12:29:16 UTC
Git done (by process-git-requests).

Comment 14 Pete Zaitcev 2012-07-17 22:56:15 UTC
Package Change Request
======================
Package Name: git-review
New Branches: el6
Owners: zaitcev

This request is actually for EPEL, see bug 840826.
The /wiki/Package_SCM_admin_requests says request the normal "el6" for EPEL.

Comment 15 Gwyn Ciesla 2012-07-18 03:14:24 UTC
Git done (by process-git-requests).

Comment 16 Pete Zaitcev 2014-09-03 02:41:54 UTC
Package Change Request
======================
Package Name: git-review
New Branches: epel7
Owners: zaitcev

See bug 1115032.

Comment 17 Gwyn Ciesla 2014-09-03 10:43:21 UTC
Git done (by process-git-requests).