openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

fix: remove redundant merge-authors feature flag

Open Sanket17052006 opened this issue 5 months ago • 1 comments

Part of #12946

This PR removes the redundant merge-authors feature flag and replaces it with direct role checks.

Technical

  • Removed merge-authors from conf/openlibrary.yml.
  • Replaced "merge-authors" in ctx.features checks with direct user role checks (is_librarian(), is_admin(), or is_super_librarian()) in openlibrary/plugins/upstream/merge_authors.py.
  • Updated search/authors.html and type/author/view.html templates to use the same user role logic instead of checking ctx.features.

Testing

docker compose run --rm home pytest openlibrary/plugins/upstream/tests/test_merge_authors.py openlibrary/tests/fastapi/test_merge_authors.py -v

Screenshot

Stakeholders

@RayBB

Sanket17052006 avatar Jun 25 '26 10:06 Sanket17052006

Thank you @Sanket17052006 for this PR!

🤖 Copilot has been assigned for an initial review. The linked issue (#12946) hasn't been triaged yet — triage happens on Mondays and Fridays. There are currently 24 open non-draft PRs ahead of yours.

Possible improvements for this PR

  • [ ] Testing section is empty — please add steps for a reviewer to verify the behavior: e.g., how to confirm as a librarian that the merge button still appears, and that a non-librarian user cannot access the merge endpoint. Without these steps, reviewers cannot confidently validate the change.
  • [ ] Proof of testing — the PR touches UI templates (search/authors.html, type/author/view.html). A screenshot or brief description confirming the merge button renders correctly (or is correctly hidden for non-qualifying users) would help reviewers verify the visual behavior.
PR triage checklist (maintainers / Richy)
  • [x] PR description — not empty; explains what the change does and how it's structured
  • [x] References an issue — body contains #12946
    • [ ] Linked issue is triaged — #12946 has Lead: @RayBB but no Priority: * label
    • [x] Linked issue is assigned — assigned to @Sanket17052006
  • [x] Commit history clean — single well-named commit (fix: remove redundant merge-authors feature flag)
  • [ ] CI passing — python_tests is still running
  • [ ] Test cases present — is_enabled() logic changed in merge_authors.py and merge_authors_json but no tests added or updated (existing test_merge_authors.py has no coverage of is_enabled)
  • [ ] Proof of testing — Testing section is empty

[!NOTE] This comment was automatically generated by PAM, Open Library's Project AI Manager. PAM provides status visibility, performs basic project management functions, and gives actionable feedback so contributors aren't left waiting.

openlibrary-bot avatar Jun 25 '26 10:06 openlibrary-bot