Skip to content

Commit

Permalink
Rename image src to path and have src as the original value from the … (
Browse files Browse the repository at this point in the history
#629)

All the configs specified in the manifest file by the user should be exposed without changes in our JSON output. In the case of images, the src was overwritten by the path variable. This means what was in the manifest and outputted by JSON was not a 1:1 match.

It is ok to add additional fields in the JSON output but the original fields should never be touched.

This is a breaking change and need adjustements in Kibana.
  • Loading branch information
ruflin authored Sep 14, 2020
1 parent cfd9586 commit 4ee5642
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 45 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Rename version to service.version in index handler. [#633](https://github.com/elastic/package-registry/pull/633)
* Remove config `public_dir` which is replaced by `package_paths`. [#632](https://github.com/elastic/package-registry/pull/632)
* Ship packages as zip instead of tar.gz [#628](https://github.com/elastic/package-registry/pull/628)
* Rename image src to path and have src as the original value from the manifest. [#629](https://github.com/elastic/package-registry/pull/629)

### Bugfixes

Expand Down
5 changes: 2 additions & 3 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ info:
name: Elastic-License
url: 'https://github.com/elastic/package-registry/blob/master/LICENSE.txt'
description: Elastic Package Registry
contact:
name: Nicolas Ruflin
email: spam@ruflin.com
servers:
- url: 'https://epr.elastic.co'
description: public
Expand Down Expand Up @@ -146,6 +143,8 @@ components:
title: Image
type: object
properties:
path:
type: string
src:
type: string
title:
Expand Down
6 changes: 4 additions & 2 deletions testdata/generated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
},
"screenshots": [
{
"src": "/package/example/1.0.0/img/kibana-iptables.png",
"src": "/img/kibana-iptables.png",
"path": "/package/example/1.0.0/img/kibana-iptables.png",
"title": "IP Tables Overview dashboard",
"size": "1492x1382"
},
{
"src": "/package/example/1.0.0/img/kibana-iptables-ubiquity.png",
"src": "/img/kibana-iptables-ubiquity.png",
"path": "/package/example/1.0.0/img/kibana-iptables-ubiquity.png",
"title": "IP Tables Ubiquity Dashboard",
"size": "1492x1464",
"type": "image/png"
Expand Down
6 changes: 4 additions & 2 deletions testdata/generated/package/example/1.0.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@
},
"screenshots": [
{
"src": "/package/example/1.0.0/img/kibana-iptables.png",
"src": "/img/kibana-iptables.png",
"path": "/package/example/1.0.0/img/kibana-iptables.png",
"title": "IP Tables Overview dashboard",
"size": "1492x1382"
},
{
"src": "/package/example/1.0.0/img/kibana-iptables-ubiquity.png",
"src": "/img/kibana-iptables-ubiquity.png",
"path": "/package/example/1.0.0/img/kibana-iptables-ubiquity.png",
"title": "IP Tables Ubiquity Dashboard",
"size": "1492x1464",
"type": "image/png"
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/longdocs/1.0.4/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
],
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/metricsonly/2.0.1/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
],
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/multiversion/1.0.3/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/multiversion/1.0.3",
"icons": [
{
"src": "/package/multiversion/1.0.3/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.0.3/img/icon.svg",
"type": "image/svg+xml"
}
],
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/multiversion/1.0.4/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/multiversion/1.0.4",
"icons": [
{
"src": "/package/multiversion/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
],
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/multiversion/1.1.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
],
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/package/reference/1.0.0/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
18 changes: 12 additions & 6 deletions testdata/generated/search-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -86,7 +87,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -112,7 +114,8 @@
"path": "/package/multiversion/1.0.3",
"icons": [
{
"src": "/package/multiversion/1.0.3/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.0.3/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -128,7 +131,8 @@
"path": "/package/multiversion/1.0.4",
"icons": [
{
"src": "/package/multiversion/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -144,7 +148,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -170,7 +175,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
12 changes: 8 additions & 4 deletions testdata/generated/search-category-custom.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -46,7 +47,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -72,7 +74,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -98,7 +101,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
9 changes: 6 additions & 3 deletions testdata/generated/search-category-web.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -36,7 +37,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -52,7 +54,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
3 changes: 2 additions & 1 deletion testdata/generated/search-kibana652.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand Down
12 changes: 8 additions & 4 deletions testdata/generated/search-kibana721.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -76,7 +77,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -102,7 +104,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -128,7 +131,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
12 changes: 8 additions & 4 deletions testdata/generated/search-package-experimental.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -86,7 +87,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -112,7 +114,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -138,7 +141,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
12 changes: 8 additions & 4 deletions testdata/generated/search-package-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"path": "/package/longdocs/1.0.4",
"icons": [
{
"src": "/package/longdocs/1.0.4/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/longdocs/1.0.4/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -87,7 +88,8 @@
"path": "/package/metricsonly/2.0.1",
"icons": [
{
"src": "/package/metricsonly/2.0.1/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/metricsonly/2.0.1/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -113,7 +115,8 @@
"path": "/package/multiversion/1.1.0",
"icons": [
{
"src": "/package/multiversion/1.1.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/multiversion/1.1.0/img/icon.svg",
"type": "image/svg+xml"
}
]
Expand All @@ -139,7 +142,8 @@
"path": "/package/reference/1.0.0",
"icons": [
{
"src": "/package/reference/1.0.0/img/icon.svg",
"src": "/img/icon.svg",
"path": "/package/reference/1.0.0/img/icon.svg",
"size": "32x32",
"type": "image/svg+xml"
}
Expand Down
Loading

0 comments on commit 4ee5642

Please sign in to comment.