Skip to content

fix: correct template_dir config key, add example export templates#1282

Merged
tomchop merged 1 commit into
mainfrom
docs/export-template-examples-1256
Jul 1, 2026
Merged

fix: correct template_dir config key, add example export templates#1282
tomchop merged 1 commit into
mainfrom
docs/export-template-examples-1256

Conversation

@sebdraven

@sebdraven sebdraven commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses #1256 ("No doc for or example export templates exist"):

  • yeti.conf.sample defined templates_dir, but the code
    (core/schemas/template.py, core/web/apiv2/templates.py) reads
    template_dir (singular) via yeti_config.get("system", "template_dir", ...).
    A user setting templates_dir per the sample config had it silently
    ignored, always falling back to the default /opt/yeti/templates.
    Renamed the key and added a comment on the required api/tasks volume
    sharing.
  • Added extras/templates/json_export.jinja2 and
    extras/templates/csv_export.jinja2 as annotated starting points,
    documenting the only context variable available to export templates
    (data, a list of Observable objects) and its common fields.
  • The write-up of the data context and getting-started guide for the
    docs site is tracked separately against yeti-platform.github.io.

Test plan

  • Rendered both example templates locally against a mock Observable
    with tags; output validated as well-formed JSON/CSV.
  • CI: ruff lint + unit tests

yeti.conf.sample defined `templates_dir`, but core/schemas/template.py and
core/web/apiv2/templates.py both read `template_dir` (singular), so a
custom directory set via the sample config's key was silently ignored.

Adds extras/templates/{json,csv}_export.jinja2 as annotated starting
points for issue #1256 (no doc or example export templates exist). The
matching write-up for the `data` context variable is tracked separately
in yeti-platform/yeti-platform.github.io.
@tomchop tomchop merged commit 7c9f152 into main Jul 1, 2026
3 checks passed
@tomchop tomchop deleted the docs/export-template-examples-1256 branch July 1, 2026 16:10
@tomchop tomchop added the code health Changes about syntax, code health, etc. label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health Changes about syntax, code health, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants