-
Notifications
You must be signed in to change notification settings - Fork 9
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
Resolve remaining questions within RPC plans #112
Conversation
@pavish @mathemancer please review to make sure you're on board with the small decisions I'm proposing here. |
One small comment/question for @mathemancer and @pavish... This PR has method names which use plural nouns like this:
I used plural nouns in the PR because that's how Brent started off in mathesar-foundation/mathesar#3524 However, I have a slight preference for using singular nouns like this:
Would you two be okay with singular nouns? I'm fine with plural nouns if that's what you two prefer. |
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.
@seancolsen Looks good to me!
I have a slight preference towards plural nouns in the function names. I do not have a strong opinion and I'm good with either.
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, the changes look great. One change I'd suggest adding is to update the documentation of our docstring style from Sphinx to the Google style
| `/api/db/v0/links/` | POST | `data_modeling.add_link` | | ||
| `/api/db/v0/queries/{queryId}/` | DELETE | `explorations.delete` | | ||
| `/api/db/v0/queries/{queryId}/` | GET | `explorations.get` | | ||
| `/api/db/v0/queries/{queryId}/` | PUT | `explorations.replace` | |
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.
Is this actually a thing? I.e., is there a UI flow for wholesale replacing an exploration?
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.
Yes. When the user clicks the "Save" button on an exploration, we go here and then here. That's a PUT request. This is code that @pavish wrote, I think with Dom's help on the backend. I imagine they both had a good reasons for using PUT instead of PATCH, but I don't understand enough about the inner-workings of the exploration data structures to understand why. In my audit of REST endpoints, this one did stand out to me as the only endpoint where we're using a PUT request.
@pavish if you want to shed any light on your reasoning here, that might be helpful.
| **add** | ~~create~~, ~~insert~~, ~~make~~, ~~new~~ | | ||
| **patch** | ~~partial update~~, ~~edit~~, ~~alter~~ | | ||
| **replace** | ~~full update~~, ~~put~~, ~~set~~ | | ||
| **delete** | ~~remove~~, ~~drop~~ | | ||
|
||
### Docstrings | ||
|
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.
We're no longer using Sphinx, but rather Google-style docstrings.
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.
Fixed in 632e0ce
| `/api/ui/v0/users/` | GET | | | ||
| `/api/ui/v0/users/` | POST | | | ||
| `/api/ui/v0/users/password_change/` | POST | | | ||
| Endpoint | HTTP Method | Function | |
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, I'm supportive of the naming scheme you have here. Thanks for going through the details on it!
@mathemancer this is ready for re-review. |
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.
All good from my end.
This PR makes changes to our RPC plans document to resolve some of the outstanding questions by proposing answers to them.
Rendered doc
Specifically:
Timeline is clarified to indicate that we don't intend to transition all REST endpoints to RPC by the beta release.
rpc-client.md
is updated to specify that we will manually maintain TypeScript types and we won't attempt to auto-generate them.We'll avoid attempting to transition the data_files endpoint to RPC any time soon.
We'll use "fixed ids", keeping the scope of unique id values limited to a single HTTP request.
We'll use the standard verbs: list, get, add, patch, replace, and delete.
We'll allow arbitrarily deep namespacing.
I removed questions about response structure and error structure, thinking that we'll basically resolve this as we go by establishing precedent. Perhaps we'll choose to document this later, but I'm not sure.
I removed the "casing transformation" and "error types" questions because I think the answer is basically "we don't want to spend time on this", including tiding up and properly documenting our decision process. Basically this decision process ocurred within my head and I don't think it's worth the time to capture it.
I filled in names for all of the RPC functions.