Bug 580169

Summary: Review Request: loggerhead - Web viewer for the Bazaar version control system
Product: [Fedora] Fedora Reporter: Toshio Ernie Kuratomi <a.badger>
Component: Package ReviewAssignee: Terje Røsten <terje.rosten>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: fedora-package-review, notting, terje.rosten
Target Milestone: ---Flags: terje.rosten: fedora-review+
kevin: 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: 2010-06-14 16:24:50 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 Toshio Ernie Kuratomi 2010-04-07 15:59:29 UTC
Spec URL: http://toshio.fedorapeople.org/packages/loggerhead.spec
SRPM URL: http://toshio.fedorapeople.org/packages/loggerhead-1.17-1.fc12.src.rpm
Description:

Loggerhead is a WSGI app that provides a web interface to the Bazaar version
control system.  It can be used to navigate a branch history, view who
changed lines in a file, look at patches, and perform searches.

Scratch build: http://koji.fedoraproject.org/koji/taskinfo?taskID=2099900

Comment 1 Terje Røsten 2010-04-07 18:58:10 UTC
README.mod_wsgi seems wrong, there are no /etc/bazaar.conf in the package.

In loggerhead.conf, is it right to comment out this line

#Alias /bzr/static /usr/share/loggerhead/static

Is this line correct:
 
 WSGIScriptAlias /bzr /var/www/cgi-bin/loggerhead.wsgi


About the spec file:

 cp -p %{SOURCE4} %{buildroot}/%{_bindir}/

use install command here and drop %attr in %files.

mkdir -p %{buildroot}/%{_sysconfdir}/loggerhead/
cp -p %{SOURCE3} %{buildroot}/%{_sysconfdir}/loggerhead/

more simple and robust:

install -D -m 0644 -p %{SOURCE3} %{buildroot}/%{_sysconfdir}/loggerhead/bazaar.conf


%attr(0755,root,root) %{_bindir}/*
%{_mandir}/man1/*

Explicit please.

%{python_sitelib}/bzrlib/plugins/*

Ditto

Comment 2 Toshio Ernie Kuratomi 2010-04-08 04:44:03 UTC
(In reply to comment #1)
> README.mod_wsgi seems wrong, there are no /etc/bazaar.conf in the package.
> 
Fixed.  Now says: /etc/loggerhead/bazaar.conf.

> In loggerhead.conf, is it right to comment out this line
> 
> #Alias /bzr/static /usr/share/loggerhead/static
>
Uncommented.  This was broken earlier but I fixed the root cause so it works now.
 
> Is this line correct:
> 
>  WSGIScriptAlias /bzr /var/www/cgi-bin/loggerhead.wsgi
> 
Also a good catch.  Changed to /usr/bin/loggerhead.wsgi

> 
> About the spec file:
> 
>  cp -p %{SOURCE4} %{buildroot}/%{_bindir}/
> 
> use install command here and drop %attr in %files.
> 
> mkdir -p %{buildroot}/%{_sysconfdir}/loggerhead/
> cp -p %{SOURCE3} %{buildroot}/%{_sysconfdir}/loggerhead/
> 
> more simple and robust:
> 
> install -D -m 0644 -p %{SOURCE3}
> %{buildroot}/%{_sysconfdir}/loggerhead/bazaar.conf
>
Done.  Though I've noticed that you've made a point of asking people to change cp to install several times.  This is not a guideline and there are times when it doesn't make sense:
  https://www.redhat.com/archives/fedora-extras-list/2005-May/msg00452.html

> 
> %attr(0755,root,root) %{_bindir}/*
> %{_mandir}/man1/*
> 
> Explicit please.
> 
> %{python_sitelib}/bzrlib/plugins/*
> 
> Ditto    

Implicit is unavoidable without jumping through hoops (Every directory listed in %files is an implicit wildcard), isn't a guideline, and doesn't have an overwhelming benefit.

SRPM: http://toshio.fedorapeople.org/packages/loggerhead-1.17-2.fc12.src.rpm
SPEC: http://toshio.fedorapeople.org/packages/loggerhead.spec
Scratch Build: http://koji.fedoraproject.org/koji/taskinfo?taskID=2101972

* Wed Apr 07 2010 Toshio Kuratomi <toshio> - 1.17-2
- Fix comments in review.
- Fix a traceback for the download and diff ui pages.

Comment 3 Terje Røsten 2010-04-08 05:51:43 UTC
Thinking about mod_wsgi, it get it work some steps needed feels like should be done by the package itself (e.g. moving files to correct location).

I might be a good idea to create logggerhead-mod_wsgi subpackage with files
in correct location and add deps on mod_wsgi. Comments?

Comment 4 Terje Røsten 2010-04-08 08:59:41 UTC
I can't get it to work properly, these lines in loggerhead.wsgi:

prefix = config.get_option('user_prefix') or ''
root_dir = bzrconfig.GlobalConfig().get_user_option('http_root_dir')

don't find any config.

I am running under Apache httpd under apache user:

apache:x:48:490:Apache:/var/www:/sbin/nologin

The config file is there:

$ namei /var/www/.bazaar/bazaar.conf
f: /var/www/.bazaar/bazaar.conf
 d /
 d var
 d www
 l .bazaar -> /etc/loggerhead/
   d /
   d etc
   d loggerhead
 - bazaar.conf

$ cat /etc/loggerhead/bazaar.conf
# directory to serve bzr branches from
# Non-bzr directories under this path will also be visible in loggerhead
http_root_dir = '/export/bzr'

# The url prefix for the bzr branches.
http_user_prefix = '/bzr'

bzr-2.0.3.


If I just modify loggerhead.wsgi and sets correct prefix and root_dir it works fine.

Would be good if the Download Diff link e.g.:

http://localhost/bzr/TestLoggerhead/diff/4

used text/plain and not application/octet-stream as content-type.

Comment 5 Terje Røsten 2010-04-08 11:17:21 UTC
> If I just modify loggerhead.wsgi and sets correct prefix and root_dir it works
> fine.
> 
> Would be good if the Download Diff link e.g.:
> 
> http://localhost/bzr/TestLoggerhead/diff/4
> 
> used text/plain and not application/octet-stream as content-type.    

Drop that, from the code I see "Content-Disposition: attachment;"
changing to text/plain would not help. 

What I want is "See Raw Diff" button with text/plain output. 
Guess that is a request for upstream.

Comment 6 Toshio Ernie Kuratomi 2010-04-08 19:38:19 UTC
(In reply to comment #3)
> Thinking about mod_wsgi, it get it work some steps needed feels like should be
> done by the package itself (e.g. moving files to correct location).
> 
> I might be a good idea to create logggerhead-mod_wsgi subpackage with files
> in correct location and add deps on mod_wsgi. Comments?    

I thought about doing this but decided not to -- the files that must be moved into position are sample configuration files so there is precedent for having people create those in order to start a service.  The act of moving the files into place causes the service to start which is something that we try to avoid for services other than web apps.  The mod_wsgi scripts are not upstream yet.  The service can be a dislcosure hazard as it will show regular files and directories as well as bzr branches.

Pros of doing this: You get deps for mod_wsgi.  The last problem, I think I've mitigated by making the config file not point to a http_path by default.  We could add a comment in the loggerhead/bazaar.conf file that the /etc/httpd/conf.d/loggerhead.conf file needs to be changed as well.

So I'm leaning towards not doing this... at least until the mod_wsgi script gets integrated upstream but the major blockers have been dealt with.

Comment 7 Toshio Ernie Kuratomi 2010-04-08 19:41:09 UTC
(In reply to comment #4)
> I can't get it to work properly, these lines in loggerhead.wsgi:
> 
> prefix = config.get_option('user_prefix') or ''
> root_dir = bzrconfig.GlobalConfig().get_user_option('http_root_dir')
> 
> don't find any config.
> 
Is it a permissions issue?  Maybe selinux?  It's working here on F12 but I have SELinux turned to permissive.  If it is SELinux we can figure out what labeling needs to change to allow it to work.

And yes, the diff thing would be an upstream change, not a Fedora packaging change.

Comment 8 Terje Røsten 2010-04-10 12:28:46 UTC
ok rpmlint (a warning which can be ignored)
    loggerhead.noarch: W: hidden-file-or-dir /var/www/.bazaar
    2 packages and 0 specfiles checked; 0 errors, 1 warnings.
ok spec file, change these to full names if you want.
   %{_bindir}/*
   %{_mandir}/man1/*
ok name and naming
ok patches upstream
ok license is valid and set correct, some files don't have license info
    (controllers/filediff_ui.py , controllers/revlog_ui.py,
     middleware/profile.py, apps/config.py , apps/__init__.py
     tests/*.py) Please consider to notify upstream about this issue.
ok lang
ok dirs, perms and owns
ok tarball
    cdddaf4497bb9632f9c9ea90b4713c09  loggerhead-1.17.tar.gz
    cdddaf4497bb9632f9c9ea90b4713c09  loggerhead-1.17.tar.gz.spec
ok koji build
    http://koji.fedoraproject.org/koji/taskinfo?taskID=2107537

ok function, serve-branches seems to work ok. 
    I can't get mod_wsgi to load config (no selinux), 
    I get this in the log:

mod_wsgi (pid=18927): Target WSGI script '/usr/bin/loggerhead.wsgi' cannot be loaded as Python module.
 mod_wsgi (pid=18927): Exception occurred processing WSGI script '/usr/bin/loggerhead.wsgi'.
 Traceback (most recent call last):
   File "/usr/bin/loggerhead.wsgi", line 28, in <module>
     {'user': pwd.getpwuid(os.geteuid()).pw_name})
 NotConfiguredError: You must have a ~/.bazaar/bazaar.conf file for apache with http_root_dir set to the base directory you want to serve bazaar repositories from

mod_wgsi being optional and not default enabled I don't fine any more issues and the package loggerhead is APPROVED.

Comment 9 Toshio Ernie Kuratomi 2010-04-10 17:28:38 UTC
New Package CVS Request
=======================
Package Name: loggerhead
Short Description: Web viewer for the Bazaar version control system
Owners: toshio hno
Branches: F-11 F-12 F-13 EL-5
InitialCC:

Comment 10 Toshio Ernie Kuratomi 2010-04-10 18:27:30 UTC
I've added a %post script that labels the /etc/loggerhead/bazaar.conf file in the latest version.  I'll ask dwalsh what the proper way to apply these labels in the future is.

http://toshio.fedorapeople.org/packages/loggerhead-1.17-4.fc12.src.rpm

Comment 11 Kevin Fenzi 2010-04-11 19:20:23 UTC
CVS done (by process-cvs-requests.py).

Comment 12 Fedora Update System 2010-04-13 00:51:43 UTC
loggerhead-1.17-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/loggerhead-1.17-4.fc13

Comment 13 Fedora Update System 2010-04-14 01:35:06 UTC
loggerhead-1.17-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update loggerhead'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/loggerhead-1.17-4.fc13

Comment 14 Terje Røsten 2010-06-14 10:25:37 UTC
Why is this ticket still on ON_QA? 

The package have been pushed to stable several weeks ago?

Comment 15 Toshio Ernie Kuratomi 2010-06-14 16:24:50 UTC
Looks like bodhi didn't close it... Closing now.