[NPMCLI-164] add-availability command inserts the availableComponent lines incorrectly Created: 13/Feb/18  Updated: 03/Dec/20  Resolved: 09/Mar/18

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: 2.2.0, 3.0.0
Fix Version/s: 3.0.0, 2.2.1

Type: Bug Priority: Neutral
Reporter: Julie Legendre Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: CLI v3
Sprint: Kromeriz 135, Kromeriz 136, Kromeriz 137
Story Points: 8

 Description   

Below is an example where the add-availability command has produced an erroneous result.

light-modules/bucket-list-module/templates/pages/bucket-list.yaml

title: bucket-list
templateScript: /bucket-list-module/templates/pages/bucket-list.ftl
renderType: freemarker
dialog: bucket-list-module:pages/bucket-list
visible: true

areas:
  main:
    availableComponents:
      activity:
        id: bucket-list-module:components/activity
      image:
        id: mtk:components/image
      linkList:
      google-maps:
        id: google-maps-magnolia:components/google-maps
        id: mtk:components/linkList

To reproduce:
Follow https://documentation.magnolia-cms.com/display/DOCS56/Copy+of+Magnolia+CLI+walkthrough

(ask in documentation room for access if required)



 Comments   
Comment by Christoph Meier [ 26/Feb/18 ]

Sie note:
The tutorial which contains the step which leads to the error report here, it does contain not only one add-availability. Interestingly some work, while the one fails.

mgnl  add-availability  activity  bucket-list@main

=> works fine

mgnl add-availability mtk:components/linkList pages/bucket-list@main

=> works fine

mgnl add-availability google-maps-magnolia:components/google-maps pages/bucket-list@main

=> fails

Comment by Christoph Meier [ 27/Feb/18 ]

The same error was also confirmed by a user following the tutorial, see https://goo.gl/q8W5dS.
This indicates that the error exists on CLI-2.x.

Comment by Jaroslav Simak [ 02/Mar/18 ]

Stopping progress for now, this will require bigger effort to get it right. The diff that is used to combine old and new yaml is too error prone. Probably something that works over AST would be much better for the use-case.

Generated at Mon Feb 12 04:47:09 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.