Skip to content

Split BakeryConfig into a document model, CRUD manager, and build service #593

@bschwedler

Description

@bschwedler

`config/config.py` (1,210 LOC) mixes five distinct responsibilities in one file: YAML lifecycle, CRUD operations, target generation, build orchestration, and registry cleanup. It imports from `image.bake.bake`, `registry_management.ghcr`, and `image.image_target`, coupling config parsing to build and registry concerns. Tests for config parsing are entangled with tests for build orchestration.

Split into:

  • `BakeryConfigDocument` — pure Pydantic model (already exists in name)
  • `BakeryConfigManager` — YAML CRUD, stays in `config/`
  • Build orchestration service — moves to `image/` or a new `orchestration/` module

The target-generation slice maps to `select_targets()` from `RFC-TARGET-SELECTION.md`, which is a prerequisite for the full split.

Files: `config/config.py`, `config/image/image.py`

Metadata

Metadata

Assignees

No one assigned

    Labels

    cvp:0Necessary projects we are undertaking that don’t directly deliver value to the customerdockerRelated to container images we producetdp:2The team notices.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions