Skip to content

MT-22678: Add name search filter to getAllContactLists#71

Open
Rabsztok wants to merge 2 commits into
mainfrom
MT-22678-php-contact-list-search
Open

MT-22678: Add name search filter to getAllContactLists#71
Rabsztok wants to merge 2 commits into
mainfrom
MT-22678-php-contact-list-search

Conversation

@Rabsztok

@Rabsztok Rabsztok commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Motivation

https://railsware.atlassian.net/browse/MT-22678

Changes

  • Add an optional $search argument to Contact::getAllContactLists — filters contact lists by name (case-insensitive prefix match), per the OpenAPI GET /api/contacts/lists param. Appended only when provided, so existing calls are unchanged.

How to test

  • $contacts->getAllContactLists() — returns all contact lists (unchanged behaviour).
  • $contacts->getAllContactLists('news') — returns only lists whose name starts with "news" (case-insensitive).

Summary by CodeRabbit

  • New Features

    • Added optional name-prefix filtering when retrieving contact lists.
    • Added an example demonstrating filtered contact-list retrieval and response handling.
  • Bug Fixes

    • Improved coverage for contact-list searches, including query parameters and response validation.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b29da924-ba40-4e6b-b750-484536d6507b

📥 Commits

Reviewing files that changed from the base of the PR and between 8b9e828 and 57ee9cb.

📒 Files selected for processing (3)
  • examples/contact-lists/all.php
  • src/Api/General/Contact.php
  • tests/Api/General/ContactTest.php

📝 Walkthrough

Walkthrough

Adds optional case-insensitive prefix filtering to getAllContactLists, demonstrates the filtered request in an example, and adds a PHPUnit test for the query parameter and response.

Changes

Contact list search

Layer / File(s) Summary
Search parameter flow
src/Api/General/Contact.php, examples/contact-lists/all.php, tests/Api/General/ContactTest.php
getAllContactLists accepts an optional search prefix and passes it to /lists; the example demonstrates filtered retrieval, and the test validates the request and response.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: mklocek, VladimirTaytor

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding a search filter to getAllContactLists.
Description check ✅ Passed It includes the required Motivation, Changes, and How to test sections; only the optional Images and GIFs table is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants