fix: remove redundant merge-authors feature flag
Part of #12946
This PR removes the redundant merge-authors feature flag and replaces it with direct role checks.
Technical
- Removed
merge-authorsfromconf/openlibrary.yml. - Replaced
"merge-authors" in ctx.featureschecks with direct user role checks (is_librarian(),is_admin(), oris_super_librarian()) inopenlibrary/plugins/upstream/merge_authors.py. - Updated
search/authors.htmlandtype/author/view.htmltemplates to use the same user role logic instead of checkingctx.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
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: @RayBBbut noPriority: *label - [x] Linked issue is assigned — assigned to @Sanket17052006
- [ ] Linked issue is triaged — #12946 has
- [x] Commit history clean — single well-named commit (
fix: remove redundant merge-authors feature flag) - [ ] CI passing —
python_testsis still running - [ ] Test cases present —
is_enabled()logic changed inmerge_authors.pyandmerge_authors_jsonbut no tests added or updated (existingtest_merge_authors.pyhas no coverage ofis_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.