posit-dev / posit-dev/images-shared
Thin the CLI by extracting domain logic into services
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 22
Description
The CLI is 2,067 LOC (20% of the codebase) because commands contain business logic: filtering images, generating CI matrices, constructing settings objects, and applying build filters. Commands import 3+ levels deep into config internals (`config.image.posit_product.const.ReleaseStreamEnum`, `config.config.BakeryConfigFilter`, etc.). This logic is testable only through CLI invocation.
Extract a service layer between CLI and config. Each command becomes: parse args → call service → format output. Target: CLI under 1,000 LOC.
Files: `cli/build.py`, `cli/ci.py`, `cli/create.py`, `cli/common.py`, `cli/get.py`
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 by reading cli/build.py, cli/ci.py, cli/create.py, cli/common.py, and cli/get.py to map the filtering, CI matrix, settings, and build-filter logic currently held in commands. Define the service-layer boundaries before moving logic, then verify that commands only parse arguments, call services, and format output. Done means the CLI is under 1,000 LOC and the extracted logic can be tested outside CLI invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100