Contributing to foreman

So I'm trying to contribute a patch to foreman and ran across
http://theforeman.org/projects/foreman/wiki/Contribute

However I am having issues getting this to work.

I've cloned the repo locally, made my changes, and committed it. I'm now
to the point of running 'rake mail_patches' and get the following:

$ rake mail_patches --trace
rake aborted!
No such file or directory - foreman/config/settings.yaml
/usr/lib/ruby/1.8/yaml.rb:143:in initialize' /usr/lib/ruby/1.8/yaml.rb:143:inopen'
/usr/lib/ruby/1.8/yaml.rb:143:in load_file' foreman/config/boot.rb:5 foreman/config/application.rb:1:inrequire'
foreman/config/application.rb:1
foreman/Rakefile:1:in require' foreman/Rakefile:1 /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:inload'
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in load_rakefile' /usr/lib/ruby/vendor_ruby/rake/application.rb:501:inraw_load_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:82:in load_rakefile' /usr/lib/ruby/vendor_ruby/rake/application.rb:133:instandard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:81:in load_rakefile' /usr/lib/ruby/vendor_ruby/rake/application.rb:65:inrun'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in
standard_exception_handling' /usr/lib/ruby/vendor_ruby/rake/application.rb:63:inrun'
/usr/bin/rake:27

So I copied the settings.yaml.example file to settings.yaml and tried again
and now get:

$ rake mail_patches --trace
no such file to load – bundler
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in
gem_original_require' /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:inrequire'
foreman/config/boot.rb:13
foreman/config/application.rb:1:in require' foreman/config/application.rb:1 foreman/Rakefile:1:inrequire'
foreman/Rakefile:1
/usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in load' /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:inload_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:501:in raw_load_rakefile' /usr/lib/ruby/vendor_ruby/rake/application.rb:82:inload_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:133:in
standard_exception_handling' /usr/lib/ruby/vendor_ruby/rake/application.rb:81:inload_rakefile'
/usr/lib/ruby/vendor_ruby/rake/application.rb:65:in run' /usr/lib/ruby/vendor_ruby/rake/application.rb:133:instandard_exception_handling'
/usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run'
/usr/bin/rake:27

It seems like I'm being asked to setup the dependencies as if I was
actually trying to run foreman, but all I want to do is submit this patch
to the dev list. Any tips? Or is there a newer way of handling this? I
don't mind updating the wiki once I get this figured out.

Thanks!
Jake

Would rather use github! :slight_smile: … just never used it before
(only perused it). This is a good excuse to finally get exposed to it!

But it seems like the Contribute page should be updated with instructions
for people who want to take the github path.

And it seems mail_patches should either be fixed (the issues I ran into
seems like a bug to me) or removed in favor of using github, which seems
most are using github and probably better just to get new people to start
using that immediately.

Thanks for all the help. I'll give this a whirl and let you guys know if I
run into anything else.
Jake

So I used Brian's model as a starting point and ended up getting a pull
request created!

In the ended I ended up doing something like:

Fork theforeman/foreman to personal github account
Clone personal foreman fork to local system
Create a feature/topic branch
Make changes and commit
Push topic branch to your fork
Issue a pull request

I've updated the foreman wiki with this. Make changes as you see fit!

Thanks everyone!
Jake

Updated
http://theforeman.org/projects/foreman/wiki/Contribute#Submit-Patches

Thanks!
Jake

No problem. Is the new topic about how the github process is documented,
or the actual commit to address 1656? Just so I know what kind of thread
to create. :wink:

Thanks,
Jake

