Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Extract file I/O from config models into a TemplateRenderer service

Open
#592 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
tooling

Research direction

Start with the duplicated render_files() implementations in config/image/version.py and config/image/matrix.py, then inspect config/config.py and the existing config/templating/ code. Define the TemplateRenderer around the structured inputs described in the issue, delegate rendering from both models, and verify that model validation no longer requires a real filesystem.

Written by the indexing model from the issue text.

Description

cvp:0 docker tdp:1

`ImageVersion` and `ImageMatrix` both contain Jinja2 rendering logic and filesystem operations alongside model validation. Their `render_files()` implementations are nearly identical — the same Jinja2 environment setup, the same template-walk logic, the same error-aggregation pattern, and the same file-write calls — duplicated across both classes.

Testing `ImageVersion` rendering currently requires constructing a full model hierarchy with parent pointers and a real filesystem. That makes model validation tests expensive and tightly coupled to I/O.

Extract a `TemplateRenderer` service that accepts structured inputs (template values, template paths, output paths) and produces file artifacts. Both `ImageVersion` and `ImageMatrix` delegate to it, eliminating the duplication and allowing model validation tests to run without a real filesystem.

Files: `config/image/version.py`, `config/image/matrix.py`, `config/config.py`, `config/templating/`

Dominant language
Python
Stars
2
Forks
0
Avg merge
4d 11h
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/images-shared

All issues in posit-dev/images-shared

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.