Conversation
skillsvc.go had grown to ~2000 lines mixing ten concerns (service construction, OCI install, git install, extraction, client resolution, registry lookup, content fetching, build/push, uninstall, list/info). Split it into focused files within the same skillsvc package: service, install, install_oci, install_git, install_extraction, clients, oci, registry, content, list, uninstall, build, scope. All symbols stay in the same package, so there are no circular-import risks and no exported API changes. No behavioural changes, no renames, no signature changes.
skillsvc_test.go had grown to ~3900 lines. Split it into per-area test files mirroring the production layout, with shared fixtures extracted into testhelpers_test.go. Each Test* function is moved verbatim — no behavioural changes to any test.
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
The previous two commits added the split files but left the originals in place. Delete them now that all symbols have been moved to per-concern files.
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4947 +/- ##
==========================================
- Coverage 69.43% 69.40% -0.03%
==========================================
Files 539 551 +12
Lines 55750 55750
==========================================
- Hits 38708 38692 -16
- Misses 14067 14085 +18
+ Partials 2975 2973 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jhrozek
left a comment
There was a problem hiding this comment.
LGTM. Verified the mechanical claim: symbol counts match (73 prod symbols, 28 Test* funcs, 34 total test funcs), SPDX headers and imports are consistent across the new files, and go build, go vet, go test, golangci-lint are all green on the package.
* Split skillsvc.go into per-concern files skillsvc.go had grown to ~2000 lines mixing ten concerns (service construction, OCI install, git install, extraction, client resolution, registry lookup, content fetching, build/push, uninstall, list/info). Split it into focused files within the same skillsvc package: service, install, install_oci, install_git, install_extraction, clients, oci, registry, content, list, uninstall, build, scope. All symbols stay in the same package, so there are no circular-import risks and no exported API changes. No behavioural changes, no renames, no signature changes. * Split skillsvc_test.go into per-concern test files skillsvc_test.go had grown to ~3900 lines. Split it into per-area test files mirroring the production layout, with shared fixtures extracted into testhelpers_test.go. Each Test* function is moved verbatim — no behavioural changes to any test. * Remove original skillsvc.go and skillsvc_test.go The previous two commits added the split files but left the originals in place. Delete them now that all symbols have been moved to per-concern files.
Summary
pkg/skills/skillsvc/skillsvc.gohad grown to 1983 lines andskillsvc_test.goto 3912 lines, mixing ten distinct concerns (service construction, OCI install, git install, extraction, client resolution, registry lookup, content fetching, build/push, uninstall, list/info).skillsvcpackage. Because everything stays in one Go package, there is no circular-import risk and no exported API surface changes.Type of change
Test plan
task test/go test ./pkg/skills/skillsvc/...)golangci-lint run ./pkg/skills/skillsvc/...— 0 issues)go build ./...)Changes
pkg/skills/skillsvc/service.goOption,With*constructors,SkillLookupinterface,servicestruct,skillLock,Newpkg/skills/skillsvc/install.goInstalldispatch,installByName,installFromRegistryLookup,installAndRegister,registerSkillInGrouppkg/skills/skillsvc/install_oci.goinstallFromOCI,resolveFromLocalStore, OCI pull timeouts and size limitspkg/skills/skillsvc/install_git.goinstallFromGit+ apply/write/persist stagespkg/skills/skillsvc/install_extraction.goinstallWithExtraction, no-op / upgrade / fresh paths,buildInstalledSkillpkg/skills/skillsvc/clients.gopkg/skills/skillsvc/oci.goextractOCIContent,isSkillArtifactpkg/skills/skillsvc/registry.gobuildGitReferenceFromRegistryURLpkg/skills/skillsvc/content.goGetContentfrom git / OCI / URLpkg/skills/skillsvc/list.goList,Infopkg/skills/skillsvc/uninstall.goUninstallpkg/skills/skillsvc/build.goValidate,Build,Push,ListBuilds,DeleteBuildpkg/skills/skillsvc/scope.gonormalizeProjectRoot,defaultScopepkg/skills/skillsvc/testhelpers_test.gomakeLayerData,buildTestArtifact,buildManifestWithLayerSize, …)pkg/skills/skillsvc/service_test.goTestNewWithZeroOptions,TestList,TestListFiltersByGrouppkg/skills/skillsvc/install_test.goTestInstallPlainNameNotFound,TestInstallWithExtraction,TestInstallAddsSkillToGrouppkg/skills/skillsvc/install_oci_test.goTestInstallFromOCI,TestInstallFromLocalStore,TestInstallQualifiedNameOCIFallbackpkg/skills/skillsvc/install_git_test.goTestInstallFromGit,TestInstallFromGitGroupRegistrationRollback,TestInstallFromRegistryGitFallbackpkg/skills/skillsvc/install_registry_test.goTestInstallFromRegistry,TestBuildGitReferenceFromRegistryURL,TestSplitQualifiedName,TestResolveRegistryPackagesSubfolderpkg/skills/skillsvc/uninstall_test.goTestUninstall,TestConcurrentInstallAndUninstall,TestUninstallRemovesSkillFromGroupspkg/skills/skillsvc/info_test.goTestInfopkg/skills/skillsvc/content_test.goTestGetContentpkg/skills/skillsvc/build_test.goTestValidate,TestBuild,TestPush,TestListBuilds,TestDeleteBuild,TestValidateOCITagOrReferencepkg/skills/skillsvc/oci_test.goTestQualifiedOCIRefpkg/skills/skillsvc/skillsvc.gopkg/skills/skillsvc/skillsvc_test.goDoes this introduce a user-facing change?
No — this is a pure file-level reorganisation within an internal package. No exported API, behaviour, or logic changes.
Large PR Justification
This refactor must be atomic:
gitsees deletions ofskillsvc.go(1983 lines) andskillsvc_test.go(3912 lines) alongside the identical content reappearing in 13 production files and 11 test files. Net semantic diff is ~0.Split skillsvc.go…andSplit skillsvc_test.go…) are the minimum-granularity split that keepsgo buildgreen at every commit.skillsvcpackage's exported API (New,Option,With*,SkillLookup) is unchanged, so no downstream code is affected.git diff --find-renames=40%or GitHub's "Split" view — most files show as renames/moves rather than true additions. A good sanity check isgit diff main...HEAD -- pkg/skills/skillsvc/ | grep -c '^[+-]'vs. the same command filtered to lines that aren't pure moves.