··· On Friday, June 8, 2012 8:37:44 AM UTC-5, jmccann wrote: > > So I'm trying to contribute a patch to foreman and ran across > http://theforeman.org/projects/foreman/wiki/Contribute > > However I am having issues getting this to work. > > I've cloned the repo locally, made my changes, and committed it. I'm now > to the point of running 'rake mail_patches' and get the following: > > $ rake mail_patches --trace > rake aborted! > No such file or directory - foreman/config/settings.yaml > /usr/lib/ruby/1.8/yaml.rb:143:in `initialize' > /usr/lib/ruby/1.8/yaml.rb:143:in `open' > /usr/lib/ruby/1.8/yaml.rb:143:in `load_file' > foreman/config/boot.rb:5 > foreman/config/application.rb:1:in `require' > foreman/config/application.rb:1 > foreman/Rakefile:1:in `require' > foreman/Rakefile:1 > /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load' > /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in > `standard_exception_handling' > /usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run' > /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in > `standard_exception_handling' > /usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run' > /usr/bin/rake:27 > > So I copied the settings.yaml.example file to settings.yaml and tried > again and now get: > > $ rake mail_patches --trace > no such file to load -- bundler > /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in > `gem_original_require' > /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' > foreman/config/boot.rb:13 > foreman/config/application.rb:1:in `require' > foreman/config/application.rb:1 > foreman/Rakefile:1:in `require' > foreman/Rakefile:1 > /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load' > /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in > `standard_exception_handling' > /usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile' > /usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run' > /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in > `standard_exception_handling' > /usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run' > /usr/bin/rake:27 > > It seems like I'm being asked to setup the dependencies as if I was > actually trying to run foreman, but all I want to do is submit this patch > to the dev list. Any tips? Or is there a newer way of handling this? I > don't mind updating the wiki once I get this figured out. > > Thanks! > Jake >

I've not used the rake task in a while, so I can't advise on that.
However, if you have a GitHub account, fork theforeman/foreman.git,
commit your patch and then click the Pull Request button at the top of
your repo.

HTH,
Greg

··· On 08/06/12 14:37, jmccann wrote: > So I'm trying to contribute a patch to foreman and ran across > http://theforeman.org/projects/foreman/wiki/Contribute

I'll see if I can figure that out! :stuck_out_tongue:

Does that then also mail the foreman-dev group, or do I need to do that
manually or is that step not needed anymore?

Thanks,
Jake

··· On Friday, June 8, 2012 9:05:43 AM UTC-5, Greg Sutcliffe wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 08/06/12 14:37, jmccann wrote: > > So I'm trying to contribute a patch to foreman and ran across > > http://theforeman.org/projects/foreman/wiki/Contribute > > I've not used the rake task in a while, so I can't advise on that. > However, if you have a GitHub account, fork theforeman/foreman.git, > commit your patch and then click the Pull Request button at the top of > your repo. > > HTH, > Greg > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.19 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk/SBrcACgkQ8O7RN8oK65MKtwCbByt522eemDOdJTzgVHzvep6q > rF8AnjnmgSWnwHr/AwWe43U1TGU+q8Bc > =hmOW > -----END PGP SIGNATURE----- >

Let me add, a github workflow that I am now using.

  1. Fork the foreman repo to your account
  2. Clone the repo to your local workspace (Your fork wil be origin)
  3. Setup theforeman repo as "upsteam"
  4. create a local topic branch for your patch.
  5. Push the topic branch to your Fork
  6. Make your commits to the topic branch
  7. Issue a pull request

Please note that you can always rebase your forked develop branch on
upstream, and start new topic branches based on develop, even if you
haven't had your pull request committed. Please also be aware that any
commits to a branch that has an open pull request get added to the
pull request, so take care to switch to a new branch if you are
working on something new.

Please feel free to shoot over any questions as they come up.

Thanks,
Brian

P.S. - Feel free to move the conversation to foreman-dev.

··· On Fri, Jun 8, 2012 at 10:23 AM, jmccann wrote: > I'll see if I can figure that out! :P > > Does that then also mail the foreman-dev group, or do I need to do that > manually or is that step not needed anymore? > > Thanks, > Jake > > > On Friday, June 8, 2012 9:05:43 AM UTC-5, Greg Sutcliffe wrote: >> >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> On 08/06/12 14:37, jmccann wrote: >> > So I'm trying to contribute a patch to foreman and ran across >> > http://theforeman.org/projects/foreman/wiki/Contribute >> >> I've not used the rake task in a while, so I can't advise on that. >> However, if you have a GitHub account, fork theforeman/foreman.git, >> commit your patch and then click the Pull Request button at the top of >> your repo. >> >> HTH, >> Greg >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v2.0.19 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >> >> iEYEARECAAYFAk/SBrcACgkQ8O7RN8oK65MKtwCbByt522eemDOdJTzgVHzvep6q >> rF8AnjnmgSWnwHr/AwWe43U1TGU+q8Bc >> =hmOW >> -----END PGP SIGNATURE----- > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/TjJ-kbGZNYYJ. > > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

Jake,

Once you are familiar with the Github process, feel free to update the
Contribute page. :wink:

Cheers,
Brian

