Fix the "watched list" resource.
Review Request #14258 — Created Dec. 4, 2024 and submitted
The watched list resource is a special resource that exists only to link
to the other watched item resources. It was completely broken, returning
HTTP 405, due to a bad implementation of our singleton resource pattern.This change fixes that up to use the correct method name, and
reimplements the body of it to skip the bulk of what the baseget_list
implementation would have done.
Fetched the watched list resource and got a response with links instead
of an error.
Summary | ID |
---|---|
97b09c6277a60f9b5b5a0d46e09da0bd3de15fa4 |
Description | From | Last Updated |
---|---|---|
Given that this is a pretty big change to the resource (RootResource does a number of things), I think this … |
chipx86 | |
'djblets.util.typing.JSONDict' imported but unused Column: 5 Error code: F401 |
reviewbot | |
I don't think we want this typing here. If anything, it should be in the base class. The subclass inherits … |
chipx86 | |
Can you add a module docstring while here? |
chipx86 | |
Let's make these keyword-only. |
chipx86 | |
'typing.TYPE_CHECKING' imported but unused Column: 1 Error code: F401 |
reviewbot |
-
-
Given that this is a pretty big change to the resource (
RootResource
does a number of things), I think this change needs to come with more comprehensive tests that check the full output of the resource. I'm not 100% sure that this should be a Root Resource, really, since that does have its own implications, and I'd be weary of changes there having unexpected side effects here.What error was returned? I feel like we should be starting with that.
- Description:
-
~ We have a special resource that only exists to link to the other watched
~ item resources. Unfortunately, it was completely broken, and making a ~ GET request to it would just return an error. ~ The watched list resource is a special resource that exists only to link
~ to the other watched item resources. It was completely broken, returning ~ HTTP 405, due to a bad implementation of our singleton resource pattern. ~ Other resources that we have that behave similarly are written as
~ inheriting from the Djblets RootResource. I've changed it so we do that ~ here, and now the resource works. ~ This change fixes that up to use the correct method name, and
~ reimplements the body of it to skip the bulk of what the base get_list
~ implementation would have done. - Commits:
-
Summary ID cdd447c3258923d05a9bf7249e737bd6e4459e7a 88abb87368503ad3c18f97f58b5e35113a55a0e5 - Diff:
-
Revision 2 (+48 -8)
Checks run (2 succeeded)
- Change Summary:
-
Add unit tests.
- Commits:
-
Summary ID 88abb87368503ad3c18f97f58b5e35113a55a0e5 c3b82c23f4a7001935fee10f2953e288c98eafbb
- Commits:
-
Summary ID c3b82c23f4a7001935fee10f2953e288c98eafbb e4eee6e7bca081a1aa363507e15ca6b418bad1e7
Checks run (2 succeeded)
- Commits:
-
Summary ID e4eee6e7bca081a1aa363507e15ca6b418bad1e7 95c44910f450c4a29f50f694429daad1815ad957