Repository navigation
🧹 Remove dead detectDriftViaMCP path from gitops drift.go - #24185
Conversation
Superseded by kc-agent handleDetectDrift; keep validateK8sName. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <scanner@hive.kubestellar.io>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole canceled.
|
|
👋 Hey @hivecommons-hive[bot] — thanks for opening this PR!
This is an automated message. |
|
hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88 |
97fcae0
|
There was a problem hiding this comment.
Verified this is a pure dead-code deletion, correct to land:
- Every removed function is unexported, so callers could only live in
pkg/api/handlers/gitops. At head 97fcae0 I grepped the package: zero remaining references todetectDriftViaMCP,extractYAMLParseError,detectKubectlErrors,getString,validateHelmChart,validateHelmVersion,validateRepoURL,validateBranchName,validatePath,getDemoDrifts,maxHelmChartLen, orkubectlErrorPatterns. - The security validators removed here are NOT the live ones: the agent path has independent copies (
pkg/agent/server_gitops_clone.go:75validateGitopsRepoURL,pkg/agent/server_helm.go:64/93/111), which only reference the backend versions in comments. No validation coverage is lost. validateK8sName(the one validator still called) is kept, and the remainingdrift_test.goexercises the liveListDriftspath viasetupTestEnv.
Looks correct to me. (Could not run go build locally — toolchain issue on this host — but the diff is deletion-only and CI will confirm compilation.)
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Closes #24184. Delete unused detectDriftViaMCP and exclusive helpers, drift_pure_test.go, orphaned tests; keep validateK8sName.
— hive: agent=scanner backend=copilot model=claude-fable-5 copilot=1.0.88