Bug #17299

[controller] runtime_constraints should be spelled {API:true}, not {api:true}

Added by Tom Clegg over 1 year ago. Updated about 1 year ago.

Assigned To:
Target version:
Start date:
Due date:
% Done:


Estimated time:
(Total: 0.00 h)
Story points:
Release relationship:


In #17014 3ec51dcf456b2afe02857089895a261653abddd4 did this

 type RuntimeConstraints struct {
-       API          *bool
+       API          bool  `json:"api"`

and this

+    self.runtime_constraints = {
+      'api' => false,
+      'keep_cache_ram' => 0,
+      'ram' => 0,
+      'vcpus' => 0,
+    }.merge(attributes['runtime_constraints'] || {})
As a result:
  • when a client submits a CR with {"runtime_constraints":{"API":true}}, controller changes it to {"api":true}
  • when railsapi loads a CR from the database that has {"API":true}, it merges with the default {"api":false} and returns {"api":false,"API":true} to the caller and/or the updated database row, which is obviously bad and (sometimes?) causes crunchrun to use the wrong value.
To fix:
  • change the key back to "API" in the Go SDK
  • change the key to "API" in the Rails merge-with-default code

A benefit of #17014 is that (with the above fix) railsapi won't see "api" no matter what the client sends -- controller will rewrite it as "API" -- so we shouldn't need any extra checks to prevent future problems.


Task #17302: ReviewResolvedNico César

Associated revisions

Revision 08c80b2b
Added by Nico Cesar over 1 year ago

Merge branch '17299-uppercase-api'

closes #17299

Arvados-DCO-1.1-Signed-off-by: Nico Cesar <>


#1 Updated by Nico César over 1 year ago

  • Assigned To set to Nico César
  • Status changed from New to In Progress

#3 Updated by Nico César over 1 year ago

#4 Updated by Tom Clegg over 1 year ago

LGTM, thanks!

#5 Updated by Peter Amstutz over 1 year ago

  • Status changed from In Progress to Resolved

#6 Updated by Peter Amstutz about 1 year ago

  • Release set to 38

Also available in: Atom PDF