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

Change to slug of the download-starter-project endpoint #119

Merged
merged 3 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index/server/pkg/server/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ func ServeRegistry() {
router.GET("/health", serveHealthCheck)
router.GET("/devfiles/:name", serveDevfile)
router.GET("/devfiles/:name/:version", serveDevfileWithVersion)
router.GET("/devfiles/:name/starterProjects/:starterProjectName", serveDevfileStarterProject)
router.GET("/devfiles/:name/:version/starterProjects/:starterProjectName", serveDevfileStarterProjectWithVersion)
router.GET("/devfiles/:name/starter-projects/:starterProjectName", serveDevfileStarterProject)
router.GET("/devfiles/:name/:version/starter-projects/:starterProjectName", serveDevfileStarterProjectWithVersion)

// Registry REST APIs for index v2
router.GET("/v2index", serveDevfileIndexV2)
Expand Down
8 changes: 4 additions & 4 deletions index/server/registry-REST-API.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2032,7 +2032,7 @@ Note: Only provides download as the response, not the devfile content.
=== HTTP Request
[source]
----
GET http://{registry host}/devfiles/{stack}/starterProjects/{starterProject}
GET http://{registry host}/devfiles/{stack}/starter-projects/{starterProject}
----

=== Request Parameters
Expand All @@ -2058,7 +2058,7 @@ The request body must be empty.
=== Request example
[source]
----
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/starterProjects/nodejs-starter -o nodejs-starter.zip
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/starter-projects/nodejs-starter -o nodejs-starter.zip
----

=== Response example
Expand All @@ -2078,7 +2078,7 @@ Note: Only provides download as the response, not the devfile content.
=== HTTP Request
[source]
----
GET http://{registry host}/devfiles/{stack}/{version}/starterProjects/{starterProject}
GET http://{registry host}/devfiles/{stack}/{version}/starter-projects/{starterProject}
----

=== Request Parameters
Expand Down Expand Up @@ -2107,7 +2107,7 @@ The request body must be empty.
=== Request example
[source]
----
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1/starterProjects/nodejs-starter -o nodejs-starter.zip
curl http://devfile-registry.192.168.1.1.nip.io/devfiles/nodejs/1.0.1/starter-projects/nodejs-starter -o nodejs-starter.zip
----

=== Response example
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/pkg/tests/indexserver_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
}
})

ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starterProjects/springbootproject")
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starter-projects/springbootproject")
var bytes []byte

gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand All @@ -301,8 +301,8 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
}))
})

ginkgo.It("/devfiles/<devfile>/<version>/starterProjects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/latest/starterProjects/springbootproject")
ginkgo.It("/devfiles/<devfile>/<version>/starter-projects/<starterProject> endpoint should return a zip archive for devfile starter project", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/latest/starter-projects/springbootproject")
var bytes []byte

gomega.Expect(err).NotTo(gomega.HaveOccurred())
Expand All @@ -318,15 +318,15 @@ var _ = ginkgo.Describe("[Verify index server is working properly]", func() {
}))
})

ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return an error for a devfile that doesn't exist", func() {
resp, err := http.Get(config.Registry + "/devfiles/fake-stack/starterProjects/springbootproject")
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return an error for a devfile that doesn't exist", func() {
resp, err := http.Get(config.Registry + "/devfiles/fake-stack/starter-projects/springbootproject")

gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusNotFound))
})

ginkgo.It("/devfiles/<devfile>/starterProjects/<starterProject> endpoint should return an error for a starter project that doesn't exist", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starterProjects/fake-project")
ginkgo.It("/devfiles/<devfile>/starter-projects/<starterProject> endpoint should return an error for a starter project that doesn't exist", func() {
resp, err := http.Get(config.Registry + "/devfiles/java-maven/starter-projects/fake-project")

gomega.Expect(err).NotTo(gomega.HaveOccurred())
gomega.Expect(resp.StatusCode).To(gomega.Equal(http.StatusNotFound))
Expand Down