Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation for screenshots and icons #537

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented Jun 22, 2020

This validates all the defined icons and screenshots and errors out, if a src is not found. Some testing packages needed updating because of this.

@ruflin ruflin self-assigned this Jun 22, 2020
@@ -78,7 +78,10 @@ type Version struct {
}

type Image struct {
Src string `config:"src" json:"src" validate:"required"`
// Src is relative inside the package
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mtojek Any ideas for better naming here?

// Src is relative inside the package
Src string `config:"src" json:"src" validate:"required"`
// Path is the absolute path in the url
Path string `config:"path" json:"path"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfsiii If we go forward, this would be a breaking change on the Kibana side. Also ideas around "correct" naming?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path is pretty much in line with the other places we use it like for downloads: https://github.com/elastic/package-registry/blob/master/docs/api/package.json#L10 If we adjust it, we should adjust it everywhere.

Perhaps we can rename src to local_path, relative_path or something like this?

@elasticmachine
Copy link

elasticmachine commented Jun 22, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #537 updated]

  • Start Time: 2020-09-16T08:17:58.955+0000

  • Duration: 7 min 18 sec

Test stats 🧪

Test Results
Failed 0
Passed 161
Skipped 0
Total 161

@jfsiii
Copy link

jfsiii commented Jun 23, 2020

I'm unclear why this new value is stored in the registry.

Do we need to support both forms? Can we just pick one?

If we need both do we need to keep src or can we pick something more descriptive?

@ruflin
Copy link
Contributor Author

ruflin commented Jun 24, 2020

@jfsiii We need one, that is used for the dev building the package (src) and the other one is that we expose on the registry side to provide the full path (path). Both show up in the output as by default we just convert the manifest.yml to json, so the src also shows up. We could hide it if we want in the json output.

We are not tied to any names at the moment, happy to change.

@ruflin ruflin assigned ph Jul 2, 2020
@ruflin ruflin unassigned ph Aug 10, 2020
@ruflin
Copy link
Contributor Author

ruflin commented Aug 18, 2020

@ycombinator Moving forward, I guess this is something that should be validated on the package-spec level?

@ycombinator
Copy link
Contributor

Moving forward, I guess this is something that should be validated on the package-spec level?

Yes, package-spec validation will be able to handle this case in the future!

@ruflin ruflin removed their assignment Sep 14, 2020
@ruflin ruflin force-pushed the icon-screenshot-validation branch from 8b79947 to 6bf04b3 Compare September 16, 2020 08:13
This validates all the defined icons and screenshots and errors out, if a src is not found. Some testing packages needed updating because of this.
@ruflin ruflin force-pushed the icon-screenshot-validation branch from dc67460 to 2b16328 Compare September 16, 2020 08:17
@ruflin ruflin self-assigned this Sep 16, 2020
@ruflin ruflin marked this pull request as ready for review September 16, 2020 08:17
@ruflin
Copy link
Contributor Author

ruflin commented Sep 16, 2020

@ycombinator I made this ready for review as it is just a small change, code was already around and I don't think we have this yet in elastic-package. As soon as we get it into elastic-package and it is run for all places where we have packages, we should get rid of it.

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ruflin ruflin merged commit 51947a8 into elastic:master Sep 16, 2020
@ruflin ruflin deleted the icon-screenshot-validation branch September 16, 2020 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants