Skip to content

Remove dead endpoint /search/languages - #14560

Merged
RayBB merged 3 commits into
internetarchive:masterfrom
pranshup04:fix/14534-remove-dead-search-languages
Nov 19, 2026
Merged

RayBB merged 3 commits into
internetarchive:masterfrom
pranshup04:fix/14534-remove-dead-search-languages

Conversation

@pranshup04

Copy link
Copy Markdown
Contributor

Closes #14534

What does this PR achieve?

Removes the dead /search/languages endpoint registered in openlibrary/plugins/worksearch/languages.py. The endpoint referenced a nonexistent template (search/languages), causing 500 server errors when visited, and is not referenced anywhere in the codebase. Language filtering is already supported through /search and /languages.

Technical

  • Removed the unused language_search(delegate.page) class and its route registration from openlibrary/plugins/worksearch/languages.py.
  • Formatted and sorted imports using ruff.

Testing

  • Added route unit tests in openlibrary/plugins/worksearch/tests/test_languages.py:
    • test_language_search_endpoint_removed: confirms language_search is removed from the module.
    • test_languages_index_route_preserved: confirms the working /languages index route remains registered.
  • Ran pytest suite:
    • pytest openlibrary/plugins/worksearch/tests/test_languages.py (9 passed).
    • pytest openlibrary/plugins/worksearch/tests/ (77 passed).
  • Code style: ruff check and ruff format verified.

Stakeholders

@marley @cdrini

@openlibrary-bot
openlibrary-bot requested a review from a team November 18, 2026 09:44
@github-actions

Copy link
Copy Markdown

Hi @pranshup04 — thanks for the PR! #14534 is already assigned to @RishabhIIITD, so this looks like a duplicate and we've closed it to avoid two people doing the same work. (Good First Issues are assigned to the first person who opens a ready, non-draft PR after commenting on the issue.)

If you think that's wrong, or you'd like to pick it up if @RishabhIIITD steps back, leave a comment on #14534 — we'll help from there.

assert collator.getSortKey("abc")


class TestLanguagesRoutes:

@marley marley Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ Change request: good instinct for manual testing, but ultimately I believe these tests are not necessary. There is no precedent for checking for deleted routes in this codebase. If your manual tests work and the rest of the tests pass, that is what matters in this case. Please remove these tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pranshup04 Once you address this, I will tag the staff member 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

DONE — removed TestLanguagesRoutes and kept the existing tests unchanged.

The updated commit (95faab7) is pushed to the branch:
pranshup04@95faab7

Since the bot closed the PR, I'm unable to reopen it on my end. Could you or staff please reopen it? Thanks!

@marley

marley commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@RayBB Could you please assign #14534 to @pranshup04 and reopen this PR? He commented first but due to another person creating a PR first, when Pranshup created this PR, it was automatically closed. He says that he pushed the changes I requested but I guess this PR is not updating since it was closed. Thanks!

@RayBB RayBB reopened this Nov 18, 2026
@RayBB

RayBB commented Nov 18, 2026 via email

Copy link
Copy Markdown
Collaborator

@marley marley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me!

@marley

marley commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@RayBB I approve this PR

@RayBB
RayBB merged commit 1cbc82f into internetarchive:master Nov 19, 2026
8 of 9 checks passed
@RayBB

RayBB commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Great job. Thanks both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dead endpoint: /search/languages is a dead route

3 participants