elastic / elastic/package-spec

[Validation] Add validation for screenshot 'size'

Open
#1,015 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
20
Forks
93
Avg merge
15h 10m
Merged PRs (30d)
12

Description

The `size` field for screenshots in package manifests is often incorrect. This field is a string representation of the image dimensions (e.g., "1200x900"), but it frequently does not match the actual `width` and `height` of the image file.

I don't actually know if anything consumes the `size` so I'm not sure of the impact of incorrect values.

### Statistics

Here is a breakdown of the current state of the data across existing packages in elastic/integrations@1ddb689356578e7932f98d7b46ded551e64cbdba.

Package-level screenshots:

* Out of 842 screenshots reviewed, 697 (82.8%) have an incorrect `size` value.
* Only 144 (17.1%) have a correct `size` value.

Policy template-level screenshots:

* Out of 81 screenshots reviewed, 56 (69.1%) have an incorrect `size` value.
* Only 25 (30.9%) have a correct `size` value.

### Validation

The package specification should include a validation rule that ensures the `size` field in the manifest (`width`x`height`) matches the actual dimensions of the corresponding screenshot file.

This will prevent new packages or updates from introducing incorrect data and will encourage developers to fix existing issues.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.