-
Notifications
You must be signed in to change notification settings - Fork 18
Help wanted: attempt to implement an abstract container route #937
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
1e326f0
to
aa4a53f
Compare
A bunch of doc links: https://webapp2.readthedocs.io/en/latest/guide/request.html https://webapp2.readthedocs.io/en/latest/api/webapp2.html#webapp2.Request I've mostly solved the puzzle just from hopping through various function sigs & bits of source code. |
543a0a7
to
4cabccf
Compare
Codecov Report
@@ Coverage Diff @@
## master #937 +/- ##
==========================================
+ Coverage 90.8% 90.82% +0.01%
==========================================
Files 50 51 +1
Lines 7029 7054 +25
==========================================
+ Hits 6383 6407 +24
- Misses 646 647 +1 |
"groups": db.getCollection("groups").findOne({"_id" : _id}, {"_id": 1}), | ||
"projects": db.getCollection("projects").findOne({"_id" : _id}, {"_id": 1}), | ||
"sessions": db.getCollection("sessions").findOne({"_id" : _id}, {"_id": 1}), | ||
"acquisitions": db.getCollection("acquisitions").findOne({"_id" : _id}, {"_id": 1}) |
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'll probably want to add analyses to this list as well
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.
Collections, Y/N ?
4cabccf
to
0610248
Compare
So far, I tried swapping out SDK tests for acquisitions, and it works 🎉 More to follow. |
0610248
to
52474f4
Compare
This was later completed in flywheel-io/core#937 |
A big problem with exposing our functionality is that everything has a 5x multiplier:
AddAcquisitionNote
. This blocks doing some useful stuff in the SDK because the functions would be irritating and confusing.We should provide
/container/x
routes that figure out which type of container we mean, and just serve the equivalent route. This PR is an incomplete version of doing just that!Solved problem: we need an efficient way to resolve the container noun. Might be solved for free if we ever can truly homogenize containers. While the func snippet + db command approach here is a bit ugly on the code, I can confirm it is quite efficient and safe to use.
Unsolved problem: make webapp2 just serve a different handler, dangit. The commented-out
self.redirect
approach totally works: you canGET api/container/x/sessions
where x is a project ID. But that won't work for non-gets, and we shouldn't redirect anyway. We should just serve.I'm 90% sure we can take these code scraps, and either:
And call a handler method. Help?