Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Use singular category API param #1177

Merged
merged 1 commit into from
Apr 15, 2022
Merged

Use singular category API param #1177

merged 1 commit into from
Apr 15, 2022

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Mar 24, 2022

Fixes

Fixes #1169 by @krysal

Description

This PR replaces plural API parameter categories with singular category, and updates some documentation.

This probably shouldn't be merged until the API fix is deployed because it will break the image category filtering.

Testing Instructions

If you run this as is, filtering by category will return un-filtered result because the production API discards filters that don't exist. If you run it with API from WordPress/openverse-api#583 running locally, you should get filtered results for audio and images.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

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.

@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Mar 24, 2022
@obulat obulat requested a review from a team as a code owner March 24, 2022 06:39
@obulat obulat requested review from krysal and sarayourfriend March 24, 2022 06:39
@krysal krysal added 🟥 priority: critical Must be addressed ASAP and removed 🟩 priority: low Low priority and doesn't need to be rushed labels Mar 24, 2022
@obulat
Copy link
Contributor Author

obulat commented Mar 25, 2022

Noting here that I've marked this PR as low priority because without the deployment of API with the category fix, this would not fix anything, as the singular category parameter would be discarded by the API. And with the API fix deployed, current approach (with categories plural) will still work, and this PR aims for the future version of the API where categories is deprecated.

@sarayourfriend
Copy link
Contributor

Should we mark it back to low?

@obulat obulat added 🟩 priority: low Low priority and doesn't need to be rushed and removed 🟥 priority: critical Must be addressed ASAP labels Mar 25, 2022
@krysal
Copy link
Member

krysal commented Mar 25, 2022

Honestly, I marked it as critical to highlight the dependency on the API and push the fix there 😆 Wouldn't it be better to use the singular version that we know is not deprecated? or is the intention to keep this open until we deprecate the plural field? 🤔

@obulat
Copy link
Contributor Author

obulat commented Mar 25, 2022

Great, I understand that it's actually a close to critical issue across the stack. The way the currently deployed API works, using singular category will cause an error, so it's not a good idea to merge this before API is deployed.

After the category fix in the API is deployed (I've merged it just now), both singular and plural versions will work, so then this fix can be applied and deployed.

When we finally change the version from v1, we can finally deprecate the plural categories parameter in the API.

@krysal
Copy link
Member

krysal commented Mar 25, 2022

That makes sense. BTW, everything looks good here, I reviewed using the local API with the fix but was almost impossible to find a term with mixed categories results so that could make time to try updating the API sample data too.

@zackkrida
Copy link
Member

@obulat is this blocked until the API is deployed?

@obulat
Copy link
Contributor Author

obulat commented Apr 7, 2022

@zackkrida , yes, it's waiting for the API deployment.

Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good to go now that WordPress/openverse-api#583 has landed 🚀

@obulat obulat force-pushed the fix/api_category branch from 1d17f21 to 7f90f1f Compare April 15, 2022 13:39
Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@obulat obulat merged commit 7b9d60e into main Apr 15, 2022
@obulat obulat deleted the fix/api_category branch April 15, 2022 14:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🛠 goal: fix Bug fix 🟩 priority: low Low priority and doesn't need to be rushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audio category filter not working correctly
4 participants