··· On Fri, Jun 8, 2012 at 11:18 AM, jmccann wrote: > Would rather use github! :) ... just never used it before (only perused it). > This is a good excuse to finally get exposed to it! > > But it seems like the Contribute page should be updated with instructions > for people who want to take the github path. > > And it seems mail_patches should either be fixed (the issues I ran into > seems like a bug to me) or removed in favor of using github, which seems > most are using github and probably better just to get new people to start > using that immediately. > > Thanks for all the help. I'll give this a whirl and let you guys know if I > run into anything else. > Jake > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/Okg6nSvNB-YJ. > > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

Thanks Jake! We should move this conversation to the foreman-dev
google group. Can you please register and repost the link to the pull
request there, as I do have some comments.

-Brian

··· On Fri, Jun 8, 2012 at 12:00 PM, jmccann wrote: > Updated > http://theforeman.org/projects/foreman/wiki/Contribute#Submit-Patches > > Thanks! > Jake > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/93qn--byiIYJ. > > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

Well typically, I email -dev with any pull requests I want reviewed,
since not everyone gets the github pull request notifications.

In this case I have particular comments about that section of code.
(not so much your commit, as it largely follows the assumptions made
in the past. These are assumptions that I want to question. IE: 1000
vs 1024).

··· On Fri, Jun 8, 2012 at 12:07 PM, jmccann wrote: > No problem. Is the new topic about how the github process is documented, or > the actual commit to address 1656? Just so I know what kind of thread to > create. ;) > > Thanks, > Jake > > > On Friday, June 8, 2012 8:37:44 AM UTC-5, jmccann wrote: >> >> So I'm trying to contribute a patch to foreman and ran >> across http://theforeman.org/projects/foreman/wiki/Contribute >> >> However I am having issues getting this to work. >> >> I've cloned the repo locally, made my changes, and committed it. I'm now >> to the point of running 'rake mail_patches' and get the following: >> >> $ rake mail_patches --trace >> rake aborted! >> No such file or directory - foreman/config/settings.yaml >> /usr/lib/ruby/1.8/yaml.rb:143:in `initialize' >> /usr/lib/ruby/1.8/yaml.rb:143:in `open' >> /usr/lib/ruby/1.8/yaml.rb:143:in `load_file' >> foreman/config/boot.rb:5 >> foreman/config/application.rb:1:in `require' >> foreman/config/application.rb:1 >> foreman/Rakefile:1:in `require' >> foreman/Rakefile:1 >> /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load' >> /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in >> `standard_exception_handling' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in >> `standard_exception_handling' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run' >> /usr/bin/rake:27 >> >> So I copied the settings.yaml.example file to settings.yaml and tried >> again and now get: >> >> $ rake mail_patches --trace >> no such file to load -- bundler >> /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in >> `gem_original_require' >> /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require' >> foreman/config/boot.rb:13 >> foreman/config/application.rb:1:in `require' >> foreman/config/application.rb:1 >> foreman/Rakefile:1:in `require' >> foreman/Rakefile:1 >> /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load' >> /usr/lib/ruby/vendor_ruby/rake/rake_module.rb:25:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:501:in `raw_load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:82:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in >> `standard_exception_handling' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:81:in `load_rakefile' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:65:in `run' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:133:in >> `standard_exception_handling' >> /usr/lib/ruby/vendor_ruby/rake/application.rb:63:in `run' >> /usr/bin/rake:27 >> >> It seems like I'm being asked to setup the dependencies as if I was >> actually trying to run foreman, but all I want to do is submit this patch to >> the dev list. Any tips? Or is there a newer way of handling this? I don't >> mind updating the wiki once I get this figured out. >> >> Thanks! >> Jake > > -- > You received this message because you are subscribed to the Google Groups > "Foreman users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/foreman-users/-/WntuKUEyH1UJ. > > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to > foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/foreman-users?hl=en.

Pull requests are automatically sent to the foreman development team
on GitHub. If you feel the patch should have wider viewing/discussion,
send a link to the pull request to the -dev list.

I'm sure Ohad will be able to advise on the rake mail_patches problem
if you'd rather not use GitHub :slight_smile:

Greg


OpenPGP -> KeyID: CA0AEB93

··· On 08/06/12 15:23, jmccann wrote: > I'll see if I can figure that out! :P > > Does that then also mail the foreman-dev group, or do I need to do > that manually or is that step not needed anymore?