feat: update build url to @username/workspace/builds/buildnumber (#2234)

* update build url to @username/workspace/builds/buildnumber

* update errors thrown from the API

* add unit tests for the new API

* add t.parallel

* get username and workspace name from params
This commit is contained in:
Abhineet Jain
2022-06-10 12:08:50 -04:00
committed by GitHub
parent f9290b016e
commit b2833c694b
16 changed files with 305 additions and 48 deletions

View File

@ -270,7 +270,10 @@ func New(options *Options) *API {
r.Get("/", api.organizationsByUser)
r.Get("/{organizationname}", api.organizationByUserAndName)
})
r.Get("/workspace/{workspacename}", api.workspaceByOwnerAndName)
r.Route("/workspace/{workspacename}", func(r chi.Router) {
r.Get("/", api.workspaceByOwnerAndName)
r.Get("/builds/{buildnumber}", api.workspaceBuildByBuildNumber)
})
r.Get("/gitsshkey", api.gitSSHKey)
r.Put("/gitsshkey", api.regenerateGitSSHKey)
})