Conversation
…essors - Add TestMultiPackWorldExport: exercises getWorldPackExportPath for 2-BP + 1-RP projects using a worldPath-relative target, with re-run safety check - Remove PrimaryBehaviorSource, PrimaryResourceSource, and primaryPackSource from regolith/config.go (dead code, only referenced by one test) - Rename TestPackSortingAndPrimaryAccessors -> TestPackSortingAndIsZero and drop the two now-deleted accessor assertions
This branch has not been deployed
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.
Important
This PR is just a prototype, not meant to be merged yet!
It contains a lot of untested AI code, as also the description might not be the best (sorry!)
The goal is to explore possible ways to bring multi pack support into regolith, if you have suggestions feel free to jump in!
Adds support for projects with more than one behavior and/or resource pack. Until now a Regolith project was hard-wired to exactly one BP and one RP; this PR generalizes the whole pipeline (config → tmp setup → filters → export → watcher → apply-filter) to an arbitrary number of packs per type.
Bumps
latestCompatibleVersionto 1.9.0. Everything below is gated onformatVersion >= 1.9.0— projects on older format versions behave exactly as before.Config format
The
packsobject accepts a new plural map form, keyed by pack name:BP/RP(the primary pack) orBP1,BP2, … (BP0is rejected). The primary pack always exists, even when it has no source on disk (a pack fully generated by filters is allowed).behaviorPack/resourcePackstrings still work and are still what gets written back out for single-pack projects, so existingconfig.jsonfiles round-trip unchanged.formatVersion < 1.9.0.Export targets get per-pack overrides, resolved as per-pack map → singular
bpName/rpName(primary only) → default<projectName>_bp<index>:exacttargets now fail with a clear error when a pack has no configured path.Main changes
config.go— newPack/Packsdata model with ordering helpers, version-gated parsing, and a customMarshalJSONthat keeps the legacy single-pack output.ExportTargetgainsbpNames/rpNames/bpPaths/rpPaths.profile.go—SetupTmpFilescreates one tmp folder per pack (tmp/BP,tmp/BP1,tmp/RP, …) instead of the fixed BP/RP pair; all folders are still prepared concurrently.export.go— newGetPackExportPath/GetExportNameresolve destination and name per pack for every target type (development,world,exact,local,none);ExportProjectresolves all packs of all targets up front (keeping export atomic and collision-checked) and then exports each pack from its own tmp folder.InplaceExportProject(apply-filter) restores every pack source.file_protection.go— deletion-safety and edited-file tracking now work per pack directory instead of per BP/RP pair.watcher.go— watches every pack source and dispatches the correctbp/rp/datainterruption.BehaviorFolder/ResourceFolderaccessors.Tests
New
test/multi_pack_test.go(21 tests) plus atest/testdata/multi_packproject, covering config parsing/marshalling in both forms, version gating and validation errors, name/path resolution, tmp folder setup, watcher roots, in-place export, and end-to-endlocal,exact,developmentandworldexports (including the missing-path failure case).Note for filter authors
Some filters will most likely need an update. Anything that assumes the working directory contains exactly
BP/andRP/— hard-coded paths, globs over the two folders, or logic that writes to "the" behavior pack — will simply not see the extra packs in a multi-pack project. Single-pack projects are unaffected, so this is not an immediate break, but filters should be reviewed to iterate over the pack folders present in tmp rather than assuming the fixed pair.