[opensuse-buildservice] Any docs for development about open build service
Hi All I am curious about the OBS webui communication with the backend api, so I begin to study ROR for some days. Is there a easy way to understand the communication between OBS frontend webui and the backend api , just like some docs about activexml module or for developers? Thanks! ----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
Am 4. März 2013 07:20:07 schrieb Aaron Yung <elevenyang@linpus.com>:
Hi All
I am curious about the OBS webui communication with the backend api, so I begin to study ROR for some days.
OBS api/webui code isn't exactly as written in the books. It contains a lot of custom additions and historical cruft. Maybe you should look at something more accessible to learn rails. However, if you're up for making a difference here, I'd say getting your hands dirty is easy as pie.
Is there a easy way to understand the communication between OBS frontend webui and the backend api , just like some docs about activexml module or for developers?
Thanks!
----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
-- With kind regards, Sascha Peilicke SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nuernberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 04.03.2013 07:20, Aaron Yung wrote:
Hi All
I am curious about the OBS webui communication with the backend api, so I begin to study ROR for some days. Is there a easy way to understand the communication between OBS frontend webui and the backend api , just like some docs about activexml module or for developers?
activexml is basically two things: the HTTP implementation as part of transport.rb and on top of that is the Node, which is parsing the XML returned from the API into a ruby tree. For this to work every API route needs to be mapped to a model and a route, so you can find in config/initializers/activexml.rb e.g. map.connect :statusmessage, 'rest:///status/messages/:id/?:limit' This maps to app/models/statusmessage.rb, so you can use Statusmessage.find(:id => params[:message_id]) This will then call into $APIURL/status/messages/#{params[:message_id} and the returned XML is available in the model. So e.g. see this example: irb(main):003:0> Statusmessage.find(id: 1).message.msg_id => "1" irb(main):004:0> Statusmessage.find(id: 1).value(:message) => "Now we have status messages ... watch out for notes here, if you encounter problems." Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
activexml is basically two things: the HTTP implementation as part of transport.rb and on top of that is the Node, which is parsing the XML returned from the API into a ruby tree.
For this to work every API route needs to be mapped to a model and a route, so you can find in config/initializers/activexml.rb e.g.
map.connect :statusmessage, 'rest:///status/messages/:id/?:limit'
This maps to app/models/statusmessage.rb, so you can use Statusmessage.find(:id => params[:message_id])
This will then call into $APIURL/status/messages/#{params[:message_id} and the returned XML is available in the model.
So e.g. see this example:
irb(main):003:0> Statusmessage.find(id: 1).message.msg_id => "1" irb(main):004:0> Statusmessage.find(id: 1).value(:message) => "Now we have status messages ... watch out for notes here, if you encounter problems."
Thanks for replying~ when I delete/create a project something else, How does the backend perl scripts know and update the api_production tables ? Also with the xml files ? I can't follow that ----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On 04.03.2013 12:37, Aaron Yung wrote:
activexml is basically two things: the HTTP implementation as part of transport.rb and on top of that is the Node, which is parsing the XML returned from the API into a ruby tree.
For this to work every API route needs to be mapped to a model and a route, so you can find in config/initializers/activexml.rb e.g.
map.connect :statusmessage, 'rest:///status/messages/:id/?:limit'
This maps to app/models/statusmessage.rb, so you can use Statusmessage.find(:id => params[:message_id])
This will then call into $APIURL/status/messages/#{params[:message_id} and the returned XML is available in the model.
So e.g. see this example:
irb(main):003:0> Statusmessage.find(id: 1).message.msg_id => "1" irb(main):004:0> Statusmessage.find(id: 1).value(:message) => "Now we have status messages ... watch out for notes here, if you encounter problems."
Thanks for replying~ when I delete/create a project something else, How does the backend perl scripts know and update the api_production tables ? Also with the xml files ? I can't follow that
the database is purely in the hand of the API, if you create a project, the API will push things into the backend. Check app/models/project.rb's write_to_backend function Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
I can't get you very well! Can you explain it in greater details ? Thanks very much ~ ----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
the database is purely in the hand of the API, if you create a project, the API will push things into the backend. Check app/models/project.rb's write_to_backend function
I can't get you very well! Can you explain it in greater details ? Thanks very much ~ ----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Montag, 4. März 2013, 17:48:08 wrote Aaron Yung:
the database is purely in the hand of the API, if you create a project, the API will push things into the backend. Check app/models/project.rb's write_to_backend function
I can't get you very well! Can you explain it in greater details ? Thanks very much ~
A mailing list can not replace a book (which we do not have for this unfortunatly). But when you have specific questions, we may can help you. bye adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de
On 05.03.2013 08:17, Adrian Schröter wrote:
On Montag, 4. März 2013, 17:48:08 wrote Aaron Yung:
the database is purely in the hand of the API, if you create a project,
the API will push things into the backend. Check app/models/project.rb's
write_to_backend function
I can't get you very well!
Can you explain it in greater details ? Thanks very much ~
A mailing list can not replace a book (which we do not have for this unfortunatly).
You want to write a book about OBS development? Don't think it will sell very well :) But indeed: digging into the code and then asking specific question is preferable. Greetings, Stephan -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
You want to write a book about OBS development? Don't think it will sell very well :)
But indeed: digging into the code and then asking specific question is preferable.
First , Thanks for your advise! Then I followed your advise and dug into the codes from webui to frontend api and the backend srcserver with ruby debugger and perl debugger. Now I suffer from something again. 1. When I use perl debugger to debug the process that the api data (such as creating a project) transfers to srcserver, and I can followed in BSStdServer and BSServer, but when srcserver forks, I can't follow it. Any way to debug multi-process like gdb in perl? 2. After compiling the dispatches in bs_srcserver, how do the functions execute one by one? Just like who writes the xml data to /srv/obs/source/:upload/pidfile at creating a project. I am so sorry to bother you again. ----- Go OBS -- View this message in context: http://opensuse.14.n6.nabble.com/Any-docs-for-development-about-open-build-s... Sent from the opensuse-buildservice mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (4)
-
Aaron Yung
-
Adrian Schröter
-
Sascha Peilicke
-
Stephan Kulow