Bug 854764 - Review Request:openshift-origin-port-proxy - Script to configure HAProxy to do port forwarding for OpenShift Origin
Review Request:openshift-origin-port-proxy - Script to configure HAProxy to d...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: Package Review (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Michael Scherer
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-05 14:57 EDT by Adam Miller
Modified: 2012-12-07 23:27 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-07 23:26:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
misc: fedora‑review+
limburgher: fedora‑cvs+


Attachments (Terms of Use)

  None (edit)
Description Adam Miller 2012-09-05 14:57:21 EDT
Spec URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy.spec
SRPM URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy-0.2.2-1.fc17.src.rpm

Description: 
OpenShift Origin script to configure HAProxy to do port forwarding from internal
to external ports.

Fedora Account System Username: maxamillion tdawson
Comment 1 Michael Scherer 2012-09-06 08:00:03 EDT
Hi, a few notes :
* why does it requires procmail ? 
if that's for flock ( used in the script ), this is utils-linux in f17

* since openshift is not planned to run on epel5, I think you should clean the various stuff for epel5 ( %defattr, BuildRoot tag, rm -Rf in %clean, etc ) 

* why is the config copied in %post and not directly placed there directly by the rpm, and why do you run restorecon for that ? ( and why not run it with the configuration from /etc/ directly ? )

* spec would IMHO be cleaner with only non defaut %attr

* why are permission initscript set to 750, as there is
Comment 2 Adam Miller 2012-09-07 18:29:04 EDT
Spec URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy.spec
SRPM URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy-0.2.2-2.fc17.src.rpm


the procmail requirement was from upstream and is no longer needed, I went ahead and added all hard requirements just so that the package could actually be installed via kickstart in a nobase environment and resolve deps correctly, also stripped out old el5 build bits from the spec.

The perms on the initscript were also from upstream, I'm flexible on that though as I don't understand it to have any hard requirement for those specific perms.
Comment 3 Michael Scherer 2012-09-08 05:39:30 EDT
What do you mean in a "nobase environnement" ?

As far as i know, we consider that that least group core would be installed, so IMHO :
coreutils initscripts util-linux-ng and iproute are counted as being installed on Fedora.

However, you are right for sed, as it doesn't seem to be there in minimal install.

Regarding old EL5 stuff, there is :
rm -rf $RPM_BUILD_ROOT
in %install too.

And as i may not have been clear, the part :
%files
%if %{with_systemd}
%attr(0644,-,-) %{_unitdir}/stickshift-proxy.service
%attr(0644,-,-) %{_sysconfdir}/sysconfig/stickshift-proxy
%else
%attr(0750,-,-) %{_initddir}/stickshift-proxy
%endif
%attr(0755,-,-) %{_bindir}/stickshift-proxy-cfg
%dir %attr(0750,root,root) %{_localstatedir}/lib/stickshift/.stickshift-proxy.d
%attr(0640,-,-) %config(noreplace) %{_sysconfdir}/stickshift/stickshift-proxy.cfg


would be cleaner as 

%files
%if %{with_systemd}
%{_unitdir}/stickshift-proxy.service
%{_sysconfdir}/sysconfig/stickshift-proxy
%else
%{_initddir}/stickshift-proxy
%endif
%{_bindir}/stickshift-proxy-cfg
%dir %attr(0750,-,-) %{_localstatedir}/lib/stickshift/.stickshift-proxy.d
%config(noreplace) %{_sysconfdir}/stickshift/stickshift-proxy.cfg

Since permissions are already set in the spec by install a few line before.

I do not understand when the config from /etc/ is copied to /var to be used by the service, can you clarify that, and decide which one should be dropped ( because having 2 configuration when only one is used doesn't make sense ) ?
Comment 4 Rob Millner 2012-09-10 13:24:47 EDT
I believe we can just have one copy of the configuration file and mark it as %config(noreplace).

The configuration file changes as the set of local gears change and as the cartridges embedded in a gear change.  

Either location: %{_sysconfdir}/stickshift or %{_localstatedir}/lib/stickshift/.stickshift-proxy.d is acceptable.  The latter is a convention also used by our per-gear http configuration.  

Perhaps the best choice is to use %{_sysconfdir}/stickshift.
Comment 5 Adam Miller 2012-09-10 15:42:15 EDT
I was referencing a --nobase install via kickstart, a previous employer of mine did all their installations like that to keep OS installs in the virtualization farm as minimal as possible. Don't know how realistic that is of a goal to meet but that was the motivation behind the explicit requires entries.
Comment 6 Adam Miller 2012-09-12 12:00:37 EDT
Upstream made some modifications based on feedback. 

https://github.com/openshift/crankcase/pull/467

I've packaged the latest version that includes these changes:

Spec URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy.spec
SRPM URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy-0.2.3-1.fc17.src.rpm
Comment 7 Michael Scherer 2012-09-19 01:21:47 EDT
I see there is a bugfix for this package upstream :
https://github.com/openshift/crankcase/pull/449 
I didn't have the time to test it yet, but is it applicable, and so, should it be backported ?

IMHO, it would be better to have /etc/sysconfig/stickshift-proxy be a file rather than be a directory with a file in it ( more consistent ).
Comment 8 Michael Scherer 2012-09-19 03:26:26 EDT
Package Review
==============

Key:
- = N/A
x = Pass
! = Fail
? = Not evaluated


Issues:
=======
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. No licenses
     found. Please check the source files for licenses manually.
See: http://fedoraproject.org/wiki/Packaging/LicensingGuidelines#ValidLicenseShortNames

[!]: Package functions as described.
See bugzilla for comment about the sysconfig file

[!]: Package consistently uses macro is (instead of hard-coded directory names
%post restorecon use /var/lib/ instrad of %_localstatedir as used before

[!]: Requires correct, justified where necessary.
Too much requires, as said in the review, and I would favor 
consistency over trying to have something leaner ( ie, it won't work
if not everybody does this ). I would also recommend to comment the
various Requires.

[!]: Package requires other packages for directories it uses.
/etc/stickshift/ is unowned 

[!]: Package must own all directories that it creates.
/etc/stickshift/ is unowned

[!]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.
(took the liberty of doing it : https://github.com/openshift/crankcase/pull/505 )

[!]: Hidden file or directory, seems rpmlint do not like this. That would
also solve the issue of having 1 single configuration file.

[!]: /etc/sysconfig/stickshift-proxy is a directory, while it would be more consistent to have
it be a file ( and that would fix bug where systemd file is not correctly opening the file, see earlier comment )
 
===== MUST items =====

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: Package successfully compiles and builds into binary rpms on at least one
     supported primary architecture.
[-]: %build honors applicable compiler flags or justifies otherwise.
[x]: All build dependencies are listed in BuildRequires, except for any that
     are listed in the exceptions section of Packaging Guidelines.
[x]: Package contains no bundled libraries.
[x]: Changelog in prescribed format.
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Sources contain only permissible code or content.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Each %files section contains %defattr if rpm < 4.4
[x]: Macros in Summary, %description expandable at SRPM build time.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[!]: Package requires other packages for directories it uses.
[x]: Package uses nothing in %doc for runtime.
[x]: Package is not known to require ExcludeArch.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[ ]: Package complies to the Packaging Guidelines
[x]: Spec file lacks Packager, Vendor, PreReq tags.
[-]: 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 is included in %doc.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. No licenses
     found. Please check the source files for licenses manually.
[!]: Package consistently uses macro is (instead of hard-coded directory
     names).
[x]: Package is named using only allowed ASCII characters.
[x]: Package is named according to the Package Naming Guidelines.
[x]: No %config files under /usr.
[x]: Package does not generate any conflict.
     Note: Package contains no Conflicts: tag(s)
[x]: Package do not use a name that already exist
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[!]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package installs properly.
[x]: Package is not relocatable.
[!]: Requires correct, justified where necessary.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: Sources used to build the package match the upstream source, as provided
     in the spec URL.
[x]: Spec file is legible and written in American English.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: Package contains systemd file(s) if in need.
[x]: File names are valid UTF-8.
[x]: Large documentation must go in a -doc subpackage.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[!]: If the source package does not include license text(s) as a separate file
     from upstream, the packager SHOULD query upstream to include it.
[x]: Dist tag is present.
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Final provides and requires are sane (rpm -q --provides and rpm -q
     --requires).
[!]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: The placement of pkgconfig(.pc) files are correct.
[x]: Scriptlets must be sane, if used.
[x]: SourceX tarball generation or download is documented.
[!]: SourceX / PatchY prefixed with %{name}.
     Note: Source0 (openshift-origin-port-proxy-0.2.3.tar.gz)
[x]: SourceX is a working URL.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed files.
[!]: Spec use %global instead of %define.
     Note: %define with_systemd 1 %define with_systemd 0

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.
[x]: Large data in /usr/share should live in a noarch subpackage if package is
     arched.


Rpmlint
-------
Checking: openshift-origin-port-proxy-0.2.3-1.fc17.src.rpm
          openshift-origin-port-proxy-0.2.3-1.fc17.noarch.rpm
openshift-origin-port-proxy.noarch: W: only-non-binary-in-usr-lib
openshift-origin-port-proxy.noarch: W: no-documentation
openshift-origin-port-proxy.noarch: W: non-conffile-in-etc /etc/sysconfig/stickshift-proxy/stickshift-proxy.env
openshift-origin-port-proxy.noarch: W: hidden-file-or-dir /var/lib/stickshift/.stickshift-proxy.d
openshift-origin-port-proxy.noarch: E: non-standard-dir-perm /var/lib/stickshift/.stickshift-proxy.d 0750L
openshift-origin-port-proxy.noarch: W: hidden-file-or-dir /var/lib/stickshift/.stickshift-proxy.d
openshift-origin-port-proxy.noarch: W: no-manual-page-for-binary stickshift-proxy-cfg
2 packages and 0 specfiles checked; 1 errors, 6 warnings.




Rpmlint (installed packages)
----------------------------
# rpmlint openshift-origin-port-proxy
openshift-origin-port-proxy.noarch: W: only-non-binary-in-usr-lib
openshift-origin-port-proxy.noarch: W: no-documentation
openshift-origin-port-proxy.noarch: W: non-conffile-in-etc /etc/sysconfig/stickshift-proxy/stickshift-proxy.env
openshift-origin-port-proxy.noarch: W: hidden-file-or-dir /var/lib/stickshift/.stickshift-proxy.d
openshift-origin-port-proxy.noarch: E: non-standard-dir-perm /var/lib/stickshift/.stickshift-proxy.d 0750L
openshift-origin-port-proxy.noarch: W: hidden-file-or-dir /var/lib/stickshift/.stickshift-proxy.d
openshift-origin-port-proxy.noarch: W: no-manual-page-for-binary stickshift-proxy-cfg
1 packages and 0 specfiles checked; 1 errors, 6 warnings.
# echo 'rpmlint-done:'



Requires
--------
openshift-origin-port-proxy-0.2.3-1.fc17.noarch.rpm (rpmlib, GLIBC filtered):
    
    /bin/bash  
    /bin/sh  
    config(openshift-origin-port-proxy) = 0.2.3-1.fc17
    coreutils  
    haproxy  
    initscripts  
    iproute  
    sed  
    systemd-units  
    util-linux-ng  



Provides
--------
openshift-origin-port-proxy-0.2.3-1.fc17.noarch.rpm:
    
    config(openshift-origin-port-proxy) = 0.2.3-1.fc17
    openshift-origin-port-proxy = 0.2.3-1.fc17



MD5-sum check
-------------
https://mirror.openshift.com/pub/openshift-origin/source/openshift-origin-port-proxy/openshift-origin-port-proxy-0.2.3.tar.gz :
  CHECKSUM(SHA256) this package     : 5984aa174e07c2ce44dd18d6b8f4ac3226743e016498c58c9897d7b450286385
  CHECKSUM(SHA256) upstream package : 5984aa174e07c2ce44dd18d6b8f4ac3226743e016498c58c9897d7b450286385


Generated by fedora-review 0.2.0 (Unknown) last change: Unknown
Command line :./try-fedora-review -b 854764
Comment 9 Rob Millner 2012-09-20 14:09:16 EDT
>  IMHO, it would be better to have /etc/sysconfig/stickshift-proxy be a 
> file rather than be a directory with a file in it ( more consistent ).

> [!]: Package functions as described.
> See bugzilla for comment about the sysconfig file


This has been fixed in master and should show up in the next package revision.
Comment 10 Rob Millner 2012-09-20 14:39:56 EDT
Pull request to cover the following issues:
[!]: Package consistently uses macro is (instead of hard-coded directory names
[!]: Requires correct, justified where necessary.
[!]: Package requires other packages for directories it uses.


https://github.com/openshift/crankcase/pull/512
Comment 11 Rob Millner 2012-09-20 15:25:37 EDT
The pull request has been updated to resolve the following issue:
[!]: Hidden file or directory, seems rpmlint do not like this. That would

https://github.com/openshift/crankcase/pull/512
Comment 12 Adam Miller 2012-09-25 13:11:54 EDT
Spec URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy.spec
SRPM URL: http://maxamillion.fedorapeople.org/openshift-origin-port-proxy-0.3.3-1.fc17.src.rpm

I updated to latest upstream which includes the patches referenced above as well as updated the Requires: as per recommendations.
Comment 13 Michael Scherer 2012-10-15 15:13:59 EDT
%post
/sbin/restorecon %{_sharedstatedir}/stickshift/.stickshift-proxy.d/ || :

is no longer needed. In fact the spec on fedora people is not the same as the one in git, so if you update with the patch in git, it should be ok.
Comment 15 Michael Scherer 2012-10-16 11:41:52 EDT
The package was approved yesterday, so you can already ask for git repo
Comment 16 Adam Miller 2012-10-16 11:42:54 EDT
oh, awesome! thanks :)
Comment 17 Adam Miller 2012-10-16 11:44:35 EDT
New Package SCM Request
=======================
Package Name: openshift-origin-port-proxy
Short Description: Script to configure HAProxy to do port forwarding for OpenShift Origin
Owners: maxamillion tdawson
Branches: f17 f18
Comment 18 Jon Ciesla 2012-10-16 12:18:32 EDT
Git done (by process-git-requests).
Comment 19 Fedora Update System 2012-11-29 18:10:22 EST
openshift-origin-port-proxy-1.1.1-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openshift-origin-port-proxy-1.1.1-2.fc18
Comment 20 Fedora Update System 2012-11-30 01:41:20 EST
openshift-origin-port-proxy-1.1.1-2.fc18 has been pushed to the Fedora 18 testing repository.
Comment 21 Fedora Update System 2012-12-07 23:27:01 EST
openshift-origin-port-proxy-1.1.1-2.fc18 has been pushed to the Fedora 18 stable repository.

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