-
Notifications
You must be signed in to change notification settings - Fork 881
feat: Refactor API routes to use UUIDs instead of friendly names #401
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #401 +/- ##
==========================================
+ Coverage 67.57% 68.11% +0.54%
==========================================
Files 150 159 +9
Lines 8446 9318 +872
Branches 72 73 +1
==========================================
+ Hits 5707 6347 +640
- Misses 2159 2335 +176
- Partials 580 636 +56
Continue to review full report at Codecov.
|
r.Use( | ||
httpmw.ExtractAPIKey(options.Database, nil), | ||
httpmw.ExtractProjectParam(options.Database), | ||
httpmw.ExtractOrganizationParam(options.Database), |
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.
Hmm, it doesn't seem like this would be used 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.
It ensures the caller has access to the organization the project resides in. Otherwise, users could access projects inside organizations they aren't in.
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 really just skimmed this, but it looks OK from the surface! I'm curious how the API will need to be updated in the front-end - but will dive into more as I update the front-end to match the new routes.
I updated the frontend too! |
Oh nice, thanks @kylecarbs ! I totally missed it - it was at the bottom of the PR and not expanded for some reason. Saw you updated the E2E test too 🙏 |
…kspace page (#415) Some API routes were updated in #401, which impacted the UX - the flow is currently broken when trying to navigate to a project:  This fixes all the routes so that the complete project -> create workspace -> workspace page flow works:  Because this had to touch a bunch of UI routes, I also opportunistically fixed #380 as part of this change. Fixes #380
This drastically changes the API structure to use IDs instead of friendly names.
codersdk/*_test.go
in favor of sharing coverage withcoderd/*
.