Skip to content

refactor(plugin): decompose manager.go god file into 6 focused modules#121

Open
acamarata wants to merge 3 commits into
mainfrom
mega-p1/god-file-decomp
Open

refactor(plugin): decompose manager.go god file into 6 focused modules#121
acamarata wants to merge 3 commits into
mainfrom
mega-p1/god-file-decomp

Conversation

@acamarata
Copy link
Copy Markdown
Collaborator

Summary

  • Splits internal/plugin/manager.go (1424L) into six single-responsibility files, all in package plugin
  • installer.go — Install/Remove/Update + file-lock serialization + reverse-dependency checks
  • download.go — downloadPlugin / extractTarGz / rollbackInstall
  • loader.go — ListInstalled / LoadManifestsFromDir / List + nginx route conflict scan
  • security.go — checksum (SHA-256), Ed25519 signature, author CRL revocation, license validation, EOL block, postInstallEvent telemetry
  • config.go — DisablePlugin / EnablePlugin / IsDisabled + table-prefix and exact-name conflict detection
  • paths.go — DefaultCacheDir / LicenseCacheDir / pingAPIURL / findPlugin + exported wrappers
  • manager.go reduced to type declarations only (38L)

All exported symbols preserved — zero callers require changes. go build ./... passes clean.

Test plan

  • go build ./... from cli root — passes with zero errors
  • go test ./internal/plugin/... — run existing test suite to confirm no regressions
  • Smoke: nself plugin list, nself plugin install <name>, nself plugin remove <name> against staging

acamarata added 2 commits May 25, 2026 16:00
…dules

Split internal/plugin/manager.go into six single-responsibility files:
- installer.go: Install/Remove/Update + lock serialization + reverse-deps
- download.go:  downloadPlugin/extractTarGz/rollbackInstall
- loader.go:    ListInstalled/LoadManifestsFromDir/List + nginx route scan
- security.go:  checksum/Ed25519 signature/CRL/license/EOL/postInstallEvent
- config.go:    DisablePlugin/EnablePlugin/IsDisabled + table-conflict guards
- paths.go:     DefaultCacheDir/LicenseCacheDir/pingAPIURL/findPlugin wrappers

manager.go reduced to type declarations only (<40L). All exported symbols
preserved — no callers require changes. go build ./... passes clean.

Ticket: T-E2-04 (Mega Phase 1, Epic E2)
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview, Comment May 25, 2026 9:39pm

Request Review

…(T-E2-06)

Split hardening_check.go (808L) → hardening_check_db.go /
hardening_check_auth_net.go / hardening_check_infra.go /
hardening_check_helpers.go in cli/internal/doctor.

Split loader.go (942L) → loader_known_vars.go / loader_parse_env.go /
loader_helpers.go in cli/internal/config.

Split scaffold.go (938L) → scaffold_templates_infra.go /
scaffold_templates_code.go in cli/internal/plugin/scaffold.

Each file has a Purpose/Inputs/Outputs/Constraints/SPORT comment block.
Build verified clean (go build ./...).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant