posit-dev / posit-dev/images-shared

Thin the CLI by extracting domain logic into services

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

Nobody has claimed this yet.

cvp:0 docker tdp:2
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

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.