[katello-devel] Experience contributing a new feature as a user

Og Maciel omaciel at redhat.com
Tue Aug 14 15:27:52 UTC 2012


A couple of weeks ago I decided to implement a new feature to the user create cli method: provide a default locale for the user being created. The use case is: as an administrator I want to create multiple user accounts from the cli and specify their default locale for the web interface. The pull request went in (https://github.com/Katello/katello/pull/436) and after a couple of very useful comments, I made the necessary changes based on this feedback. So far so good. Then I was asked to write tests for my changes... sure, why not? After spending some time learning how cli tests are performed and getting some pointers from someone, I took a stab at adding to the minimalistic cli tests we currently have for user creation.Great, right? Another round of feedback, and this time I was asked to write rspec tests... oy! So I brushed up my rspec (I'm a python guy mind you) and wrote a very quick and dirty "proof of concept" test and tried to run it... but was stuck with several dependency errors... bundle install should bail me out, right? No! At the end of a very painful cycle of gem install this, try again, fail, repeat, I got stuck with a dependency (pg gem btw) which would not install cleanly. I turned for help on #katello and to make a long story short, was told that it would be easier to do this if I had katello installed! Ok, I decided to take a few hours break and returned to this task again today... here's what I did:

# git clone https://github.com/Katello/katello.git
# cd katello/src/
# bundle install
Fetching source index for http://repos.fedorapeople.org/repos/katello/gems/
Could not find gem 'apipie-rails (>= 0)' in any of the gem sources listed in your Gemfile.

Oh... I remember Ivan sent an email about this... I should be able to gem install it...

# gem install redcarpet
Fetching: redcarpet-2.1.1.gem (100%)
Building native extensions.  This could take a while...

ERROR:  Error installing redcarpet:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h

Ohhh I need ruby-devel too

# yum -y install ruby-devel
# gem install redcarpet
Building native extensions.  This could take a while...

..
ERROR:  Error installing redcarpet:
	ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
creating Makefile

make
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I.   -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing  -fPIC   -c buffer.c
make: gcc: Command not found
make: *** [buffer.o] Error 127

Sigh...

# yum -y install gcc
# gem install redcarpet
# bundle install
Fetching source index for http://repos.fedorapeople.org/repos/katello/gems/
Could not find gem 'apipie-rails (>= 0)' in any of the gem sources listed in your Gemfile.

Back to square 1!

My point for this email is not to blame anyone but to ask the following question: how can we make it easier for people to contribute to katello without having to jump through endless hoops???

Cheers,
-- 
Og Maciel

Senior QA Engineer
Red Hat, Inc.
+1.919.754.4782
irc: omaciel




More information about the katello-devel mailing list