Skip to content
Snippets Groups Projects
Unverified Commit c4196d99 authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Some improvements to the REST API for query field validation (#46024)

* Allow filtering on collection

* Add `effective_ancestors` to collection data

Note: I removed the `qv=` comparator. I think it'.s better to be more explicit
about what exactly we're asserting. In particular, I hadn't updated the
`:count` when we were filtering on collection type, so the count was
still the total for *every* collection even though the results were being
restricted by the collection. However the `qv=-data` function was still
reporting that everything was OK, because it was accounting for other
data from the App DB by just asserting that the count we'd specified was
lower than the actual count. I'd argue it's better for tests to fail
locally because I have garbage in my app DB (which I can clean up) than
succeed when they really shouldn't.

* Consolidate effective ancestors

For the Search API, we're currently returning slightly different
ancestors:

- it never has the Root Collection, and

- the ancestors don't have a `personal_owner_id`

We could change the API (and maybe will soon - it seems pretty
unexpected to have `effective_ancestors` sometimes act one way and
sometimes act another) but for now we can just reshape things to look
the same as they did before, while using the same code under the hood.
parent 58d7b2ca
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment