Skip to content

Weaver registry diff: template extension weirdness #760

@lmolkova

Description

@lmolkova

Take a look at the open-telemetry/semantic-conventions#2307

it has

schema-diff/
  ansi/
    schema-diff.j2
    weaver.yaml

I run

weaver registry diff -r  https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v1.34.0.zip[model] \
  --baseline-registry https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v1.33.0.zip[model] \
  --diff-template .\internal\tools\scripts\schema-diff\ --diff-format ansi -o diff-output

and things work fine, I get something like

    all:
      changes:
        - rename_attributes:
            attribute_map:
              code.column: code.column.number
              code.filepath: code.file.path
              ...

in output file.

Now, if I rename schema-diff.j2 -> schema-diff.yaml.j2 (and also change file name in the config), I'll get

""
    all:
      changes:
        - rename_attributes:
            attribute_map:
              "code.column": "code.column.number"
              "code.filepath": "code.file.path"
              ...

(Note all the quotes)

It also reproduces with --diff-format yaml and corresponding folder structure.
It seems there is some escaping(?) magic that tries to be helpful based on the file extension, but it gets in the way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    To consider for the next release

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions