Uh oh!
There was an error while loading. Please reload this page.
refactor(cli): extract resolveLocalInput + connectIngestTarget from runDataIngest - #321
Merged
Merged
Conversation
…unDataIngest runDataIngest was 586 lines; every pre-cluster step and the cluster pre-flight now live in two named stanza functions, moved verbatim: - resolveLocalInput (data_ingest_local.go) — steps 0–4 + the P3 content preflight: flag guard, banner, guided prompts, ~-expansion + existence-first check, table-name/category/misapplied-flag validation, layout walk, per-category spec resolution, spec synthesis + schema validation, local summary. Mutates a in place (via *runDataIngestArgs) so the --output-json defer and the cluster steps see the resolved spec exactly as before. - connectIngestTarget (data_ingest_cluster.go) — steps 5–8a: kubeconfig resolve, release + PVC discovery, verbose cluster summary, and the destination-table guard (incl. the folded interactive replace decision, which still flips a.Overwrite). The jsonEmitted/named-return defer dance stays INSIDE runDataIngest, next to the err it reads — both extracted functions feed that named return, so the error-JSON contract is unchanged. The dry-run stop (which sets jsonEmitted) also stays inside. Only in-stanza edits are what the new signatures force: multi-value returns on error paths, := to = where a named result already exists, and &a -> a where a is already a pointer. Step order, output order, and exit codes are untouched. data.go: 693 -> 240 lines; runDataIngest: 586 -> 138. Safety net: the #187 outcome-matrix table test + #264 mutation pins pass untouched; full suite green under -race; coverage floors hold (82.7%). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
commented
Jul 14, 2026
Contributor
👋 Heads-up — Code review queue is at 42 / 30 Above the WIP limit. The team convention is to review existing PRs before opening new work. Open PRs currently in Code review (oldest first):
Pull from review before opening new work. (This is a nudge from the kanban WIP check, not a block.) |
LukasWodka
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recreation of #309, which was auto-closed during the #300–#317 merge batch when its base branch (#303's) was deleted on squash-merge — GitHub closes a PR whose base ref is gone, and it can't be reopened. Same work, rebased cleanly onto develop (the #303 data.go split it stacked on is already merged).
Extracts
resolveLocalInput+connectIngestTargetfromrunDataIngest:*runDataIngestArgsso the in-placea.Spec/a.Overwritemutations thread through; explicit(cancelled, err)returns preserve the interactive-cancel + error paths;errfeeds the named return so the reclaimdeferstill fires.Diff vs develop is exactly the extraction (data.go −483, +cluster/+local). Previously reviewed + approved on #309.
🤖 Generated with Claude Code
Note
Low Risk
Pure move/refactor of existing ingest preflight logic with explicit cancel wiring; no new ingest semantics or cluster APIs.
Overview
runDataIngestis slimmed down to orchestration: it callsresolveLocalInputfor all pre-cluster work andconnectIngestTargetfor kube discovery plus the destination-table guard, then continues with dry-run, teardown, staging, andrunIngestionRununchanged.resolveLocalInput(data_ingest_local.go) holds the former inline steps 0–4 and P3 preflight (banner, interactive prompts, validation, layout walk, spec build/schema check, local preflight/summary).connectIngestTarget(data_ingest_cluster.go) holds steps 5–8a (cluster target resolution, verbose summary, existing-table prompt/a.Overwrite). Both take*runDataIngestArgsso in-place spec/path/overwrite updates still flow to the JSON error defer and later steps;cancelledpluserrpreserve interactive cancel (exit 0) vs real failures.Imports and helpers that only served the moved blocks shift with the code (
yaml,filepath,strings,schemaon the local file). No intended behavior, exit-code, or UX change—mechanical split for readability and follow-on testing.Reviewed by Cursor Bugbot for commit e04bc04. Bugbot is set up for automated code reviews on this repo. Configure here.