-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
clightraf CLI tool and command-line interfaceghtraf CLI tool and command-line interfaceenhancementNew feature or requestNew feature or request
Description
Retrofit ghtraf create with plan-execute pattern
Problem
create.py has 6+ if dry_run: branches with separate logic for gist creation, variable setting, secret setup, file configuration, and config writing. Each branch is a potential divergence point between dry-run and real execution.
Proposed solution
Extract the decision logic from run() into plan_create(args, config) -> Plan, then implement execute_plan(plan, args, config) that iterates the plan's actions.
Key actions to model:
CREATE_GIST(badge, archive) — returns gist ID viaActionResult.outputSET_VARIABLE(TRAFFIC_GIST_ID, TRAFFIC_ARCHIVE_GIST_ID) — depends on gist creationSET_SECRET(PAT) —requires_input=TrueCONFIGURE_FILE(dashboard, readme, workflow) — regex replacementsWRITE_CONFIG(.ghtraf.json, global config)
Remove dry_run parameter from gist.create_badge_gist(), gist.create_archive_gist(), gh.set_repo_variable(). These become pure executors called only during plan execution.
Acceptance criteria
-
plan_create()returns aPlanwith all actions -
ghtraf create --dry-runandghtraf createuse the sameplan_create() -
gist.pyfunctions no longer acceptdry_runparameter -
gh.pyfunctions no longer acceptdry_runparameter - Cascading gist IDs flow through
plan.context - PAT setup action flagged with
requires_input=True - Tests verify plan contents for various config scenarios
Related issues
- Parent: Plan-Execute epic
- Depends on: Core plan infrastructure sub-issue
- Refs Wire ghtraf create --init to chain template copy + cloud setup #29 — create --init (will need combined plan)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
clightraf CLI tool and command-line interfaceghtraf CLI tool and command-line interfaceenhancementNew feature or requestNew feature or request