From c5c033a63edbdb6aff026aa69721d5b54a9a931f Mon Sep 17 00:00:00 2001 From: Nusiq Date: Sun, 9 Nov 2025 14:19:42 +0100 Subject: [PATCH 1/2] Implemented proper error handling for invalid types in 'filters->[filter]->arguments'. --- regolith/filter.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/regolith/filter.go b/regolith/filter.go index 21850c3f..1244e533 100644 --- a/regolith/filter.go +++ b/regolith/filter.go @@ -1,8 +1,10 @@ package regolith import ( - "github.com/Bedrock-OSS/go-burrito/burrito" + "fmt" "slices" + + "github.com/Bedrock-OSS/go-burrito/burrito" ) type FilterDefinition struct { @@ -107,7 +109,13 @@ func filterFromObject(obj map[string]any, id string) (*Filter, error) { case []any: s := make([]string, len(arguments)) for i, v := range arguments { - s[i] = v.(string) + s[i], ok = v.(string) + if !ok { + return nil, burrito.WrappedErrorf( + jsonPropertyTypeError, + fmt.Sprintf("arguments->%d", i), + "string") + } } filter.Arguments = s case []string: From f086e8f8e1adb4e8c8fe5d79c58b78a194f1c6b6 Mon Sep 17 00:00:00 2001 From: Nusiq Date: Mon, 10 Nov 2025 11:56:47 +0100 Subject: [PATCH 2/2] Fixed Regolith crashing when the config.json file uses formatVersion 1.6.0 --- regolith/config.go | 2 +- regolith/export.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regolith/config.go b/regolith/config.go index a99ec505..fb454e4a 100644 --- a/regolith/config.go +++ b/regolith/config.go @@ -7,7 +7,7 @@ import ( "golang.org/x/mod/semver" ) -const latestCompatibleVersion = "1.4.0" +const latestCompatibleVersion = "1.6.0" const StandardLibraryUrl = "github.com/Bedrock-OSS/regolith-filters" const ConfigFilePath = "config.json" diff --git a/regolith/export.go b/regolith/export.go index 35490460..1f4ff597 100644 --- a/regolith/export.go +++ b/regolith/export.go @@ -26,7 +26,7 @@ func GetExportPaths( if semver.Compare(vFormatVersion, "v1.4.0") < 0 { bpPath, rpPath, err = getExportPathsV1_2_0( exportTarget, bpName, rpName) - } else if semver.Compare(vFormatVersion, "v1.4.0") == 0 { + } else if semver.Compare(vFormatVersion, "v1.6.0") <= 0 { bpPath, rpPath, err = getExportPathsV1_4_0( exportTarget, bpName, rpName) } else {