rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
463 stars 263 forks source link

Malfunctioning of comment using `#` when creating GitRepo #11226

Open mmartin24 opened 5 months ago

mmartin24 commented 5 months ago

Setup

Describe the bug Several issues here:

  1. While creating a git repo after clicking on 'Edit YAML', if an user tries to comment a line prepending a # before the text it won't if this one is somehow indented. You have to prepend the hash exactly before the text without space
  2. If you uncomment an already commented text and you try to comment back exactly in the same point you can't. It must be spaced in order to achieve it.

I will illustrate these 2 in a video

To Reproduce

Issue 1:

Issue 2:

Result Issue 1: Observe is not possible Issue 2: Observe is not possible and that one must add a space

Expected Result Issue 1: I should be able to add a # at the beginning of the line regardless of indentation Issue 2: I shold be able to comment adding the # in the same place it was shown at the beginning.

Screenshots

Screencast from 13-06-24 17:11:40.webm

Additional context

richard-cox commented 5 months ago

Linking to https://github.com/rancher/dashboard/issues/11020

richard-cox commented 5 months ago

I could still reproduce this in v2.9-a84c3a2f, which contains the fix for both #11020 and #11225.

It seems this is an issue with the editor. Lines cannot start with #, but char can be inserted at other places in the line. Adding one after the first and before text will correctly comment out the line

gaktive commented 1 month ago

Holding off on a backport until we know what the solution is. The fact that this involves the YAML editor does put pause of what we can do based on past experiences.