-
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
refactor: Move all HTTP routes to top-level struct #130
Conversation
These will be used for streaming logs, checking status, and other operations related to workspace and project history.
Codecov Report
@@ Coverage Diff @@
## main #130 +/- ##
==========================================
+ Coverage 64.62% 69.05% +4.42%
==========================================
Files 57 100 +43
Lines 636 4317 +3681
Branches 68 68
==========================================
+ Hits 411 2981 +2570
- Misses 213 1074 +861
- Partials 12 262 +250
Continue to review full report at Codecov.
|
Nesting all structs behind their respective structures is leaky, and promotes naming conflicts between handlers. Our HTTP routes cannot have conflicts, so neither should function naming.
@@ -22,5 +22,6 @@ | |||
"cmd": "make gen" | |||
} | |||
] | |||
} | |||
}, | |||
"cSpell.words": ["coderd", "coderdtest", "codersdk", "httpmw", "oneof", "stretchr", "xerrors"] |
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.
Thanks for adding these!
|
||
// WorkspaceHistory is an at-point representation of a workspace state. | ||
// Iterate on before/after to determine a chronological history. | ||
type WorkspaceHistory struct { |
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.
Thanks for splitting out the project/workspace history
Database: options.Database, | ||
Pubsub: options.Pubsub, | ||
} |
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 guess these were all essentially the same anyway - good call factoring to api
Nesting all structs behind their respective structures
is leaky, and promotes naming conflicts between handlers.
Our HTTP routes cannot have conflicts, so neither should
function naming.