[engine] MuranoPL default for composite field is not working properly

Bug #1313694 reported by Alexander Tivelkov
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Murano
Won't Fix
High
Unassigned

Bug Description

In the following example:

networks:
    Contract:
      environment: $.bool().notNull()
      flat: $.bool().notNull()
      custom: [$.class(Network).notNull()]
    Default:
      environment: true
      flat: false

field 'networks' is defined as map-like data structure with contracts on each field and the default for the whole object.
This does not work properly: the defaults are not properly constructed, and the contracts are not matched.

Changed in murano:
importance: Undecided → Critical
assignee: nobody → Stan Lagun (slagun)
Timur Sufiev (tsufiev-x)
summary: - MuranoPL: default for composite field is not working properly
+ [engine] default for composite field is not working properly
summary: - [engine] default for composite field is not working properly
+ [engine] MuranoPL default for composite field is not working properly
Changed in murano:
status: New → Triaged
milestone: none → juno-1
ruhe (ruhe)
Changed in murano:
importance: Critical → High
milestone: juno-1 → juno-2
Changed in murano:
assignee: Stan Lagun (slagun) → nobody
Changed in murano:
status: Triaged → Confirmed
ruhe (ruhe)
Changed in murano:
milestone: juno-2 → juno-3
ruhe (ruhe)
Changed in murano:
milestone: juno-3 → juno-rc1
ruhe (ruhe)
Changed in murano:
milestone: juno-rc1 → none
Changed in murano:
assignee: nobody → Andrew Pashkin (apashkin)
Changed in murano:
assignee: Andrew Pashkin (apashkin) → nobody
Revision history for this message
Andrew Pashkin (apashkin) wrote :

What if drop composite arguments and replace this feature with custom classes? It will be more simple.

Changed in murano:
milestone: none → liberty-1
Changed in murano:
status: Confirmed → Fix Released
Changed in murano:
status: Fix Released → Confirmed
Changed in murano:
milestone: liberty-1 → liberty-2
Changed in murano:
milestone: liberty-2 → liberty-3
Changed in murano:
milestone: liberty-3 → liberty-rc1
Changed in murano:
milestone: liberty-rc1 → next
Changed in murano:
milestone: next → mitaka-1
Changed in murano:
milestone: mitaka-1 → mitaka-2
Changed in murano:
milestone: mitaka-2 → mitaka-3
Changed in murano:
milestone: mitaka-3 → mitaka-rc1
Revision history for this message
Stan Lagun (slagun) wrote :

There is a per-field workaround that is already used in Environment class:
Contract:
  $.string() or 'test'

So lets leave Default as it is now so that 2 methods will behave differently to address different use cases and not to create duplication

Changed in murano:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.