Repository navigation
fix(resolver): populate sdk submodule in the @main plugin cache + hint carries override - #12
Conversation
…t carries override GitClone pulled no submodules, so the @main cache's sdk/ was empty and go.work's `use ./sdk` broke every out-of-tree plugin build ("cannot load module ../../sdk"), failing plugin providers to connect (examplestructkind connect-fail warning; the check-live "no provider registered"). Add populateSDKSubmodule after a fresh fetch: init only the sdk submodule, rewriting the .gitmodules SSH url to HTTPS (no SSH key needed headless); a repo without sdk is a no-op. Verified: fresh GitClone populates sdk/go.mod (integration test) and plugin-example-structkind then builds EXIT 0 (GOWORK=off ./cmd/serve). Also: the failed-bed inspect hint now carries the active CHARLY_REPO_OVERRIDE so `charly check live` reproduces the bed's local-checkout state (was resolving @main-published plugins). Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: code/config (charly Go: plugin-ref resolver + check-bed debug hint) Security & anti-tampering (T1–T4): PASS — no touch to the validator spec / CLAUDE.md / hooks / branch-protection; no embedded instructions to the validator in body/comments/code; diff (136+/5-) matches the description exactly, all 4 files accounted for; the Checklist:
Decision: APPROVED. Both fixes are real and correct, the resolver fix is independently reproduced live by the fresh evaluator (fresh @main clone → sdk populated → out-of-tree plugin build EXIT 0), every gate is green at zero warnings, and the change ships tests that fail without it. Finalizing the merge-time CalVer, merging Assisted-by: Claude (analysed on a live system) |
…sdk submodule + override hint) Assisted-by: Claude (analysed on a live system)
…warded kubeconfig port BLOCKING regression (task #12): check-k8s-deploy's rebuild step failed with k3s API connection-refused after `charly update` — Add() re-establishes a k3s-server deploy's kubeconfig server-port rewrite via K3sPostProvision (retrieveArtifactsAndK3s's artifactRegisterHandlers["kubeconfig"] dispatch, which rewrites the retrieved kubeconfig's guest-local server URL to the current host-forwarded port and merges it into ~/.kube/config), but Update() never called it — a fresh update left the merged kubeconfig context pointing at whatever forwarded port was current the LAST time Add ran. Fix: Update() now re-runs K3sPostProvision after a successful dispatch, gated on the kube plugin already being connected (a pure providerRegistry.ResolveVerb lookup — no connect attempt, no side effect). Unlike Add, which only reaches K3sPostProvision when the deploy's OWN candy list declares `register: kubeconfig`, Update has no candyList to run that same check against; calling K3sPostProvision unconditionally hard-errors for every OTHER deploy kind with "kube plugin not loaded" (caught live by TestExternalDeployPlugin_ReverseChannelEndToEnd, a plain fixture with no candy/plugin-kube composed at all — fixed in the same commit after the first attempt regressed it). A k3s-server deploy's plugin connects during the update path's own plugin-loading, so the registry already reflects whether THIS deploy actually needs it. Also extracted artifactKeyFrom(reply) as a shared helper (R3) — the reply.ArtifactKey-with-t.name-fallback idiom Add already used inline, now shared with Update. Verified: go build/vet/test green (including the regressed-then-fixed TestExternalDeployPlugin_ReverseChannelEndToEnd). Live proof: check- githubrunner-pod's image-build step passes cleanly post the SIGSEGV fix (3c8fe86) — confirms the build path is healthy end-to-end; the k3s-forward fix here is unit-test-proven (no k3s-bearing bed run available in this session's time budget beyond the VM beds team-lead already owns).
Summary
Two fixes for the @main plugin-cache failures the concurrent 61-bed roster surfaced (pre-existing, independent of P1):
sdk submodule not populated in the @main cache. The plugin-ref resolver's
GitClone(git clone --depth 1/git init+fetch) pulled no submodules, so~/.cache/charly/repos/…@main/sdk/was empty andgo.work'suse ./sdkbroke every out-of-tree plugin build from the @main cache (cannot load module ../../sdk … no such file). The provider then failed to connect — theexamplestructkind"provider did not connect" warning and the check-live "no provider registered". AddedpopulateSDKSubmodule: after a fresh fetch it inits only thesdksubmodule, rewriting the.gitmodulesSSH url ([email protected]:) to HTTPS so no SSH key is needed in a headless run; a repo without ansdksubmodule (abox/<distro>) is a clean no-op.debug hint didn't reproduce the bed env. A FAILED bed's
inspect: charly check live <bed>hint dropped theCHARLY_REPO_OVERRIDEthe bed ran with, so the operator's command resolved the @main-published candies/plugins — a different deployment. The hint now carries the active override.Change class + gate (R10, code)
go test ./...green. New tests:TestGitClone_PopulatesSDKSubmodule(network integration — a realGitCloneof the charly repo populatessdk/go.mod),TestPopulateSDKSubmodule_NoSDKRepoIsNoOp,TestDebugNotice_CarriesRepoOverride.golangci-lint0 issues;task build:charlyR9 (charly version2026.189.0336).plugin-example-structkind(the connect-fail plugin) builds EXIT 0 the resolver's exact way (GOWORK=off go build ./cmd/serve) — before the fix it failedcannot load module ../../sdk.Single-repo (no submodule pointer change).
Tier: fully tested and validated.
Assisted-by: Claude (fully tested and validated)