Mailinglist Archive: opensuse-buildservice (239 mails)

< Previous Next >
Re: [opensuse-buildservice] osc submitreq broken in trunk
On 2009-05-23 00:47:09 +0200, Jan-Simon Möller wrote:
dl9pf@legolas:~/> osc submitrequest create -m"version bump" foo bar spam eggs
Server returned an error: HTTP Error 404: Not Found
old-stype request with action element

dl9pf@legolas:~/> rpm -qv osc-obs

obs revision 7364

If the format is changed, could we _please_ do it in a way the tools still
function ??

It seems that the format change introduced some more "issues". For instance we
need to adjust the frontend too. I attached a patch so that the frontend can
handle new and old style requests.
Another question is what should happen with osc? It probably needs to
support both styles because otherwise newer osc versions wouldn't work with
older obs instances and vice versa. For instance currently the backend
converts new submitrequests to the new format automatically (so you can create
the sr with an old osc version but you can't do a "osc sr show <id>" because
the old osc version can't parse the new request format).

Index: app/models/bs_request.rb
--- app/models/bs_request.rb (Revision 7365)
+++ app/models/bs_request.rb (Arbeitskopie)
@@ -1,11 +1,23 @@
class BsRequest < ActiveXML::Base
default_find_parameter :id

- # override Object#type to get access to the request type attribute
+ # accept old style and new style requests
def type(*args, &block)
- method_missing :type, *args, &block
+ if has_element? :action
+ action.method_missing(:type, *args, &block)
+ else
+ method_missing :type, *args, &block
+ end

+ def submit(*args, &block)
+ if has_element? :action
+ method_missing :action, *args, &block
+ else
+ method_missing :submit, *args, &block
+ end
+ end
# override Object#id to get access to the request id attribute
def id(*args, &block)
method_missing :id, *args, &block
@@ -18,3 +30,12 @@
return e.who
+module ActiveXML
+ class Node
+ # override Object#type to get access to the request type attribute
+ def type(*args, &block)
+ method_missing :type, *args, &block
+ end
+ end
< Previous Next >