-
Notifications
You must be signed in to change notification settings - Fork 67
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
Generate package index.json #479
Conversation
docs/api/package.json
Outdated
@@ -34,82 +34,14 @@ | |||
"type": "image/png" | |||
} | |||
], | |||
"assets": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about this missing content here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I didn't know I have to load assets additionally.
@@ -63,7 +63,6 @@ func TestEndpoints(t *testing.T) { | |||
{"/search?internal=bar", "/search", "search-package-internal-error.json", searchHandler(packagesBasePath, testCacheTime)}, | |||
{"/search?experimental=true", "/search", "search-package-experimental.json", searchHandler(packagesBasePath, testCacheTime)}, | |||
{"/search?experimental=foo", "/search", "search-package-experimental-error.json", searchHandler(packagesBasePath, testCacheTime)}, | |||
{"/package/example/1.0.0", "", "package.json", catchAll(http.Dir(publicPath), testCacheTime)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we still have a test for this? The API endpoint should still work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is used in the TestPackageIndex
method.
{"/package/example/1.0.0/index.json", packageIndexRouterPath1, "package.json", packageIndexHandler}, | ||
{"/package/missing/1.0.0/index.json", packageIndexRouterPath1, "index-package-not-found.txt", packageIndexHandler}, | ||
{"/package/example/999.0.0/index.json", packageIndexRouterPath1, "index-package-revision-not-found.txt", packageIndexHandler}, | ||
{"/package/example/a.b.c/index.json", packageIndexRouterPath1, "index-package-invalid-version.txt", packageIndexHandler}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test that doesn't have index.json
inside, for example /package/example/1.0.0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
@@ -53,6 +55,11 @@ func ArchivePackage(w io.Writer, properties PackageProperties) (err error) { | |||
|
|||
rootDir := fmt.Sprintf("%s-%s", properties.Name, properties.Version) | |||
|
|||
err = writePackageIndexToArchive(properties.Path, rootDir, tarWriter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note here that we have this in because Kibana still relies on it but it should potentially be removed in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally and works as expected.
Issue: #464
@jfsiii API hasn't changed in this PR, but I wish to get rid of
index.json
from inside of a bundle (.tar.gz
).