On Thursday, June 16, 2016 3:10:04 PM CEST Miroslav Suchy wrote:
> Hi,
> I just upgraded Copr instance to new version.
> 
> There is one big change. You can now lower priority of your build.
> It was introduced to easy rebuild of rubygems and pypi. But it can be 
> used by CI systems later.
> 
> Copr-cli from our git, has --background option already. It lowers the 
> priority. But due compatibility reason we will not push the package into 
> main Fedora and we will wait one or two weeks.
> 
> If you want to give it try, then you can install it from our copr project.

Sorry I haven't posted earlier, I'm writing while I'm facing one bugreport.

Note that new python-copr library breaks the compatibility with older servers.
While trying to submit new build (or request for new copr) from command line,
frontend replies with (and copr-cli fails with):

    Unknown arguments passed (non-existing chroot probably)"

That's because the new client library sends useless content in POST to
frontend.  The older frontend was guarded against this.  Possibly we should
be more careful to not break client/server protocol like that in future :).

Ugly "hot-fix" is attached.

Pavel
--- ./pkgs/rhcopr-frontend/copr-frontend-1.78/coprs_frontend/coprs/views/api_ns/api_general.py	2016-06-20 13:04:23.917502292 +0200
+++ raw	2016-06-20 13:39:53.958941383 +0200
@@ -97,11 +97,11 @@
 
     # are there any arguments in POST which our form doesn't know?
     # TODO: don't use WTFform for parsing and validation here
-    if any([post_key not in form.__dict__.keys()
-            for post_key in flask.request.form.keys()]):
-        raise LegacyApiError("Unknown arguments passed (non-existing chroot probably)")
+    # if any([post_key not in form.__dict__.keys()
+    #         for post_key in flask.request.form.keys()]):
+    #     raise LegacyApiError("Unknown arguments passed (non-existing chroot probably)")
 
-    elif form.validate_on_submit():
+    if form.validate_on_submit():
         infos = []
 
         try:
@@ -259,13 +259,12 @@
 @api_req_with_copr
 def copr_new_build(copr):
 
-    # are there any arguments in POST which our form doesn't know?
-    if any([post_key not in form.__dict__.keys()
-            for post_key in flask.request.form.keys()]):
-        raise LegacyApiError("Unknown arguments passed (non-existing chroot probably)")
+    # # are there any arguments in POST which our form doesn't know?
+    # if any([post_key not in form.__dict__.keys()
+    #         for post_key in flask.request.form.keys()]):
+    #     raise LegacyApiError("Unknown arguments passed (non-existing chroot probably!)")
 
     if not form.validate_on_submit():
         raise LegacyApiError("Invalid request: bad request parameters")
@@ -313,9 +312,12 @@
     form = forms.BuildFormUploadFactory(copr.active_chroots)(csrf_enabled=False)
 
     # are there any arguments in POST which our form doesn't know?
-    if any([post_key not in form.__dict__.keys()
-            for post_key in flask.request.form.keys()]):
-        raise LegacyApiError("Unknown arguments passed (non-existing chroot probably)")
+    # if any([post_key not in form.__dict__.keys()
+    #         for post_key in flask.request.form.keys()]):
+    #     keys_allowed = ' '.join(form.__dict__.keys())
+    #     keys_added = ' '.join(flask.request.form.keys())
+    #     s = keys_allowed + " => " + keys_added
+    #     raise LegacyApiError("Unknown arguments passed (non-existing chroot probably)" + s)
 
     if not form.validate_on_submit():
         raise LegacyApiError("Invalid request: bad request parameters")
_______________________________________________
copr-devel mailing list
copr-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/copr-devel@lists.fedorahosted.org

Reply via email to