From 161a3e75e9c6443e4c71c0bab51b4c5a75772b99 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 18 Aug 2025 17:20:59 +0200 Subject: [PATCH 01/11] Update coverage info Include coverage about kibana tags, and ignore the validations config file. --- internal/packages/assets.go | 57 +++++++++++++++++++++++++++------ internal/testrunner/coverage.go | 5 +++ 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/internal/packages/assets.go b/internal/packages/assets.go index 01f027e0d5..64fe5f50e0 100644 --- a/internal/packages/assets.go +++ b/internal/packages/assets.go @@ -11,6 +11,8 @@ import ( "os" "path/filepath" + "gopkg.in/yaml.v3" + "github.com/elastic/elastic-package/internal/multierror" ) @@ -39,13 +41,13 @@ func newAssetTypeWithFolder(typeName AssetType, folderName string) assetTypeFold var ( AssetTypeElasticsearchIndexTemplate = newAssetType("index_template") AssetTypeElasticsearchIngestPipeline = newAssetType("ingest_pipeline") - - AssetTypeKibanaSavedSearch = newAssetType("search") - AssetTypeKibanaVisualization = newAssetType("visualization") - AssetTypeKibanaDashboard = newAssetType("dashboard") - AssetTypeKibanaMap = newAssetType("map") - AssetTypeKibanaLens = newAssetType("lens") - AssetTypeSecurityRule = newAssetTypeWithFolder("security-rule", "security_rule") + AssetTypeKibanaDashboard = newAssetType("dashboard") + AssetTypeKibanaLens = newAssetType("lens") + AssetTypeKibanaMap = newAssetType("map") + AssetTypeKibanaSavedSearch = newAssetType("search") + AssetTypeKibanaTag = newAssetType("tag") + AssetTypeKibanaVisualization = newAssetType("visualization") + AssetTypeSecurityRule = newAssetTypeWithFolder("security-rule", "security_rule") ) // Asset represents a package asset to be loaded into Kibana or Elasticsearch. @@ -68,6 +70,12 @@ func LoadPackageAssets(pkgRootPath string) ([]Asset, error) { return nil, fmt.Errorf("could not load kibana assets: %w", err) } + tags, err := loadKibanaTags(pkgRootPath) + if err != nil { + return nil, fmt.Errorf("could not load kibana tags: %w", err) + } + assets = append(assets, tags...) + a, err := loadElasticsearchAssets(pkgRootPath) if err != nil { return a, fmt.Errorf("could not load elasticsearch assets: %w", err) @@ -85,10 +93,11 @@ func loadKibanaAssets(pkgRootPath string) ([]Asset, error) { assetTypes = []assetTypeFolder{ AssetTypeKibanaDashboard, - AssetTypeKibanaVisualization, - AssetTypeKibanaSavedSearch, - AssetTypeKibanaMap, AssetTypeKibanaLens, + AssetTypeKibanaMap, + AssetTypeKibanaSavedSearch, + AssetTypeKibanaTag, + AssetTypeKibanaVisualization, AssetTypeSecurityRule, } @@ -112,6 +121,34 @@ func loadKibanaAssets(pkgRootPath string) ([]Asset, error) { return assets, nil } +func loadKibanaTags(pkgRootPath string) ([]Asset, error) { + tagsFilePath := filepath.Join(pkgRootPath, "kibana", "tags.yml") + tagsFile, err := os.ReadFile(tagsFilePath) + if errors.Is(err, os.ErrNotExist) { + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("reading tags file failed: %w", err) + } + + type tag struct { + Text string `yaml:"text"` + } + var tags []tag + err = yaml.Unmarshal(tagsFile, &tags) + if err != nil { + return nil, fmt.Errorf("parsing tags file failed: %w", err) + } + + assets := make([]Asset, len(tags)) + for i, tag := range tags { + assets[i].ID = tag.Text + assets[i].Type = AssetTypeKibanaTag.typeName + assets[i].SourcePath = tagsFilePath + } + return assets, nil +} + func loadElasticsearchAssets(pkgRootPath string) ([]Asset, error) { packageManifestPath := filepath.Join(pkgRootPath, PackageManifestFile) pkgManifest, err := ReadPackageManifest(packageManifestPath) diff --git a/internal/testrunner/coverage.go b/internal/testrunner/coverage.go index c4badce219..14023047e3 100644 --- a/internal/testrunner/coverage.go +++ b/internal/testrunner/coverage.go @@ -44,6 +44,11 @@ func GenerateBasePackageCoverageReport(pkgName, rootPath, format string) (Covera return nil } + // Exclude validation configuration from coverage reports. + if d.Name() == "validation.yml" && filepath.Dir(match) == filepath.Clean(rootPath) { + return nil + } + fileCoverage, err := generateBaseFileCoverageReport(repoPath, pkgName, match, format, false) if err != nil { return fmt.Errorf("failed to generate base coverage for \"%s\": %w", match, err) From 95830400219e886e400a42b28e1258e07f7f6683 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Mon, 18 Aug 2025 17:25:55 +0200 Subject: [PATCH 02/11] Add coverage for transforms --- internal/testrunner/runners/system/tester.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/testrunner/runners/system/tester.go b/internal/testrunner/runners/system/tester.go index cc79e81c85..0a42355469 100644 --- a/internal/testrunner/runners/system/tester.go +++ b/internal/testrunner/runners/system/tester.go @@ -2503,6 +2503,8 @@ func (r *tester) generateCoverageReport(pkgName string) (testrunner.CoverageRepo filepath.Join(r.packageRootPath, "fields", "*.yml"), filepath.Join(r.packageRootPath, "data_stream", dsPattern, "manifest.yml"), filepath.Join(r.packageRootPath, "data_stream", dsPattern, "fields", "*.yml"), + filepath.Join(r.packageRootPath, "elasticsearch", "transform", "*", "*.yml"), + filepath.Join(r.packageRootPath, "elasticsearch", "transform", "*", "fields", "*.yml"), } return testrunner.GenerateBaseFileCoverageReportGlob(pkgName, patterns, r.coverageType, true) From bed2f2edb3e3e13e5cf6016edab3b0d0e1f5552d Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 3 Sep 2025 14:43:39 +0200 Subject: [PATCH 03/11] Check all managed tags when one is missing --- internal/kibana/savedobjects.go | 3 ++- internal/packages/assets.go | 8 +++++- internal/testrunner/runners/asset/tester.go | 29 +++++++++++++++++---- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/internal/kibana/savedobjects.go b/internal/kibana/savedobjects.go index 82bc734e65..af54ee2c0f 100644 --- a/internal/kibana/savedobjects.go +++ b/internal/kibana/savedobjects.go @@ -150,9 +150,10 @@ func (c *Client) SetManagedSavedObject(ctx context.Context, savedObjectType stri } type ExportSavedObjectsRequest struct { + Type string `json:"type,omitempty"` ExcludeExportDetails bool `json:"excludeExportDetails"` IncludeReferencesDeep bool `json:"includeReferencesDeep"` - Objects []ExportSavedObjectsRequestObject `json:"objects"` + Objects []ExportSavedObjectsRequestObject `json:"objects,omitempty"` } type ExportSavedObjectsRequestObject struct { diff --git a/internal/packages/assets.go b/internal/packages/assets.go index 64fe5f50e0..68b4599d53 100644 --- a/internal/packages/assets.go +++ b/internal/packages/assets.go @@ -10,6 +10,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "gopkg.in/yaml.v3" @@ -142,13 +143,18 @@ func loadKibanaTags(pkgRootPath string) ([]Asset, error) { assets := make([]Asset, len(tags)) for i, tag := range tags { - assets[i].ID = tag.Text + assets[i].ID = sharedTagID(tag.Text) assets[i].Type = AssetTypeKibanaTag.typeName assets[i].SourcePath = tagsFilePath } return assets, nil } +// sharedTagID tries to mimick tags created by fleet for tags defined in tags.yml. +func sharedTagID(text string) string { + return strings.Join(append(strings.Split(strings.ToLower(text), " "), "default"), "-") +} + func loadElasticsearchAssets(pkgRootPath string) ([]Asset, error) { packageManifestPath := filepath.Join(pkgRootPath, PackageManifestFile) pkgManifest, err := ReadPackageManifest(packageManifestPath) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index d6996e3609..f2b2a6c89e 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -10,6 +10,7 @@ import ( "fmt" "strings" + "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/kibana" "github.com/elastic/elastic-package/internal/logger" "github.com/elastic/elastic-package/internal/packages" @@ -130,6 +131,11 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { } installedAssets := installedPackage.Assets() + installedTags, err := r.kibanaClient.ExportSavedObjects(ctx, kibana.ExportSavedObjectsRequest{Type: "tag"}) + if err != nil { + return result.WithError(fmt.Errorf("cannot get installed tags: %w", err)) + } + // No Elasticsearch asset is created when an Input package is installed through the API. // This would require to create a Agent policy and add that input package to the Agent policy. // As those input packages could have some required fields, it would also require to add @@ -151,14 +157,12 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { TestType: TestType, }) - var tr []testrunner.TestResult - if !findActualAsset(installedAssets, e) { + tr, _ := rc.WithSuccess() + if !findActualAsset(installedAssets, installedTags, e) { tr, _ = rc.WithError(testrunner.ErrTestCaseFailed{ Reason: "could not find expected asset", Details: fmt.Sprintf("could not find %s asset \"%s\". Assets loaded:\n%s", e.Type, e.ID, formatAssetsAsString(installedAssets)), }) - } else { - tr, _ = rc.WithSuccess() } result := tr[0] if r.withCoverage && e.SourcePath != "" { @@ -191,13 +195,28 @@ func (r *tester) TearDown(ctx context.Context) error { return nil } -func findActualAsset(actualAssets []packages.Asset, expectedAsset packages.Asset) bool { +func findActualAsset(actualAssets []packages.Asset, installedTags []common.MapStr, expectedAsset packages.Asset) bool { for _, a := range actualAssets { if a.Type == expectedAsset.Type && a.ID == expectedAsset.ID { return true } } + if expectedAsset.Type == "tag" { + // If we haven't found the asset, and it is a tag, it could be some of the shared tags defined in tags.yml. + for _, tag := range installedTags { + managed, _ := tag.GetValue("managed") + if managed, ok := managed.(bool); !ok || !managed { + continue + } + + id, _ := tag.GetValue("id") + if id, ok := id.(string); ok && id == expectedAsset.ID { + return true + } + } + } + return false } From 611c2207591f5aa0fb2371f2185015eae144691f Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Wed, 3 Sep 2025 17:32:58 +0200 Subject: [PATCH 04/11] Print all installed tags --- internal/testrunner/runners/asset/tester.go | 28 ++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index f2b2a6c89e..c74cdab748 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -8,6 +8,7 @@ import ( "context" "errors" "fmt" + "slices" "strings" "github.com/elastic/elastic-package/internal/common" @@ -161,7 +162,7 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { if !findActualAsset(installedAssets, installedTags, e) { tr, _ = rc.WithError(testrunner.ErrTestCaseFailed{ Reason: "could not find expected asset", - Details: fmt.Sprintf("could not find %s asset \"%s\". Assets loaded:\n%s", e.Type, e.ID, formatAssetsAsString(installedAssets)), + Details: fmt.Sprintf("could not find %s asset \"%s\". Assets loaded:\n%s", e.Type, e.ID, formatAssetsAsString(installedAssets, installedTags)), }) } result := tr[0] @@ -220,10 +221,31 @@ func findActualAsset(actualAssets []packages.Asset, installedTags []common.MapSt return false } -func formatAssetsAsString(assets []packages.Asset) string { +func formatAssetsAsString(assets []packages.Asset, savedObjects []common.MapStr) string { var sb strings.Builder for _, asset := range assets { - sb.WriteString(fmt.Sprintf("- %s\n", asset.String())) + fmt.Fprintf(&sb, "- %s\n", asset.String()) + } + for _, so := range savedObjects { + idValue, _ := so.GetValue("id") + id, ok := idValue.(string) + if !ok { + continue + } + soTypeValue, _ := so.GetValue("type") + soType, ok := soTypeValue.(string) + if !ok { + continue + } + + // Avoid repeating. + if slices.ContainsFunc(assets, func(a packages.Asset) bool { + return a.Type == packages.AssetType(soType) && a.ID == id + }) { + continue + } + + fmt.Fprintf(&sb, "- %s (type: %s)\n", id, soType) } return sb.String() } From dadf4413474439f968ff58b1b6ec091ff433bf47 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 16:52:46 +0200 Subject: [PATCH 05/11] Retry when assets are not found --- internal/packages/assets.go | 20 ++-- internal/testrunner/runners/asset/tester.go | 125 ++++++++++++-------- 2 files changed, 86 insertions(+), 59 deletions(-) diff --git a/internal/packages/assets.go b/internal/packages/assets.go index 68b4599d53..f241548bbf 100644 --- a/internal/packages/assets.go +++ b/internal/packages/assets.go @@ -10,7 +10,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "gopkg.in/yaml.v3" @@ -55,12 +54,24 @@ var ( type Asset struct { ID string `json:"id"` Type AssetType `json:"type"` + Name string DataStream string SourcePath string } +// IDOrName returns the ID if set, or the Name if not. +func (asset Asset) IDOrName() string { + if asset.ID != "" { + return asset.ID + } + return asset.Name +} + // String method returns a string representation of the asset func (asset Asset) String() string { + if asset.ID == "" && asset.Name != "" { + return fmt.Sprintf("%q (type: %s)", asset.Name, asset.Type) + } return fmt.Sprintf("%s (type: %s)", asset.ID, asset.Type) } @@ -143,18 +154,13 @@ func loadKibanaTags(pkgRootPath string) ([]Asset, error) { assets := make([]Asset, len(tags)) for i, tag := range tags { - assets[i].ID = sharedTagID(tag.Text) + assets[i].Name = tag.Text assets[i].Type = AssetTypeKibanaTag.typeName assets[i].SourcePath = tagsFilePath } return assets, nil } -// sharedTagID tries to mimick tags created by fleet for tags defined in tags.yml. -func sharedTagID(text string) string { - return strings.Join(append(strings.Split(strings.ToLower(text), " "), "default"), "-") -} - func loadElasticsearchAssets(pkgRootPath string) ([]Asset, error) { packageManifestPath := filepath.Join(pkgRootPath, PackageManifestFile) pkgManifest, err := ReadPackageManifest(packageManifestPath) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index c74cdab748..b59c8c8c16 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -10,6 +10,7 @@ import ( "fmt" "slices" "strings" + "time" "github.com/elastic/elastic-package/internal/common" "github.com/elastic/elastic-package/internal/kibana" @@ -17,8 +18,11 @@ import ( "github.com/elastic/elastic-package/internal/packages" "github.com/elastic/elastic-package/internal/resources" "github.com/elastic/elastic-package/internal/testrunner" + "github.com/elastic/elastic-package/internal/wait" ) +const assetsPresentTimeout = time.Minute + type tester struct { testFolder testrunner.TestFolder packageRootPath string @@ -126,61 +130,72 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { if err != nil { return result.WithError(fmt.Errorf("cannot read the package manifest from %s: %w", r.packageRootPath, err)) } - installedPackage, err := r.kibanaClient.GetPackage(ctx, manifest.Name) - if err != nil { - return result.WithError(fmt.Errorf("cannot get installed package %q: %w", manifest.Name, err)) - } - installedAssets := installedPackage.Assets() - installedTags, err := r.kibanaClient.ExportSavedObjects(ctx, kibana.ExportSavedObjectsRequest{Type: "tag"}) - if err != nil { - return result.WithError(fmt.Errorf("cannot get installed tags: %w", err)) - } + var results []testrunner.TestResult + _, err = wait.UntilTrue(ctx, func(ctx context.Context) (bool, error) { + installedPackage, err := r.kibanaClient.GetPackage(ctx, manifest.Name) + if err != nil { + results, err = result.WithError(fmt.Errorf("cannot get installed package %q: %w", manifest.Name, err)) + return false, err + } + installedAssets := installedPackage.Assets() - // No Elasticsearch asset is created when an Input package is installed through the API. - // This would require to create a Agent policy and add that input package to the Agent policy. - // As those input packages could have some required fields, it would also require to add - // configuration files as in system tests to fill those fields. - // In these tests, mainly it is required to test Kibana assets, therefore it is not added - // support for Elasticsearch assets in input packages. - // Related issue: https://github.com/elastic/elastic-package/issues/1623 - expectedAssets, err := packages.LoadPackageAssets(r.packageRootPath) - if err != nil { - return result.WithError(fmt.Errorf("could not load expected package assets: %w", err)) - } + installedTags, err := r.kibanaClient.ExportSavedObjects(ctx, kibana.ExportSavedObjectsRequest{Type: "tag"}) + if err != nil { + results, err = result.WithError(fmt.Errorf("cannot get installed tags: %w", err)) + return false, err + } - results := make([]testrunner.TestResult, 0, len(expectedAssets)) - for _, e := range expectedAssets { - rc := testrunner.NewResultComposer(testrunner.TestResult{ - Name: fmt.Sprintf("%s %s is loaded", e.Type, e.ID), - Package: r.testFolder.Package, - DataStream: e.DataStream, - TestType: TestType, - }) - - tr, _ := rc.WithSuccess() - if !findActualAsset(installedAssets, installedTags, e) { - tr, _ = rc.WithError(testrunner.ErrTestCaseFailed{ - Reason: "could not find expected asset", - Details: fmt.Sprintf("could not find %s asset \"%s\". Assets loaded:\n%s", e.Type, e.ID, formatAssetsAsString(installedAssets, installedTags)), - }) + // No Elasticsearch asset is created when an Input package is installed through the API. + // This would require to create a Agent policy and add that input package to the Agent policy. + // As those input packages could have some required fields, it would also require to add + // configuration files as in system tests to fill those fields. + // In these tests, mainly it is required to test Kibana assets, therefore it is not added + // support for Elasticsearch assets in input packages. + // Related issue: https://github.com/elastic/elastic-package/issues/1623 + expectedAssets, err := packages.LoadPackageAssets(r.packageRootPath) + if err != nil { + results, err = result.WithError(fmt.Errorf("could not load expected package assets: %w", err)) + return false, err } - result := tr[0] - if r.withCoverage && e.SourcePath != "" { - result.Coverage, err = testrunner.GenerateBaseFileCoverageReport(rc.CoveragePackageName(), e.SourcePath, r.coverageType, true) - if err != nil { + + results = make([]testrunner.TestResult, 0, len(expectedAssets)) + success := true + for _, e := range expectedAssets { + rc := testrunner.NewResultComposer(testrunner.TestResult{ + Name: fmt.Sprintf("%s %s is loaded", e.Type, e.IDOrName()), + Package: r.testFolder.Package, + DataStream: e.DataStream, + TestType: TestType, + }) + + tr, _ := rc.WithSuccess() + if !findActualAsset(installedAssets, installedTags, e) { tr, _ = rc.WithError(testrunner.ErrTestCaseFailed{ - Reason: "could not generate test coverage", - Details: fmt.Sprintf("could not generate test coverage for asset in %s: %v", e.SourcePath, err), + Reason: "could not find expected asset", + Details: fmt.Sprintf("could not find %s asset \"%s\". Assets loaded:\n%s", e.Type, e.IDOrName(), formatAssetsAsString(installedAssets, installedTags)), }) - result = tr[0] + success = false + } + result := tr[0] + if r.withCoverage && e.SourcePath != "" { + result.Coverage, err = testrunner.GenerateBaseFileCoverageReport(rc.CoveragePackageName(), e.SourcePath, r.coverageType, true) + if err != nil { + tr, _ = rc.WithError(testrunner.ErrTestCaseFailed{ + Reason: "could not generate test coverage", + Details: fmt.Sprintf("could not generate test coverage for asset in %s: %v", e.SourcePath, err), + }) + result = tr[0] + } + success = false } - } - results = append(results, result) - } + results = append(results, result) + } + return success, nil + }, time.Second, assetsPresentTimeout) - return results, nil + return results, err } func (r *tester) TearDown(ctx context.Context) error { @@ -196,23 +211,29 @@ func (r *tester) TearDown(ctx context.Context) error { return nil } -func findActualAsset(actualAssets []packages.Asset, installedTags []common.MapStr, expectedAsset packages.Asset) bool { +func findActualAsset(actualAssets []packages.Asset, savedObjects []common.MapStr, expectedAsset packages.Asset) bool { for _, a := range actualAssets { if a.Type == expectedAsset.Type && a.ID == expectedAsset.ID { return true } } - if expectedAsset.Type == "tag" { - // If we haven't found the asset, and it is a tag, it could be some of the shared tags defined in tags.yml. - for _, tag := range installedTags { + if expectedAsset.Type == "tag" && expectedAsset.ID == "" { + // If we haven't found the asset, and it is a tag, it could be some of the shared + // tags defined in tags.yml, whose id can be unpredictable, so check by name. + for _, tag := range savedObjects { managed, _ := tag.GetValue("managed") if managed, ok := managed.(bool); !ok || !managed { continue } - id, _ := tag.GetValue("id") - if id, ok := id.(string); ok && id == expectedAsset.ID { + soType, _ := tag.GetValue("type") + if soType, ok := soType.(string); !ok || soType != "tag" { + continue + } + + name, _ := tag.GetValue("attributes.name") + if name, ok := name.(string); ok && name == expectedAsset.Name { return true } } From 039273fa6b57913a40f70cfceeeb4d3104321f7a Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 17:26:26 +0200 Subject: [PATCH 06/11] Assume tags without assets would have been installed --- internal/testrunner/runners/asset/tester.go | 5 + .../other/tags_without_assets/LICENSE.txt | 202 ++++++++++++++++++ .../_dev/build/docs/README.md | 119 +++++++++++ .../other/tags_without_assets/changelog.yml | 6 + .../other/tags_without_assets/docs/README.md | 121 +++++++++++ .../tags_without_assets/img/sample-logo.svg | 1 + .../img/sample-screenshot.png | Bin 0 -> 18849 bytes .../other/tags_without_assets/kibana/tags.yml | 13 ++ .../other/tags_without_assets/manifest.yml | 36 ++++ .../tags_without_assets/sample_event.json | 3 + 10 files changed, 506 insertions(+) create mode 100644 test/packages/other/tags_without_assets/LICENSE.txt create mode 100644 test/packages/other/tags_without_assets/_dev/build/docs/README.md create mode 100644 test/packages/other/tags_without_assets/changelog.yml create mode 100644 test/packages/other/tags_without_assets/docs/README.md create mode 100644 test/packages/other/tags_without_assets/img/sample-logo.svg create mode 100644 test/packages/other/tags_without_assets/img/sample-screenshot.png create mode 100644 test/packages/other/tags_without_assets/kibana/tags.yml create mode 100644 test/packages/other/tags_without_assets/manifest.yml create mode 100644 test/packages/other/tags_without_assets/sample_event.json diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index b59c8c8c16..c23882fb43 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -221,6 +221,11 @@ func findActualAsset(actualAssets []packages.Asset, savedObjects []common.MapStr if expectedAsset.Type == "tag" && expectedAsset.ID == "" { // If we haven't found the asset, and it is a tag, it could be some of the shared // tags defined in tags.yml, whose id can be unpredictable, so check by name. + if len(actualAssets) == 0 { + // If there are no assets, the tag may not be installed, so assume it would have been. + // TODO: More accurately we should check if any of the listed tags in `tags.yml` is present. + return true + } for _, tag := range savedObjects { managed, _ := tag.GetValue("managed") if managed, ok := managed.(bool); !ok || !managed { diff --git a/test/packages/other/tags_without_assets/LICENSE.txt b/test/packages/other/tags_without_assets/LICENSE.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/test/packages/other/tags_without_assets/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/test/packages/other/tags_without_assets/_dev/build/docs/README.md b/test/packages/other/tags_without_assets/_dev/build/docs/README.md new file mode 100644 index 0000000000..df71d09a81 --- /dev/null +++ b/test/packages/other/tags_without_assets/_dev/build/docs/README.md @@ -0,0 +1,119 @@ + + +# Package with tags and without assets Integration for Elastic + +## Overview + + +The Package with tags and without assets integration for Elastic enables collection of ... +This integration facilitates ... + +### Compatibility + + +This integration is compatible with ... + +### How it works + + + +## What data does this integration collect? + + +The Package with tags and without assets integration collects log messages of the following types: +* ... + +### Supported use cases + + + +## What do I need to use this integration? + + + +## How do I deploy this integration? + +### Agent-based deployment + +Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host. + +Elastic Agent is required to stream data from the syslog or log file receiver and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines. + + + + +### Onboard / configure + + + +### Validation + + + +## Troubleshooting + +For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). + + + +## Scaling + +For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation. + + + +## Reference + + + + + + + + + + +### Inputs used + + +These inputs can be used with this integration: +(Remove the spaces between curly braces when using) +{ { inputDocs } } + +### API usage + + +These APIs are used with this integration: +* ... diff --git a/test/packages/other/tags_without_assets/changelog.yml b/test/packages/other/tags_without_assets/changelog.yml new file mode 100644 index 0000000000..bb0320a524 --- /dev/null +++ b/test/packages/other/tags_without_assets/changelog.yml @@ -0,0 +1,6 @@ +# newer versions go on top +- version: "0.0.1" + changes: + - description: Initial draft of the package + type: enhancement + link: https://github.com/elastic/integrations/pull/1 # FIXME Replace with the real PR link diff --git a/test/packages/other/tags_without_assets/docs/README.md b/test/packages/other/tags_without_assets/docs/README.md new file mode 100644 index 0000000000..d98fab0e3e --- /dev/null +++ b/test/packages/other/tags_without_assets/docs/README.md @@ -0,0 +1,121 @@ + + + + +# Package with tags and without assets Integration for Elastic + +## Overview + + +The Package with tags and without assets integration for Elastic enables collection of ... +This integration facilitates ... + +### Compatibility + + +This integration is compatible with ... + +### How it works + + + +## What data does this integration collect? + + +The Package with tags and without assets integration collects log messages of the following types: +* ... + +### Supported use cases + + + +## What do I need to use this integration? + + + +## How do I deploy this integration? + +### Agent-based deployment + +Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host. + +Elastic Agent is required to stream data from the syslog or log file receiver and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines. + + + + +### Onboard / configure + + + +### Validation + + + +## Troubleshooting + +For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). + + + +## Scaling + +For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation. + + + +## Reference + + + + + + + + + + +### Inputs used + + +These inputs can be used with this integration: +(Remove the spaces between curly braces when using) +{ { inputDocs } } + +### API usage + + +These APIs are used with this integration: +* ... diff --git a/test/packages/other/tags_without_assets/img/sample-logo.svg b/test/packages/other/tags_without_assets/img/sample-logo.svg new file mode 100644 index 0000000000..6268dd88f3 --- /dev/null +++ b/test/packages/other/tags_without_assets/img/sample-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/packages/other/tags_without_assets/img/sample-screenshot.png b/test/packages/other/tags_without_assets/img/sample-screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..d7a56a3ecc078c38636698cefba33f86291dd178 GIT binary patch literal 18849 zcmeEu^S~#!E#4Tq;}?6chqwB{?k=6jc5D4>l%v(rleJ2Y%tW zDj9g7px}|*e;{M?LDwiK3@FNS(lDRTd-MJYIyUJCN948~OJk1M(DrJyI#iV;P4k~& zFZo35IfQt0RwlUN`48^6(1dv_wm(y1xhEdMld=Y?!%u=fPT_*{3( zwBwz3#qR}_)t>C*jp5@U)Ti~B)Y;qq*TRxZJ7ZRN_^A3TDAEM*@7Ve%(Ro7=1%1B< zVj6GBUTxXev>_^SFA zgKZ=g4aTS}9>Ofj7cSB0WO?gQ)x=+!hs_)b$6#>ScFZ>XAoIX)%Bc|BDC~JFBk0f0 z0NY}6gb)&!qx^FWC(!ji+Kl$V$2|ocA=vN0TM0Y`U?t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R@?L=RCSmKMJ5UQJQ`X!i~(gD*P! zs`RobzJG3Ra_Pg+WZUXUmMU$ilpwfcEti6)mw(~MZ0q!^sza>#jv!-+7B6F3QuMWg zVO!rXwD+lF1BBTito?ml-CV3vxuek~TKuOX^N6sol$v*{_%nAuD7i81eXm^Lz(Z~I z2Xj_Dts#G0&C;PV_Wkq*1QvB7+Post4={v;gk7b9u%#DC_bh(iJm$rqog^{JEx6NE zrs5^2SEL$|98#2WV#iG@L6cq|)SuTMSfGocPl65wUd^|5Lbpnb(;t>-Qu2jvANLgv zdte0vED-3C@^BdyHWLL(7{G$WA02z@JG!T-U^Q7HZ(7Bs&vchkh(p&}KvnS{MG^i6 z4r){gJp9p7WyWOEiKA2Cm6EXIn&&gk|Fc6^78OpPrX4ExCFE=SD$xcH;C2eB^{XTI zaxz_Cef*Yj==w_i_BTGXP;8C&f? z*QEM>={jFM8)lWAR870pG4XEWsl%%K|82S5b=9hVz7p_6i-d(Iyvq76&a#PV zR;VbQV|n?mg}&(ehClg%tK%IjgtnTR-u)lxH06XxXqH0soAZbB_Rm)XX=6Nge1uoG7 z9vQM_S~2h53n|W`y{{R9+=08rv~MohI_v4-BU^7fZ0-A}#b5{AOSTJm+(J;9yw%pD zX6u62GJ&@HKX5zQwq~j8T!Hrv-Mk^QSB5cu09L03{ToDO7jikM0WAcsjW>D}^jqCF zT0DEZ@K^KO_MD*%M!+V)lGVU6?LpX)eQVXEmq}R`NIJv;kBitJ!nW?0OxTVlu2ADf zE{A!*0g3%nwVcBD+AgT5bGx@WOnQk{zRpiZ4HhP`3BF%N|HdqPbbiV5)7x)kzC3ID zZ;27>0^mrMgWc7evsbQY`l`l})wr+e;=8U_!2&B77;1qL!N8y)eTJ2lf#CvhR~!Qa mc;sM|90DP5A*JW%f2r=u1xt!e4gwD_V(@hJb6Mw<&;$SznOm^{ literal 0 HcmV?d00001 diff --git a/test/packages/other/tags_without_assets/kibana/tags.yml b/test/packages/other/tags_without_assets/kibana/tags.yml new file mode 100644 index 0000000000..c6e5a5bdfe --- /dev/null +++ b/test/packages/other/tags_without_assets/kibana/tags.yml @@ -0,0 +1,13 @@ +- text: Security Solution + asset_types: + - search + asset_ids: + - system-0d3f2380-fa78-11e6-ae9b-81e5311e8cab + - system-71f720f0-ff18-11e9-8405-516218e3d268 + - system-5517a150-f9ce-11e6-8115-a7c18106d86a + - system-277876d0-fa2c-11e6-bbd3-29c986c96e5a + - system-bae11b00-9bfc-11ea-87e4-49f31ec44891 + - system-bb858830-f412-11e9-8405-516218e3d268 + - system-d401ef40-a7d5-11e9-a422-d144027429da + - system-Windows-Dashboard + - system-Logs-syslog-dashboard diff --git a/test/packages/other/tags_without_assets/manifest.yml b/test/packages/other/tags_without_assets/manifest.yml new file mode 100644 index 0000000000..65220da9e6 --- /dev/null +++ b/test/packages/other/tags_without_assets/manifest.yml @@ -0,0 +1,36 @@ +format_version: 3.4.1 +name: tags_without_assets +title: "Package with tags and without assets" +version: 0.0.1 +source: + license: "Apache-2.0" +description: "This is a package that has a tags.yml file, but doesn't have assets." +type: integration +categories: + - custom +conditions: + kibana: + version: "^9.1.3" + elastic: + subscription: "basic" +screenshots: + - src: /img/sample-screenshot.png + title: Sample screenshot + size: 600x600 + type: image/png +icons: + - src: /img/sample-logo.svg + title: Sample logo + size: 32x32 + type: image/svg+xml +policy_templates: + - name: sample + title: Sample logs + description: Collect sample logs + inputs: + - type: logfile + title: Collect sample logs from instances + description: Collecting sample logs +owner: + github: elastic/ecosystem + type: elastic diff --git a/test/packages/other/tags_without_assets/sample_event.json b/test/packages/other/tags_without_assets/sample_event.json new file mode 100644 index 0000000000..d668d56022 --- /dev/null +++ b/test/packages/other/tags_without_assets/sample_event.json @@ -0,0 +1,3 @@ +{ + "description": "This is an example sample-event for Package with tags and without assets. Replace it with a real sample event. Hint: If system tests exist, running `elastic-package test system --generate` will generate this file." +} From 6e92ed6b86c83b06b15e2a9663037eb311c6a796 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 17:31:39 +0200 Subject: [PATCH 07/11] Fix comment --- internal/testrunner/runners/asset/tester.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index c23882fb43..0d1b4dce45 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -223,7 +223,7 @@ func findActualAsset(actualAssets []packages.Asset, savedObjects []common.MapStr // tags defined in tags.yml, whose id can be unpredictable, so check by name. if len(actualAssets) == 0 { // If there are no assets, the tag may not be installed, so assume it would have been. - // TODO: More accurately we should check if any of the listed tags in `tags.yml` is present. + // TODO: More accurately we should check if any of the listed objects in `tags.yml` is present. return true } for _, tag := range savedObjects { From 0e89dca7a04d6cb2295fcc7e50ba92bffebf346c Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 18:04:23 +0200 Subject: [PATCH 08/11] Remove most of the content in README in test package --- .../_dev/build/docs/README.md | 119 ----------------- .../other/tags_without_assets/docs/README.md | 122 +----------------- 2 files changed, 2 insertions(+), 239 deletions(-) delete mode 100644 test/packages/other/tags_without_assets/_dev/build/docs/README.md diff --git a/test/packages/other/tags_without_assets/_dev/build/docs/README.md b/test/packages/other/tags_without_assets/_dev/build/docs/README.md deleted file mode 100644 index df71d09a81..0000000000 --- a/test/packages/other/tags_without_assets/_dev/build/docs/README.md +++ /dev/null @@ -1,119 +0,0 @@ - - -# Package with tags and without assets Integration for Elastic - -## Overview - - -The Package with tags and without assets integration for Elastic enables collection of ... -This integration facilitates ... - -### Compatibility - - -This integration is compatible with ... - -### How it works - - - -## What data does this integration collect? - - -The Package with tags and without assets integration collects log messages of the following types: -* ... - -### Supported use cases - - - -## What do I need to use this integration? - - - -## How do I deploy this integration? - -### Agent-based deployment - -Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host. - -Elastic Agent is required to stream data from the syslog or log file receiver and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines. - - - - -### Onboard / configure - - - -### Validation - - - -## Troubleshooting - -For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). - - - -## Scaling - -For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation. - - - -## Reference - - - - - - - - - - -### Inputs used - - -These inputs can be used with this integration: -(Remove the spaces between curly braces when using) -{ { inputDocs } } - -### API usage - - -These APIs are used with this integration: -* ... diff --git a/test/packages/other/tags_without_assets/docs/README.md b/test/packages/other/tags_without_assets/docs/README.md index d98fab0e3e..1456af2020 100644 --- a/test/packages/other/tags_without_assets/docs/README.md +++ b/test/packages/other/tags_without_assets/docs/README.md @@ -1,121 +1,3 @@ - - - - -# Package with tags and without assets Integration for Elastic - -## Overview - - -The Package with tags and without assets integration for Elastic enables collection of ... -This integration facilitates ... - -### Compatibility - - -This integration is compatible with ... - -### How it works - - - -## What data does this integration collect? - - -The Package with tags and without assets integration collects log messages of the following types: -* ... - -### Supported use cases - - - -## What do I need to use this integration? - - - -## How do I deploy this integration? - -### Agent-based deployment - -Elastic Agent must be installed. For more details, check the Elastic Agent [installation instructions](docs-content://reference/fleet/install-elastic-agents.md). You can install only one Elastic Agent per host. - -Elastic Agent is required to stream data from the syslog or log file receiver and ship the data to Elastic, where the events will then be processed via the integration's ingest pipelines. - - - - -### Onboard / configure - - - -### Validation - - - -## Troubleshooting - -For help with Elastic ingest tools, check [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). - - - -## Scaling - -For more information on architectures that can be used for scaling this integration, check the [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures) documentation. - - - -## Reference - - - - - - - - - - -### Inputs used - - -These inputs can be used with this integration: -(Remove the spaces between curly braces when using) -{ { inputDocs } } - -### API usage - - -These APIs are used with this integration: -* ... +This package as a tags.yml file, but no asset where the tag can be applied. From 9dfb308d2fbd324de0efacec6541fa2ff94a474e Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 20:06:22 +0200 Subject: [PATCH 09/11] Print also the tag name when available --- internal/testrunner/runners/asset/tester.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index 0d1b4dce45..6300453709 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -226,18 +226,18 @@ func findActualAsset(actualAssets []packages.Asset, savedObjects []common.MapStr // TODO: More accurately we should check if any of the listed objects in `tags.yml` is present. return true } - for _, tag := range savedObjects { - managed, _ := tag.GetValue("managed") + for _, so := range savedObjects { + managed, _ := so.GetValue("managed") if managed, ok := managed.(bool); !ok || !managed { continue } - soType, _ := tag.GetValue("type") + soType, _ := so.GetValue("type") if soType, ok := soType.(string); !ok || soType != "tag" { continue } - name, _ := tag.GetValue("attributes.name") + name, _ := so.GetValue("attributes.name") if name, ok := name.(string); ok && name == expectedAsset.Name { return true } @@ -271,7 +271,12 @@ func formatAssetsAsString(assets []packages.Asset, savedObjects []common.MapStr) continue } - fmt.Fprintf(&sb, "- %s (type: %s)\n", id, soType) + name, _ := so.GetValue("attributes.name") + if name, ok := name.(string); ok && name != "" { + fmt.Fprintf(&sb, "- %s (name: %q, type: %s)\n", id, name, soType) + } else { + fmt.Fprintf(&sb, "- %s (type: %s)\n", id, soType) + } } return sb.String() } From cb95d65b3ea49cc39fb2bd5de402369bec2a34e9 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Fri, 5 Sep 2025 22:13:07 +0200 Subject: [PATCH 10/11] Tags are not managed in older versions --- internal/testrunner/runners/asset/tester.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/testrunner/runners/asset/tester.go b/internal/testrunner/runners/asset/tester.go index 6300453709..ac7a3024d7 100644 --- a/internal/testrunner/runners/asset/tester.go +++ b/internal/testrunner/runners/asset/tester.go @@ -192,6 +192,7 @@ func (r *tester) run(ctx context.Context) ([]testrunner.TestResult, error) { results = append(results, result) } + return success, nil }, time.Second, assetsPresentTimeout) @@ -227,11 +228,6 @@ func findActualAsset(actualAssets []packages.Asset, savedObjects []common.MapStr return true } for _, so := range savedObjects { - managed, _ := so.GetValue("managed") - if managed, ok := managed.(bool); !ok || !managed { - continue - } - soType, _ := so.GetValue("type") if soType, ok := soType.(string); !ok || soType != "tag" { continue From 3a9d6072ec5ff1f0a1d7ace8089ec30c2840ad87 Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Thu, 11 Sep 2025 18:17:28 +0200 Subject: [PATCH 11/11] Add more test cases --- .../foo/agent/stream/filestream.yml.hbs | 44 +++ .../elasticsearch/ingest_pipeline/default.yml | 10 + .../data_stream/foo/fields/base-fields.yml | 12 + .../data_stream/foo/manifest.yml | 252 ++++++++++++++++++ 4 files changed, 318 insertions(+) create mode 100644 test/packages/other/tags_without_assets/data_stream/foo/agent/stream/filestream.yml.hbs create mode 100644 test/packages/other/tags_without_assets/data_stream/foo/elasticsearch/ingest_pipeline/default.yml create mode 100644 test/packages/other/tags_without_assets/data_stream/foo/fields/base-fields.yml create mode 100644 test/packages/other/tags_without_assets/data_stream/foo/manifest.yml diff --git a/test/packages/other/tags_without_assets/data_stream/foo/agent/stream/filestream.yml.hbs b/test/packages/other/tags_without_assets/data_stream/foo/agent/stream/filestream.yml.hbs new file mode 100644 index 0000000000..3bede63284 --- /dev/null +++ b/test/packages/other/tags_without_assets/data_stream/foo/agent/stream/filestream.yml.hbs @@ -0,0 +1,44 @@ +paths: +{{#each paths as |path|}} + - {{path}} +{{/each}} +{{#if exclude_files}} +prospector.scanner.exclude_files: +{{#each exclude_files as |pattern f|}} + - {{pattern}} +{{/each}} +{{/if}} +{{#if multiline_json}} +multiline.pattern: '^{' +multiline.negate: true +multiline.match: after +multiline.max_lines: 5000 +multiline.timeout: 10 +{{/if}} +{{#if custom}} +{{custom}} +{{/if}} + +{{#if tags.length}} +tags: +{{#each tags as |tag|}} +- {{tag}} +{{/each}} +{{#if preserve_original_event}} +- preserve_original_event +{{/if}} +{{else}} +{{#if preserve_original_event}} +tags: +- preserve_original_event +{{/if}} +{{/if}} + +{{#contains "forwarded" tags}} +publisher_pipeline.disable_host: true +{{/contains}} + +{{#if processors}} +processors: +{{processors}} +{{/if}} \ No newline at end of file diff --git a/test/packages/other/tags_without_assets/data_stream/foo/elasticsearch/ingest_pipeline/default.yml b/test/packages/other/tags_without_assets/data_stream/foo/elasticsearch/ingest_pipeline/default.yml new file mode 100644 index 0000000000..1a308fded0 --- /dev/null +++ b/test/packages/other/tags_without_assets/data_stream/foo/elasticsearch/ingest_pipeline/default.yml @@ -0,0 +1,10 @@ +--- +description: Pipeline for processing sample logs +processors: +- set: + field: sample_field + value: "1" +on_failure: +- set: + field: error.message + value: '{{ _ingest.on_failure_message }}' diff --git a/test/packages/other/tags_without_assets/data_stream/foo/fields/base-fields.yml b/test/packages/other/tags_without_assets/data_stream/foo/fields/base-fields.yml new file mode 100644 index 0000000000..7c798f4534 --- /dev/null +++ b/test/packages/other/tags_without_assets/data_stream/foo/fields/base-fields.yml @@ -0,0 +1,12 @@ +- name: data_stream.type + type: constant_keyword + description: Data stream type. +- name: data_stream.dataset + type: constant_keyword + description: Data stream dataset. +- name: data_stream.namespace + type: constant_keyword + description: Data stream namespace. +- name: '@timestamp' + type: date + description: Event timestamp. diff --git a/test/packages/other/tags_without_assets/data_stream/foo/manifest.yml b/test/packages/other/tags_without_assets/data_stream/foo/manifest.yml new file mode 100644 index 0000000000..a663948854 --- /dev/null +++ b/test/packages/other/tags_without_assets/data_stream/foo/manifest.yml @@ -0,0 +1,252 @@ +title: "Just an empty data stream" +type: logs +streams: + - input: filestream + title: "logs via filestream" + description: |- + Collect logs with filestream + template_path: filestream.yml.hbs + vars: + - name: paths + type: text + title: "Paths" + multi: true + required: true + show_user: true + default: + - /var/log/*.log + - name: data_stream.dataset + type: text + title: "Dataset name" + description: |- + Dataset to write data to. Changing the dataset will send the data to a different index. You can't use `-` in the name of a dataset and only valid characters for [Elasticsearch index names](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html). + required: true + show_user: true + default: filestream.generic + - name: pipeline + type: text + title: "Ingest Pipeline" + description: |- + The Ingest Node pipeline ID to be used by the integration. + show_user: true + - name: parsers + type: yaml + title: "Parsers" + description: |- + This option expects a list of parsers that the log line has to go through. For more information see [Parsers](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#_parsers) + show_user: true + default: "" + #- ndjson: + # target: "" + # message_key: msg + #- multiline: + # type: count + # count_lines: 3 + - name: exclude_files + type: text + title: "Exclude Files" + description: |- + A list of regular expressions to match the files that you want Elastic Agent to ignore. By default no files are excluded. + multi: true + show_user: true + default: + - \.gz$ + - name: include_files + type: text + title: "Include Files" + description: |- + A list of regular expressions to match the files that you want Elastic Agent to include. If a list of regexes is provided, only the files that are allowed by the patterns are harvested. + multi: true + show_user: true + - name: processors + type: yaml + title: "Processors" + description: |- + Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the logs are parsed. See [Processors](https://www.elastic.co/guide/en/beats/filebeat/current/filtering-and-enhancing-data.html) for details. + - name: tags + type: text + title: "Tags" + description: |- + Tags to include in the published event + multi: true + show_user: true + - name: encoding + type: text + title: "Encoding" + description: |- + The file encoding to use for reading data that contains international characters. For a full list of valid encodings, see the [Documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#_encoding_2) + - name: recursive_glob + type: bool + title: "Recursive Glob" + description: |- + Enable expanding `**` into recursive glob patterns. With this feature enabled, the rightmost `**` in each path is expanded into a fixed number of glob patterns. For example: `/foo/**` expands to `/foo`, `/foo/*`, `/foo/*/*`, and so on. If enabled it expands a single `**` into a 8-level deep `*` pattern. + This feature is enabled by default. Set prospector.scanner.recursive_glob to false to disable it. + default: true + - name: symlinks + type: bool + title: "Enable symlinks" + description: |- + The symlinks option allows Elastic Agent to harvest symlinks in addition to regular files. When harvesting symlinks, Elastic Agent opens and reads the original file even though it reports the path of the symlink. + **Because this option may lead to data loss, it is disabled by default.** + - name: resend_on_touch + type: bool + title: "Resend on touch" + description: |- + If this option is enabled a file is resent if its size has not changed but its modification time has changed to a later time than before. It is disabled by default to avoid accidentally resending files. + - name: check_interval + type: text + title: "Check Interval" + description: |- + How often Elastic Agent checks for new files in the paths that are specified for harvesting. For example Specify 1s to scan the directory as frequently as possible without causing Elastic Agent to scan too frequently. **We do not recommend to set this value <1s.** + - name: ignore_older + type: text + title: "Ignore Older" + description: |- + If this option is enabled, Elastic Agent ignores any files that were modified before the specified timespan. You can use time strings like 2h (2 hours) and 5m (5 minutes). The default is 0, which disables the setting. + You must set Ignore Older to be greater than On State Change Inactive. + For more information, please see the [Documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#filebeat-input-filestream-ignore-older) + - name: ignore_inactive + type: text + title: "Ignore Inactive" + description: |- + If this option is enabled, Elastic Agent ignores every file that has not been updated since the selected time. Possible options are since_first_start and since_last_start. + - name: close_on_state_changed_inactive + type: text + title: "Close on State Changed Inactive" + description: |- + When this option is enabled, Elastic Agent closes the file handle if a file has not been harvested for the specified duration. The counter for the defined period starts when the last log line was read by the harvester. It is not based on the modification time of the file. If the closed file changes again, a new harvester is started and the latest changes will be picked up after Check Interval has elapsed. + - name: close_on_state_changed_renamed + type: bool + title: "Close on State Changed Renamed" + description: |- + **Only use this option if you understand that data loss is a potential side effect.** + When this option is enabled, Elastic Agent closes the file handler when a file is renamed. This happens, for example, when rotating files. By default, the harvester stays open and keeps reading the file because the file handler does not depend on the file name. + - name: close_on_state_changed_removed + type: bool + title: "Close on State Changed Removed" + description: |- + When this option is enabled, Elastic Agent closes the harvester when a file is removed. Normally a file should only be removed after it’s inactive for the duration specified by close.on_state_change.inactive. + - name: close_reader_eof + type: bool + title: "Close Reader EOF" + description: |- + **Only use this option if you understand that data loss is a potential side effect.** + When this option is enabled, Elastic Agent closes a file as soon as the end of a file is reached. This is useful when your files are only written once and not updated from time to time. For example, this happens when you are writing every single log event to a new file. This option is disabled by default. + - name: close_reader_after_interval + type: text + title: "Close Reader After Interval" + description: |- + **Only use this option if you understand that data loss is a potential side effect. Another side effect is that multiline events might not be completely sent before the timeout expires.** + This option is particularly useful in case the output is blocked, which makes Elastic Agent keep open file handlers even for files that were deleted from the disk. + For more information see the [documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#filebeat-input-filestream-close-timeout). + - name: clean_inactive + type: text + title: "Clean Inactive" + description: |- + **Only use this option if you understand that data loss is a potential side effect.** + When this option is enabled, Elastic Agent removes the state of a file after the specified period of inactivity has elapsed. + E.g: "30m", Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". By default cleaning inactive states is disabled, -1 is used to disable it. + default: -1 + - name: clean_removed + type: bool + title: "Clean Removed" + description: |- + When this option is enabled, Elastic Agent cleans files from the registry if they cannot be found on disk anymore under the last known name. + **You must disable this option if you also disable Close Removed.** + - name: harvester_limit + type: integer + title: "Harvester Limit" + description: |- + The harvester_limit option limits the number of harvesters + that are started in parallel for one input. This directly + relates to the maximum number of file handlers that are + opened. The default is 0 (no limit). + default: 0 + - name: backoff_init + type: text + title: "Backoff Init" + description: |- + The backoff option defines how long Elastic Agent waits before checking a file again after EOF is reached. The default is 1s. + - name: backoff_max + type: text + title: "Backoff Max" + description: |- + The maximum time for Elastic Agent to wait before checking a file again after EOF is reached. The default is 10s. + **Requirement: Set Backoff Max to be greater than or equal to Backoff Init and less than or equal to Check Interval (Backoff Init <= Backoff Max <= Check Interval).** + - name: fingerprint + type: bool + title: "File identity: Fingerprint" + description: |- + **Changing file_identity methods between runs may result in + duplicated events in the output.** + Uses a fingerprint generated from the first few bytes (1k is + the default, this can be configured via Fingerprint offset + and length) to identify a file instead inode + device ID. + Refer to https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-filestream.html#_file_identity_2 + for more details. If this option is disabled (and 'Native + file identity is not enabled'), Elastic-Agent < 9.0.0 will + use Native as the file identity, and >= 9.0.0 will use + Fingerprint with the default offset and length. + default: true + - name: fingerprint_offset + type: integer + title: "File identity: Fingerprint offset" + description: |- + Offset from the beginning of the file to start calculating + the fingerprint. The default is 0. Only used when the + fingerprint file identity is selected + default: 0 + - name: fingerprint_length + type: integer + title: "File identity: Fingerprint length" + description: |- + The number of bytes used to calculate the fingerprint. The + default is 1024. Only used when the fingerprint file + identity is selected. + default: 1024 + - name: file_identity_native + type: bool + title: "File identity: Native" + description: |- + **Changing file_identity methods between runs may result in + duplicated events in the output.** + Uses a native identifier for files, on most Unix-like + file systems this is the inode + device ID. On file systems + that do not support inode, the native equivalent is used. + If you enable this option you **MUST disable Fingerprint + file identity**. Refer to + https://www.elastic.co/docs/reference/beats/filebeat/filebeat-input-filestream + for more details. + default: false + - name: rotation_external_strategy_copytruncate + type: yaml + title: "Rotation Strategy" + description: "If the log rotating application copies the contents of the active file and then truncates the original file, use these options to help Elastic Agent to read files correctly.\nSet the option suffix_regex so Elastic Agent can tell active and rotated files apart. \nThere are two supported suffix types in the input: numberic and date." + - name: exclude_lines + type: text + title: "Exclude Lines" + description: |- + A list of regular expressions to match the lines that you want Elastic Agent to exclude. Elastic Agent drops any lines that match a regular expression in the list. By default, no lines are dropped. Empty lines are ignored. + multi: true + - name: include_lines + type: text + title: "Include Lines" + description: |- + A list of regular expressions to match the lines that you want Elastic Agent to include. Elastic Agent exports only the lines that match a regular expression in the list. By default, all lines are exported. Empty lines are ignored. + multi: true + - name: buffer_size + type: text + title: "Buffer Size" + description: |- + The size in bytes of the buffer that each harvester uses when fetching a file. The default is 16384. + - name: message_max_bytes + type: text + title: "Message Max Bytes" + description: |- + The maximum number of bytes that a single log message can have. All bytes after mesage_max_bytes are discarded and not sent. The default is 10MB (10485760). + - name: condition + type: text + title: "Condition" + description: |- + Condition to filter when to collect this input. See [Dynamic Input Configuration](https://www.elastic.co/guide/en/fleet/current/dynamic-input-configuration.html) for details. + show_user: true