Skip to content

Weaver registry diff: docs and usability suggestions #761

@lmolkova

Description

@lmolkova

Some suggestions from working on open-telemetry/semantic-conventions#2307.

Take a look at the

weaver/docs/usage.md

Lines 419 to 427 in 19a6c7e

--diff-format <DIFF_FORMAT>
Format used to render the schema changes. Predefined formats are: ansi, json, and markdown
[default: ansi]
--diff-template <DIFF_TEMPLATE>
Path to the directory where the schema changes templates are located
[default: diff_templates]

The only way to understand how templates should look like is by reverse engineering the https://github.com/open-telemetry/weaver/tree/main/defaults/diff_templates folder structure

  1. Let's assume I passed non-existed folder:

    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 ./does-not-exist --diff-format yaml -o diff

    Expected: error - folder not found
    Actual: success with full diff as if I didn't provide --diff-template

  2. Let's assume I passed existing folder name, but folder structure is not the right one and there is no yaml/weaver.yaml - same result as in p1


Suggestions:

  1. if --diff-template is provided and it does not exist, fail - don't fallback to default one

  2. I really don't understand how --diff-template is different from --config and why do I need to pass it along with --diff-format - i'm providing my own templates and my own config - just let me pass the path to weaver config and call it a day.

    I.e. let me do

    - weaver registry diff -r  ./current  --baseline-registry ./baseline --diff-template ./path/to/folder-with-specific-structure --diff-format yaml
    + weaver registry diff -r  ./current  --baseline-registry ./baseline --config ./path/to/my-weaver-config.yaml
  3. Add some logs to the template engine like reading ./path/to/config/weaver.yaml, executing jq, running jinja, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Ease of Use

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions