mathesar-foundation / mathesar

Web application providing an intuitive user experience to databases.
https://mathesar.org/
GNU General Public License v3.0
2.28k stars 316 forks source link

Implement `schemas.list` RPC method #3598

Closed seancolsen closed 1 month ago

seancolsen commented 1 month ago

Fixes #3596

Checklist

Developer Certificate of Origin

Developer Certificate of Origin ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```
seancolsen commented 1 month ago

Note this is stacked on top of #3597

seancolsen commented 1 month ago

Ready for re-review, @mathemancer

Anish9901 commented 1 month ago

@seancolsen I noticed that this PR doesn't have any python test for testing the schemas.list_ rpc function, it only has one for testing the expected name of the endpoint. Any reason why that may be?

seancolsen commented 1 month ago

@Anish9901 It didn't seem worth testing to me. Do you think it should have a test? What would you want to assert in that test? I'm open to it certainly. But also trying to avoid too much boilerplate in order to move quickly. For reference, we discussed this in our last meeting (starting at about 48:20 and my take-away from that discussion was that the test coverage that matters the most to us right now is the test coverage at the SQL layer.

Anish9901 commented 1 month ago

Ok, I just went through the video, as per my understanding, I don't think we agreed on not adding the python tests for the rpc endpoints rather I think we decided on not having end-to-end python tests which would call up the db and hence tend to be slow. FWIW, I think we should at least have one test for making sure that the sql function is called with appropriate parameters, this is relatively low effort. I'd like to hear @mathemancer's opinion on whether or not we want tests that check the wiring of the functions that are called from within the rpc functions.

mathemancer commented 1 month ago

As I'm looking through the PR with @Anish9901 's concerns in mind:

This would be similar to, for example, the test for columns.list_. It's kind of a pain to put together, but it does give us something to break if we accidentally typo something in the function logic that we might not otherwise notice.