Project

General

Profile

Actions

Bug #15407

closed

[WB2] Property keys on collections are getting translated from snake_case to camelCase

Added by Lucas Di Pentima over 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
Story points:
-
Release relationship:
Auto

Description

While working on https://dev.arvados.org/issues/14874 I came across an issue with how workbench2 handles JSON data from the API server: the keys are being translated from snake_case format to camelCase.

In the context of properties handling, the problem is evident when looking at a collection that has a property with a key like responsible_person_uuid, because it's displayed as responsiblePersonUuid.

Also, when updating properties, the translated keys are being submitted to the API server, corrupting the original set of properties.

Looking at the code, it seems that the snake case formatting is done due to internal representation of data, but this is applied to all the API server provided data recursively. I've tried modifying the recursive call on https://github.com/curoverse/arvados-workbench2/blob/06fc8f6a97afa24144cb435f5af228fec6162a6b/src/services/common-service/common-service.ts#L57 and the properties start show and behave correctly. The problem is that a couple of tests start to fail because this recursive behavior is needed on other places.


Subtasks 1 (0 open1 closed)

Task #15509: Review 15407-camel-casing-fixResolvedLucas Di Pentima08/19/2019Actions

Related issues 4 (0 open4 closed)

Related to Arvados - Feature #14874: [API] Protected collection property -- preserves original project owner through copy/move/modify operationsResolvedLucas Di Pentima06/18/2019Actions
Related to Arvados - Idea #15067: [Workbench 2] Update property editing to use IDsResolvedLucas Di Pentima11/12/2019Actions
Has duplicate Arvados Workbench 2 - Bug #15645: [Workbench2] Property Keys are converted into Camel Case Format in Collection ViewDuplicateLucas Di PentimaActions
Blocks Arvados Workbench 2 - Bug #14984: Display command line, inputs with links to collectionsResolvedActions
Actions #1

Updated by Lucas Di Pentima over 5 years ago

  • Related to Feature #14874: [API] Protected collection property -- preserves original project owner through copy/move/modify operations added
Actions #2

Updated by Tom Morris over 5 years ago

  • Target version set to Workbench2 Q3, Q4
Actions #3

Updated by Tom Morris over 5 years ago

  • Blocks Bug #14984: Display command line, inputs with links to collections added
Actions #4

Updated by Lucas Di Pentima over 5 years ago

  • Related to Idea #15067: [Workbench 2] Update property editing to use IDs added
Actions #5

Updated by Tom Morris over 5 years ago

  • Project changed from Arvados Workbench 2 to Arvados
  • Target version changed from Workbench2 Q3, Q4 to 2019-08-14 Sprint
Actions #6

Updated by Tom Morris over 5 years ago

  • Assigned To set to Lucas Di Pentima
Actions #7

Updated by Lucas Di Pentima over 5 years ago

  • Status changed from New to In Progress
Actions #8

Updated by Lucas Di Pentima over 5 years ago

  • Subject changed from Property keys on collections are getting translated from snake_case to camelCase to [WB2] Property keys on collections are getting translated from snake_case to camelCase
  • Category set to Workbench2
Actions #9

Updated by Lucas Di Pentima over 5 years ago

  • Target version changed from 2019-08-14 Sprint to 2019-08-28 Sprint
Actions #10

Updated by Lucas Di Pentima over 5 years ago

Updates at commit d88effa - branch 14507-camel-casing-fix (wb2 repo)

  • Limit the camelCasing to first level keys on objects from the api server, recursing on items to support listings
  • Added tests for the above
  • Fixes handling of keys on JSONB columns
  • Fixes handling of CWL mounts' keys
  • Fixes "re-run process" feature also failing on the current wb2 version
Actions #11

Updated by Eric Biagiotti over 5 years ago

  • Looks like your commits are labeled with the wrong ticket number. Not sure there is anything you can do though...
  • Are we sure $graph in workflowDefinition.$graph!.find can't be null? If not we should check explicitly.
  • If "/var/lib/cwl/workflow.json" is a constant, it should be defined somewhere.
  • In process-input-actions, ln 18. Can this be split up so the "find" doesn't have to be called twice and we don't have a 380 column line.
Actions #12

Updated by Lucas Di Pentima over 5 years ago

Eric Biagiotti wrote:

  • Looks like your commits are labeled with the wrong ticket number. Not sure there is anything you can do though...

I've renamed the branch and amended the commit comments, thanks for the notice!

  • Are we sure $graph in workflowDefinition.$graph!.find can't be null? If not we should check explicitly.
  • If "/var/lib/cwl/workflow.json" is a constant, it should be defined somewhere.
  • In process-input-actions, ln 18. Can this be split up so the "find" doesn't have to be called twice and we don't have a 380 column line.

All fixed at commit c5fa0c4e - branch 15407-camel-casing-fix (wb2 repo)

Also added a check when starting the websocket service, if the cluster config doesn't include an url for that service, it'll notify the user and start the app instead of crashing.

Actions #13

Updated by Eric Biagiotti over 5 years ago

Lucas Di Pentima wrote:

Eric Biagiotti wrote:

  • Looks like your commits are labeled with the wrong ticket number. Not sure there is anything you can do though...

I've renamed the branch and amended the commit comments, thanks for the notice!

  • Are we sure $graph in workflowDefinition.$graph!.find can't be null? If not we should check explicitly.
  • If "/var/lib/cwl/workflow.json" is a constant, it should be defined somewhere.
  • In process-input-actions, ln 18. Can this be split up so the "find" doesn't have to be called twice and we don't have a 380 column line.

All fixed at commit c5fa0c4e - branch 15407-camel-casing-fix (wb2 repo)

Also added a check when starting the websocket service, if the cluster config doesn't include an url for that service, it'll notify the user and start the app instead of crashing.

Awesome, thanks! This LGTM, except kind of a nitpick. Can we add a bit more detail to the error/user warning. Like "...Container log streaming will not work. Contact the site administrator to enable this feature..." or something to that effect. Up to you though.

And now that I'm thinking about it, I'm worried that if not using websockets is intentional, all users will get this warning popup every time they log in. This is what the notification menu solves, but it looks like it doesn't actually have any functionality :/ Maybe the better approach is to scrap the snackbar message and make a ticket for getting the notifications menu working and adding this to it.

Also, just double checking that we have a ticket for workflow inputs not working. Thanks!

Actions #14

Updated by Lucas Di Pentima over 5 years ago

Updates at commit 79d59f23

  • Removed the snackbar message.
  • Added #15569 to implement the warning as a notification on the bell menu.
  • Updated #15557 to also include input selection on workflow running dialog.
Actions #15

Updated by Lucas Di Pentima over 5 years ago

  • Status changed from In Progress to Resolved
Actions #16

Updated by Tom Morris about 5 years ago

  • Related to Bug #15645: [Workbench2] Property Keys are converted into Camel Case Format in Collection View added
Actions #17

Updated by Lucas Di Pentima about 5 years ago

  • Release set to 27
Actions #18

Updated by Tom Morris about 5 years ago

  • Related to deleted (Bug #15645: [Workbench2] Property Keys are converted into Camel Case Format in Collection View)
Actions #19

Updated by Tom Morris about 5 years ago

  • Has duplicate Bug #15645: [Workbench2] Property Keys are converted into Camel Case Format in Collection View added
Actions

Also available in: Atom PDF