open-telemetry / open-telemetry/weaver
Weaver registry diff: template.set_file_name("schema-diff.yaml") in jinja is ignored when no output dir is provided
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 486
- Forks
- 108
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 40
Description
See https://github.com/open-telemetry/semantic-conventions/pull/2307.
It has jinja template with
{{- template.set_file_name("schema-diff.yaml") }}
...
following the same pattern as we have in codegen.
If I run it without -o option:
weaver registry diff -r ./current --baseline-registry ./baseline --diff-template ./path/to/templates --diff-format yaml
the result is printed to stdout.
If I add -o ./diff then the result is written to ./diff/schema-diff.yaml.
Suggestion:
- if no output folder was configured, but jinja attempted to set file name, we can default to current folder or fail
- Use the same output config between codegen templates and diff templates instead of inventing a new one -
weaver registry generatedoes not have-oparam and does something else. If we prefer-o, let's do it consistently for both options. - There is no need to provide default stdout experience for people coming with custom templates and custom config - assume file output as a default for them, they can always cat the file if they need stdout.
Related to #760 and #761
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the weaver registry diff entry point and trace how Jinja templates handle template.set_file_name("schema-diff.yaml") with and without -o. Compare its output configuration with weaver registry generate and the related issues #760 and #761. Done means the intended no-output-directory behavior is defined and covered for custom diff templates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100