Bug 651898 - Review Request: rubygem-activemodel - A toolkit for building modeling frameworks
Summary: Review Request: rubygem-activemodel - A toolkit for building modeling frameworks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mo Morsi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-10 15:19 UTC by Jozef Zigmund
Modified: 2011-02-03 12:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-03 12:46:38 UTC
mmorsi: fedora-review+
notting: fedora-cvs+


Attachments (Terms of Use)
ActiveModel mock build output (9.00 KB, application/octet-stream)
2011-01-31 14:17 UTC, Vít Ondruch
no flags Details

Description Jozef Zigmund 2010-11-10 15:19:28 UTC
Spec URL: http://people.redhat.com/jzigmund/rubygem-activemodel.spec
SRPM URL: http://people.redhat.com/jzigmund/rubygem-activemodel-3.0.1-1.fc13.src.rpm
Description: Rich support for attributes, callbacks, validations, observers,
serialization, internationalization, and testing. It provides a known
set of interfaces for usage in model classes. It also helps building
custom ORMs for use outside of the Rails framework.

Comment 1 Mamoru TASAKA 2010-11-10 18:58:30 UTC
Would you please verify beforehand if the binary rpms built
from your srpm can really be installed with rpms already available
on Fedora and rpms currently in review request queue so that we
can actually review your srpm?

- rawhide rubygem-activesupport is currently still 2.3.8
- rubygem-i18n is not available on Fedora

Comment 2 Jozef Zigmund 2010-11-11 12:08:21 UTC
(In reply to comment #1)
> Would you please verify beforehand if the binary rpms built
> from your srpm can really be installed with rpms already available
> on Fedora and rpms currently in review request queue so that we
> can actually review your srpm?
> 
> - rawhide rubygem-activesupport is currently still 2.3.8
> - rubygem-i18n is not available on Fedora

I've made review request for i18n (https://bugzilla.redhat.com/show_bug.cgi?id=652216) and also I've contacted maintainer of rubygem-activesupport about updating to the newest version (https://bugzilla.redhat.com/show_bug.cgi?id=361201#c10).

Comment 3 Mo Morsi 2011-01-19 04:07:09 UTC
rubygem-i18n has now made it into fedora and I've update rubygem-activesupport to version 3.0.3 which will be pushed into fedora as soon as it's dependencies are.

For now use the following for this review

http://mo.morsi.org/files/rpms/rubygem-activesupport-3.0.3-1.fc14.src.rpm

* please update to latest activemodel upstream release, 3.0.3

* rpmlint looks good

* mark README, LICENSE, CHANGELOG files as %doc

* you do not need rm -rf %{buildroot} in %install and %clean sections (should be removed)

* feel free to tar up upstream test suite and run in in a %check section

* feel free to move docs into their own subpackage

Comment 4 Vít Ondruch 2011-01-26 08:52:43 UTC
I am taking over this package (right Jozef?).

So here is updated package:

Spec URL: http://people.redhat.com/vondruch/rubygem-activemodel.spec
SRPM URL: http://people.redhat.com/vondruch/rubygem-activemodel-3.0.3-1.fc14.src.rpm


(In reply to comment #3)
> rubygem-i18n has now made it into fedora and I've update rubygem-activesupport
> to version 3.0.3 which will be pushed into fedora as soon as it's dependencies
> are.
> 
> For now use the following for this review
> 
> http://mo.morsi.org/files/rpms/rubygem-activesupport-3.0.3-1.fc14.src.rpm
> 
> * please update to latest activemodel upstream release, 3.0.3

DONE
 
> * rpmlint looks good
> 
> * mark README, LICENSE, CHANGELOG files as %doc

DONE

> * you do not need rm -rf %{buildroot} in %install and %clean sections (should
> be removed)

Removed from install section. Left in %clean section. If you remove it, then the activemode directory stays in BUILDROOT, which is not nice, although it doesn't make any problems.

I should remember this and be consistent ...

 
> * feel free to tar up upstream test suite and run in in a %check section

DONE

> * feel free to move docs into their own subpackage

DONE

I do not provide the Koji build due to missing activesupport dependency. However if approved, I can already prepare the repository.

Comment 5 Mo Morsi 2011-01-26 21:46:06 UTC
(In reply to comment #4)
> I am taking over this package (right Jozef?).
> 
> So here is updated package:
> 
> Spec URL: http://people.redhat.com/vondruch/rubygem-activemodel.spec
> SRPM URL:
> http://people.redhat.com/vondruch/rubygem-activemodel-3.0.3-1.fc14.src.rpm
> 
<snip>
> 
> I do not provide the Koji build due to missing activesupport dependency.
> However if approved, I can already prepare the repository.

I tried to build in a F14 x86_64 mock environment w/ the activesupport 3.0.3 rpm and its dependencies installed but failed. I get to the point the tests are run, which then fail with

/home/mmorsi/rpmbuild/BUILDROOT/rubygem-activemodel-3.0.3-1.fc14.x86_64/usr/lib/ruby/gems/1.8/gems/activemodel-3.0.3/lib/active_model.rb:26:in `require': no such file to load -- active_support (LoadError)
	from /home/mmorsi/rpmbuild/BUILDROOT/rubygem-activemodel-3.0.3-1.fc14.x86_64/usr/lib/ruby/gems/1.8/gems/activemodel-3.0.3/lib/active_model.rb:26


There is a runtime dependency for bundler, the thing is I don't see a Gemfile nor any other bundler specific code, so I'm wondering if this was a mistake. If so it looks like activemodel-3.0.3/lib/active_model.rb will have to be patched to require 'rubygems' instead of trying to load active_support via a hard coded relative path. To start off I believe these changes are needed

$  diff rpmbuild/SPECS/rubygem-activemodel.spec.orig rpmbuild/SPECS/rubygem-activemodel.spec
18a19
> Patch0: activemodel-require-rubygems.patch
25a27,28
> BuildRequires: rubygem(i18n) => 0.4.2
> BuildRequires: rubygem(builder)
44a48,54
> %setup -q -c -T
> mkdir -p .%{gemdir}
> gem install --local --install-dir .%{gemdir} \
>             --force -V --rdoc %{SOURCE0}
> 
> pushd .%{geminstdir}
> %patch0 -p0
50,51c60
< gem install --local --install-dir %{buildroot}%{gemdir} \
<             --force --rdoc %{SOURCE0}
---
> cp -a .%{gemdir}/* %{buildroot}%{gemdir}


$ cat rpmbuild/SOURCES/activemodel-require-rubygems.patch 
--- lib/active_model.rb.orig	2011-01-26 16:27:30.353187058 -0500
+++ lib/active_model.rb	2011-01-26 16:27:39.500187210 -0500
@@ -21,8 +21,9 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #++
 
-activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
-$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
+#activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
+#$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
+require 'rubygems'
 require 'active_support'
 require 'active_model/version'

The things is even with this patchset applied the test suite doesn't pass, and results in alot of errors, such as

"NoMethodError: undefined method `expects' for ..."
"NoMethodError: undefined local variable or method `stub' for ..."

I didn't extensively debug, my guess is one of the required testing frameworks isn't being loaded / included properly.

To test this you will need activesupport 3.0.3, and for that you will need rubygem rdoc and memcache-client. You can build these rpms from the srpms submitted to Fedora. Also I would really appreciate a review for either or both of these to assist this process (added as blockers).

Comment 6 Vít Ondruch 2011-01-31 14:17:07 UTC
Created attachment 476194 [details]
ActiveModel mock build output

Comment 7 Vít Ondruch 2011-01-31 14:17:29 UTC
Updates package files:

Spec URL: http://people.redhat.com/vondruch/rubygem-activemodel.spec
SRPM URL:
http://people.redhat.com/vondruch/rubygem-activemodel-3.0.3-2.fc14.src.rpm

I have added the dependencies (mocha was the one which was missing to pass the test suite) and updated the test suite execution command to require rubygems, therefore no patching is necessary. The rubygems are later required internally anyway.

I have tested in mock for F14 and Rawhide. See the attached activemodel-mock.log

Comment 8 Mo Morsi 2011-01-31 19:35:56 UTC
Everything looks good

APPROVED

Also removed the rdoc blocker as I was mistaken it is not an activesupport 3.0.3 dependency.

Comment 9 Vít Ondruch 2011-02-01 09:33:49 UTC
Thank you for your review!

New Package SCM Request
=======================
Package Name: rubygem-activemodel
Short Description: A toolkit for building modeling frameworks
Owners: vondruch
Branches: 
InitialCC:

Comment 10 Mo Morsi 2011-02-02 20:09:50 UTC
Removing the memcache dependency as it is only an activesupport build time dep, and I have a patch removing the test cases which rely on memcache. Will be pushing activesupport 3.0.3 with this patch later today and removing the patch when memcache is pushed to Fedora.

Comment 11 Bill Nottingham 2011-02-02 22:30:09 UTC
Git done (by process-git-requests).


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