Re: [Spacewalk-devel] Newbie trying to test my code changes
On Mon, Nov 11, 2013 at 1:36 PM, Austin Lavinghouse wrote: > On Mon, Nov 11, 2013 at 1:23 PM, Stephen Herr wrote: >> Oh, and upon re-reading I realized: You can't skip spacewalk-java-lib. >> That's the rpm that contains all the really important stuff. What client are >> you breaking by installing it? >> >> Another thing to consider is that if you installed the Spacewalk 2.0 rpms >> you probably want to be making your changes on top of the SPACEWALK-2.0 >> branch, not master. The code in master may have been updated to rely on >> changes made in other packages, for example the database schema, and may >> break if installed on a 2.0 system. Once you have your changes working on >> the SPACEWALK-2.0 branch it would probably be a clean merge over to master. >> >> -Stephen > > Thanks for noticing that! I'll pull the 2.0 branch and start working > from there, using the same stop - change - commit - tito - rpm - start > process. > Alright, that worked just fine! Thanks Stephen. For posterity's sake, here are the steps to modify the code and test your changes (this isn't documented anywhere that I could find): 1. Setup Spacewalk on the system you want to develop on. 2. Use git to clone from the repo. Make sure you are working in the same branch as the installed system's version; for example, use --branch=SPACEWALK-2.0. 3. Modify whatever code you would like. Make sure you use "git add " and then "git commit -m ''." 4. Navigate to the closest directory upwards with a .spec file. 5. Run "tito build --test --rpm". The --test flag prevents you from building from the original repo, and uses your commits instead. 6. Navigate to /tmp/tito, and install the package(s) using "rpm -ivh --replacefiles ". 7. Restart Spacewalk using "/usr/sbin/spacewalk-service restart" to start from the new packages. Note this doesn't mean you shouldn't write the appropriate tests for the code. Thanks again for the help! A. E. Lavinghouse ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Newbie trying to test my code changes
On Mon, Nov 11, 2013 at 1:23 PM, Stephen Herr wrote: > Oh, and upon re-reading I realized: You can't skip spacewalk-java-lib. > That's the rpm that contains all the really important stuff. What client are > you breaking by installing it? > > Another thing to consider is that if you installed the Spacewalk 2.0 rpms > you probably want to be making your changes on top of the SPACEWALK-2.0 > branch, not master. The code in master may have been updated to rely on > changes made in other packages, for example the database schema, and may > break if installed on a 2.0 system. Once you have your changes working on > the SPACEWALK-2.0 branch it would probably be a clean merge over to master. > > -Stephen Thanks for noticing that! I'll pull the 2.0 branch and start working from there, using the same stop - change - commit - tito - rpm - start process. > On 11/11/2013 02:10 PM, Stephen Herr wrote: >> >> Hi Austin, >> >> Assuming that you really are sucessfully building and installing the rpm, >> the only thing that occures to me is that you should restart the tomcat >> service (probably 'tomcat6' or 'tomcat' depending on your setup). This >> forces it to reload cached content. >> >> In general that's a fine approach to take. /var/log/httpd/error_log and >> /var/log//catalina.out are some error logs it might be very useful >> for you to watch when you're testing your changes. In the former you'll >> generally see exceptions generated in the python and perl layers, in the >> latter you'll see exceptions generated in the java layer. >> >> -Stephen Herr I have been using /usr/sbin/spacewalk-service stop / start before making any changes. Thanks for the logs, I'm not getting errors in either; however, I think I discovered the reason for that. rpm -qa | grep spacewalk shows that both spacewalk-java-2.0.5-1.el6.noarch *and* -2.1.54-1.git.0.5c89a47.el6.noarch are installed, so the java is probably running out of the 2.0. Thus, my changes aren't doing anything (but I'm also not buggering up the system by trying to install 2.1 on top of it!). Going to remove the 2.1 package, pull the 2.0 down, and give it a shot. Thanks for your help! Updates in a bit as soon as I try it. ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Newbie trying to test my code changes
Oh, and upon re-reading I realized: You can't skip spacewalk-java-lib. That's the rpm that contains all the really important stuff. What client are you breaking by installing it? Another thing to consider is that if you installed the Spacewalk 2.0 rpms you probably want to be making your changes on top of the SPACEWALK-2.0 branch, not master. The code in master may have been updated to rely on changes made in other packages, for example the database schema, and may break if installed on a 2.0 system. Once you have your changes working on the SPACEWALK-2.0 branch it would probably be a clean merge over to master. -Stephen On 11/11/2013 02:10 PM, Stephen Herr wrote: Hi Austin, Assuming that you really are sucessfully building and installing the rpm, the only thing that occures to me is that you should restart the tomcat service (probably 'tomcat6' or 'tomcat' depending on your setup). This forces it to reload cached content. In general that's a fine approach to take. /var/log/httpd/error_log and /var/log//catalina.out are some error logs it might be very useful for you to watch when you're testing your changes. In the former you'll generally see exceptions generated in the python and perl layers, in the latter you'll see exceptions generated in the java layer. -Stephen Herr On 11/11/2013 12:21 PM, Austin Lavinghouse wrote: Hello there, first time user. I'm trying to test my changes to the code by building from source, but I can't figure out how to do so. I've gotten as far as using 'tito build --test --rpm" in spacewalk/java as per https://www.redhat.com/archives/spacewalk-list/2013-February/msg00052.html. My "test" to see if I am working from my updated code has been to git rm EnabledListSetupAction.java, and commit the change to git. Then I run tito build --test --rpm in spacewalk/java, and rpm -ivh --replacefiles the resulting packages (skipping the spacewalk-java-lib package, because that breaks the client even without my changes). After I start Spacewalk back up, navigating to /rhn/users/ActiveList.do still functions. It is my understanding that without EnabledListSetupAction (as per https://fedorahosted.org/spacewalk/wiki/TracingaPage) this should no longer work. Any help with this specific line of thinking would be greatly appreciated, but, more generally, how do I build the project to test my changes to the code? My senior thesis is to make a contribution to the project, but I'm having the hardest time just setting up an environment where I can make changes -> see results, and I only have 3 weeks left. Thank you for your time, Austin E. Lavinghouse PS- If I'm doing anything wrong re: formatting, mailing list etiquette, please let me know! ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] Newbie trying to test my code changes
Hi Austin, Assuming that you really are sucessfully building and installing the rpm, the only thing that occures to me is that you should restart the tomcat service (probably 'tomcat6' or 'tomcat' depending on your setup). This forces it to reload cached content. In general that's a fine approach to take. /var/log/httpd/error_log and /var/log//catalina.out are some error logs it might be very useful for you to watch when you're testing your changes. In the former you'll generally see exceptions generated in the python and perl layers, in the latter you'll see exceptions generated in the java layer. -Stephen Herr On 11/11/2013 12:21 PM, Austin Lavinghouse wrote: Hello there, first time user. I'm trying to test my changes to the code by building from source, but I can't figure out how to do so. I've gotten as far as using 'tito build --test --rpm" in spacewalk/java as per https://www.redhat.com/archives/spacewalk-list/2013-February/msg00052.html. My "test" to see if I am working from my updated code has been to git rm EnabledListSetupAction.java, and commit the change to git. Then I run tito build --test --rpm in spacewalk/java, and rpm -ivh --replacefiles the resulting packages (skipping the spacewalk-java-lib package, because that breaks the client even without my changes). After I start Spacewalk back up, navigating to /rhn/users/ActiveList.do still functions. It is my understanding that without EnabledListSetupAction (as per https://fedorahosted.org/spacewalk/wiki/TracingaPage) this should no longer work. Any help with this specific line of thinking would be greatly appreciated, but, more generally, how do I build the project to test my changes to the code? My senior thesis is to make a contribution to the project, but I'm having the hardest time just setting up an environment where I can make changes -> see results, and I only have 3 weeks left. Thank you for your time, Austin E. Lavinghouse PS- If I'm doing anything wrong re: formatting, mailing list etiquette, please let me know! ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
[Spacewalk-devel] Newbie trying to test my code changes
Hello there, first time user. I'm trying to test my changes to the code by building from source, but I can't figure out how to do so. I've gotten as far as using 'tito build --test --rpm" in spacewalk/java as per https://www.redhat.com/archives/spacewalk-list/2013-February/msg00052.html. My "test" to see if I am working from my updated code has been to git rm EnabledListSetupAction.java, and commit the change to git. Then I run tito build --test --rpm in spacewalk/java, and rpm -ivh --replacefiles the resulting packages (skipping the spacewalk-java-lib package, because that breaks the client even without my changes). After I start Spacewalk back up, navigating to /rhn/users/ActiveList.do still functions. It is my understanding that without EnabledListSetupAction (as per https://fedorahosted.org/spacewalk/wiki/TracingaPage) this should no longer work. Any help with this specific line of thinking would be greatly appreciated, but, more generally, how do I build the project to test my changes to the code? My senior thesis is to make a contribution to the project, but I'm having the hardest time just setting up an environment where I can make changes -> see results, and I only have 3 weeks left. Thank you for your time, Austin E. Lavinghouse PS- If I'm doing anything wrong re: formatting, mailing list etiquette, please let me know! ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel