Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yaml - ChangePropertyKey does not adjust child prefixes if new key is different length #1873

Closed
nmck257 opened this issue Jun 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nmck257
Copy link
Collaborator

nmck257 commented Jun 1, 2022

See test cases below:

@Test
fun `shorter new key with indented config`() = assertChanged(
    recipe = ChangePropertyKey("a.b.c.d.e", "x.y", null, null),
    before = """
    a:
      b:
        c:
          d:
            e:
              child: true
    """,
    after = """
    x.y:
      child: true
    """
    /* actual:
    x.y:
              child: true
    */
)

@Test
fun `longer new key with indented config`() = assertChanged(
    recipe = ChangePropertyKey("x.y", "a.b.c.d.e",  null, null),
    before = """
    x:
      y:
        child: true
    """,
    after = """
    a.b.c.d.e:
      child: true
    """
    /* actual:
    a.b.c.d.e:
        child: true
    */
)
@pway99 pway99 added the bug Something isn't working label Jun 1, 2022
@pway99 pway99 moved this to Backlog in OpenRewrite Jun 1, 2022
@pway99 pway99 self-assigned this Jun 21, 2022
@pway99 pway99 moved this from Backlog to In Progress in OpenRewrite Jun 21, 2022
pway99 added a commit that referenced this issue Jun 21, 2022
PatrickViry pushed a commit that referenced this issue Jun 23, 2022
@traceyyoshima
Copy link
Contributor

Fixed by ffea512

Repository owner moved this from In Progress to Done in OpenRewrite Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants