refactor: consolidate remaining framework batches - #103
Merged
ddtcorex merged 2 commits intoAug 4, 2026
Conversation
ddtcorex
force-pushed
the
refactor/framework-consolidation-remaining-batches
branch
from
August 4, 2026 03:01
c148aee to
93ebb93
Compare
ddtcorex
force-pushed
the
refactor/framework-consolidation-remaining-batches
branch
2 times, most recently
from
August 4, 2026 07:49
c6c7dc5 to
0be0444
Compare
ddtcorex
force-pushed
the
refactor/framework-consolidation-remaining-batches
branch
7 times, most recently
from
August 4, 2026 08:26
29d909b to
f7dfeb1
Compare
Establishes framework packages and the registry as the source of truth for framework-specific behavior, while generic orchestration stays in engine, command, and desktop layers. Ownership model: - internal/frameworks/<framework>: identity, aliases, defaults, capabilities, assets, lifecycle hooks, remote metadata, table-prefix rules, tool commands, and upgrades. - internal/frameworks: typed specs, registry construction, alias resolution, parent inheritance, validation, shared abstractions. - internal/engine: framework-agnostic orchestration (rendering, SQL execution, migration dispatch, runtime policy, configuration). - internal/cmd / internal/desktop: consume resolved framework definitions instead of owning framework-specific switches. Family inheritance: OpenMage inherits Magento 1 behavior, Mage-OS inherits Magento 2 behavior. Parents hold shared family behavior; children provide only their identity and genuine overrides via FrameworkSpec/FrameworkPatch, so future family changes don't need duplicating across forks. Registry and definitions: - Consolidated canonical names, aliases, manifests, defaults, capabilities, discovery, and operational hooks into typed framework definitions. - Added validated parent inheritance and alias resolution to the registry (RegisterSpecs, cycle/unknown-parent detection). - Kept generated framework registration checked by CI. Framework packages and assets: - Moved framework-specific blueprints, nginx templates, Varnish assets, profiles, metadata readers, upgrades, table-prefix logic, and bootstrap behavior into their owning packages. - Added embedded framework blueprint filesystems and a merged generic asset view for rendering and tests. - Moved shared Magento-family behavior to the Magento 1/Magento 2 parents, leaving OpenMage and Mage-OS as child deltas. Generic orchestration: - Replaced framework conditionals with registry dispatch for bootstrap plans, deploy locale queries, Varnish defaults, runtime/chown policy, migrations, tool execution, and related command behavior. - Kept generic SQL execution/orchestration in engine/bootstrap rather than moving infrastructure concerns into frameworks. Desktop and contributor experience: - Desktop onboarding now receives framework names, labels, and aliases from the backend registry (ListFrameworks bridge). - Updated English and Vietnamese framework-authoring documentation to cover the Spec()/Parent/FrameworkPatch/Override[T] inheritance mechanism, which the initial docs pass omitted; fixed several other stale docs surfaced along the way (table_prefix scope, detected-frameworks table, README's upgrade-pipeline list, CLAUDE.md's rotting file counts and blueprint-location note). - Added regression tests for registry inheritance, aliases, framework operations, blueprints, command dispatch, remote credential projection, desktop wiring, and source overrides. Cleanup: - Removed a dead compatibility fallback in Magento 2's PostClone (CmdHelpers.RunFrameworkAdminCreate/RunFrameworkReindex) that no production caller ever populated and carried a latent nil-pointer panic path if ever reached; rewrote its tests to cover the real RunAdminCreate/RunReindex path instead. - Fixed a staticcheck S1016 finding in the blueprints union-FS. No config-file format migration is required. Existing framework IDs and aliases remain supported through registry resolution. No new product-facing behavior is intentionally changed. Closes #104
ddtcorex
force-pushed
the
refactor/framework-consolidation-remaining-batches
branch
from
August 4, 2026 17:49
f7dfeb1 to
18a6028
Compare
…consolidation-remaining-batches
This was referenced Aug 4, 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 free
to 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.
Summary
This PR completes the framework-consolidation refactor described in Closes #104. It establishes framework packages and the registry as the source of truth for framework-specific behavior, while retaining generic orchestration in engine, command, and desktop layers.
The refactor itself is one squashed commit to keep the review and eventual revert atomic, followed by a merge commit bringing in
master's subsequent commits (see "Merged master" below) — that merge is not squashed, since it just catches the branch up rather than being part of the refactor's own diff.Architecture
Ownership model
internal/frameworks/<framework>internal/frameworksinternal/engineinternal/cmd/internal/desktopFamily inheritance
Parents hold shared family behavior. Children provide only their identity and genuine overrides, so future family changes do not need to be duplicated.
What changed
Registry and definitions
Framework packages and assets
Generic orchestration
Desktop and contributor experience
CI follow-up fixes
master.golangci-lint.MD5:saltpassword compatibility in the bootstrap SQL path without performing weak password hashing in Go, resolving the CodeQL finding while preserving legacy behavior.staticcheckS1016 finding in the blueprints union-FS (mountDirEntry.Infostruct-literal conversion).Post-review fixes (folded into this squash)
PostClone(CmdHelpers.RunFrameworkAdminCreate/RunFrameworkReindex) that no production caller ever populated and carried a latent nil-pointer-panic path if ever reached; rewrote its tests to cover the realRunAdminCreate/RunReindexpath instead.adding-a-framework.md/architecture.md(+ Vietnamese mirrors) now document theSpec()/Parent/FrameworkPatch/Override[T]inheritance mechanism and drop a stale hardcoded framework count;table_prefixdocumentation now covers Mage-OS and PrestaShop, not just the Magento family;getting-started.md's detected-frameworks table now lists Mage-OS, PrestaShop, and Django;README.md's upgrade-pipeline list now includes Magento 1;CLAUDE.md's repository map no longer carries rotting hardcoded file counts and now notes thatinternal/frameworks/<name>/blueprint/**also busts theBlueprintVersioncontent hash.Merged
mastermastergained 5 commits after this branch diverged, including two (b6f9f7b,94ad6b7) that changed the exact sameinternal/engine/config.go/render.go/base.ymlchown-directory logic this refactor also touches (moving the Magento-family default chown paths into a framework-owned registry). Mergedmasterinto this branch rather than rebasing, so the merge commit itself is reviewable. Verified by hand that the 3-way merge combined both sides correctly, not just that it was textually conflict-free:GetDefaultChownDirList/GetEntrypointChownDirListininternal/engine/config.go— the framework-owned-registry lookup this branch introduced and master's bind-mount-exclusion filter both survived, composed correctly.RenderData.EntrypointChownDirListis wired intorender.goand all 4CHOWN_DIR_LISToccurrences inbase.ymlreference it (not the unfilteredConfig.Stack.ChownDirList) — confirms the entrypoint no longer chowns the bind-mounted project directory on every container start.docker/php/etc/entrypoint.sh's chown guard andinternal/engine/docker.go'sIsVolumeEmptyfix both came through unchanged.tests/testdata/framework_snapshots/{magento2,mageos}/compose.yml) and the newTestEntrypointChownDirListExcludesBindMountstest confirm the merged behavior end to end.Full
make test(lint, fmt-check, vet, unit, frontend, integration with Docker) passed locally against the merge commit.Compatibility and risk
Review guide
internal/frameworks/types,internal/frameworks/registry.go, and generated registration for the ownership contract and inheritance semantics.internal/blueprintsand individualembed.gofiles for the merged framework asset path.Validation
Passed locally:
Passed locally against the current commit (
go build ./...,go vet ./...,gofmt -s -l .,go test ./...,go generate ./internal/frameworks/...with no drift, plus a fullmake testrun with Docker available), including after the post-review fixes and themastermerge above. GitHub Actions is re-running against this commit:go vet,golangci-lint,gofmt, generated registrationLinked issue
Closes #104