Skip to content

[Change Proposal] Add validation to avoid duplicate tags #977

@jsoriano

Description

@jsoriano

Packages have two ways of defining Kibana tags:

  • Directly as a saved object under kibana/tag. These are used for package-specific tags.
  • Using the kibana/tags.yml file, that is intended for shared tags, and includes rules about what saved objects to reference with this tag. It is created when needed if it doesn't exist yet.

Packages can currently define the same tag using both methods, what leads to having the same tag multiple times, for example for Crowdstrike:

Not sure, but it might be also possible to duplicate a tag if defined twice with the same name but different ids under kibana/tag.

Some tasks here:

  • Add a validation rule that ensures that each tag is defined only once in each package. Two tags are the same when defined in a package if they have the same name, even if they have different ids.
    Shared tags should have preference, so if a package is defined under kibana/tag and tags.yml, the error should point to the definition in kibana/tag.
  • When exporting resources with elastic-package, avoid creating tags under kibana/tag if they already exist in kibana/tags.yml, update if needed to include ids.

Metadata

Metadata

Assignees

Labels

discussIssue needs discussion

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions