Update to package-spec 3.6.6 - #26
Merged
Merged
Conversation
Lift the new top-level manifest `group` field into the shared Manifest base type so it becomes a `group` column on the packages table instead of living separately on each of the three concrete manifest types. Add coverage for the remaining 3.6.6 schema changes: saved search assets in content packages, and `ignore_fields` on policy test configs.
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.
Regenerated types from andrewkroh/package-spec-schema at commit e59fb7f59f51a1408017cf19bd0fe3b14ef2be37, and propagated the 3.6.6 changes through to the SQL schema.
package-spec 3.6.6 changes
groupfield on integration, input, and content manifestsManifest.Groupfield, newpackages.groupcolumnPolicyConfigTeststype withIgnoreFields; replacesTestCategoryConfigfor thepolicykeysource/buildvalidation modesgroupis lifted into theManifestbase typeThe spec adds
groupto all three manifest types, socmd/generate/augment.ymllists it under theManifestbase type rather than leaving three copies onIntegrationManifest,InputManifest, andContentManifest. This is what makes it reachable from SQL: thepackagestable is generated by reflecting overManifest, so a field on a concrete manifest type would have been invisible tocmd/gensql.With the field on the base type, regeneration adds the column automatically:
The column name is quoted because
groupis a SQLite keyword —cmd/gensql's existing reserved-word list already covers this, so no generator change was required. Absent values are stored asNULL, not''.Saved searches in content packages
readKibanaObjectsdiscovers asset types by scanning subdirectories ofkibana/, sokibana/search/*.jsonin a content package already flowed into thekibana_saved_objectstable without a code change. Added a test so the behavior is pinned, and documented the asset type inCLAUDE.md.Policy test
ignore_fieldsTestConfig.PolicyandInputTestConfig.Policychange type fromTestCategoryConfigto the newPolicyConfigTests, which addsignore_fieldsalongside the existingparallel,skip, andrequireskeys. This is a breaking API change for callers reading those two fields.No SQL change: the
policy_teststable is built fromPolicyTestConfig(the per-case_dev/test/policy/test-*.ymlfiles), which is a different type. The package-level_dev/test/config.ymlthatPolicyConfigTestsbelongs to is not read bypkgreaderand so is not persisted.Testing
go test ./...passes. New tests:pkgspec:groupunmarshals onto the promoted base type for all three manifest kinds, and is empty when absent;ignore_fieldsunmarshals on bothTestConfigandInputTestConfig.pkgsql:groupround-trips to thepackagestable for integration, input, and content packages, and isNULLwhen the manifest omits it; a content package'skibana/search/*.jsonreacheskibana_saved_objectswithasset_type = 'search'.Also verified against the real integrations repo —
TestReadAllPackagesandTestBuildFleetPackagesDB(472 packages) both pass, and the new column is queryable in the built database. No package usesgroupyet, as expected for a spec version this new.