Skip to content

Fix dynamic search rule actions for v1.54 - #1282

Merged
Strift merged 2 commits into
meilisearch:mainfrom
vivek378521:fix/dynamic-search-rule-actions-v154
Oct 7, 2026
Merged

Strift merged 2 commits into
meilisearch:mainfrom
vivek378521:fix/dynamic-search-rule-actions-v154

Conversation

@vivek378521

@vivek378521 vivek378521 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Related issue

Fixes #1281

What does this PR do?

  • Fixes compatibility issues with v1.54 meilisearch, used codex to run the tests identify the issue and fix it.

v1.54 changed actions from an action list to an object keyed by action type. For pinning, the old selector/action pair becomes {"pin": [{"id", "position", "indexUid"}]}

PR checklist

Please check if your PR fulfills the following requirements:

  • [ x] Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • [ x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • [ x] Have you read the contributing guidelines?
  • [ x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

Summary by CodeRabbit

  • Updates
    • Search rules now group action definitions by action name. Pinning actions are represented under a pin entry, with the applicable product, document, and position specified in its list. This updates the structure used when defining dynamic search rules and examples, keeping action types distinct while preserving the pinning details in the updated format.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6e06f84-826a-45c2-8080-268c4580775c
📥 Commits

Reviewing files that changed from the base of the PR and between cfd2ab8 and b3dd1cb.

📒 Files selected for processing (1)
  • .code-samples.meilisearch.yaml
 _______________________________________________
< Optimization hinders evolution. - Alan Perlis >
 -----------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f2594bc8-4b6b-4ef3-85fe-d82a379ab139

📥 Commits

Reviewing files that changed from the base of the PR and between 80a562f and cfd2ab8.

📒 Files selected for processing (2)
  • meilisearch/models/search_rule.py
  • tests/client/test_client_dynamic_search_rules_meilisearch.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The SearchRule.actions field now uses a mapping from action names to lists of action definitions. The dynamic search rules test fixture represents pinning with a pin list inside the actions object.

Changes

Search rule actions

Layer / File(s) Summary
Update the actions shape
meilisearch/models/search_rule.py, tests/client/test_client_dynamic_search_rules_meilisearch.py
SearchRule.actions now has a mapping type. The test fixture places the pinned item details in an actions.pin list.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to cfd2a

The updated test exercises the keyed actions shape through the client. No concrete merge-blocking issue is established by the available evidence.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cfd2a

The keyed action format matches the intended server update without introducing a new execution path or additional client privileges. Risk is limited to the public contract change: compatibility with older responses and server-side failure behavior remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The inspected client exposure remains the configured Meilisearch endpoint and caller-supplied rule UID. indexUid remains payload data; the shape change does not itself grant credentials or introduce a local privileged sink. Server-side index authorization was not verified.

Trust Boundaries and Controls

  • observed — The dynamic-rule methods retain the shared HTTP transport, including existing Bearer authorization, JSON serialization, status handling, and JSON response parsing. The model annotation does not replace or bypass these controls.

Resilience and Maintainability Implications

  • inferred — The payload revision adds no client-owned state machine, retry, cleanup, or rollback path. Application ordering and partial-failure, interruption, repetition, concurrency, and recovery guarantees remain server-owned and unresolved by the available client source.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing dynamic search rule action compatibility for Meilisearch v1.54.
Linked Issues check ✅ Passed Issue #1281 requires compatibility with Meilisearch v1.54 so the test suite can use the new dynamic search rule action format. SearchRule.actions now uses dict[str, list[dict[str, Any]]]. The dyna…
Out of Scope Changes check ✅ Passed The changes are limited to the SearchRule.actions model type and the dynamic search rule test fixture. Both changes directly support the Meilisearch v1.54 compatibility fix in issue #1281. No unrela…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

@vivek378521

Copy link
Copy Markdown
Contributor Author

@Strift Please review. Issue is due to compatibility

Meilisearch v1.54 changed the actions field in dynamic search rules from a flat array to an object with two optional keys: pin and scale, that's why the tests are failing.

The tests pass against v1.53.

This fix is good to go for v1.54 but will fail for v1.53.

Let me know what you think.

The documented payload still sent the old selector/action array, which Meilisearch rejects.
@Strift Strift added the enhancement New feature or request label Oct 7, 2026

@Strift Strift 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.

hi @vivek378521 & thanks for your PR 🙌

@Strift
Strift added this pull request to the merge queue Oct 7, 2026
Merged via the queue into meilisearch:main with commit 506fd06 Oct 7, 2026
7 of 8 checks passed
@Strift Strift added maintenance Anything related to maintenance (CI, tests, refactoring...) and removed enhancement New feature or request labels Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Anything related to maintenance (CI, tests, refactoring...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix tests for Meilisearch v1.54

2 participants