-
Notifications
You must be signed in to change notification settings - Fork 582
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
feat: Add APIs for querying workspaces #61
Conversation
Codecov Report
@@ Coverage Diff @@
## main #61 +/- ##
==========================================
- Coverage 71.64% 71.26% -0.38%
==========================================
Files 79 82 +3
Lines 2902 3376 +474
Branches 49 49
==========================================
+ Hits 2079 2406 +327
- Misses 647 766 +119
- Partials 176 204 +28
Continue to review full report at Codecov.
|
ProjectID uuid.UUID `json:"project_id" validate:"required"` | ||
Name string `json:"name" validate:"username,required"` |
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.
Looks easy to create!
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.
Overall looks great! Just had a question about the POST
/workspaces/{user}/{workspace}/history
API
type CreateWorkspaceHistoryRequest struct { | ||
ProjectHistoryID uuid.UUID `json:"project_history_id" validate:"required"` | ||
Transition database.WorkspaceTransition `json:"transition" validate:"oneof=create start stop delete,required"` | ||
} |
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 don't quite understand this API - why does it need the ProjectHistoryID
? Where would the front-end get this?
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.
It seems we'd use either the ProjectHistoryID
the workspace was created with, or the latest one - and in either case, the backend would know that 🤔
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.
Ahh so there's project history and workspace history.
Workspace history tracks project history, so it's needed! The frontend will query the project and probably grab the latest, but I didn't want to make it a requirement.
Closes #23
In my next PR I'll be tackling provisionerd, which will process the builds and hopefully link the entire system together!