Skip to content

fix(config): export rules and synonyms in index config export - #297

Merged
NatanTechofNY merged 1 commit into
mainfrom
fix/config-export-rules-synonyms
Nov 11, 2026
Merged

NatanTechofNY merged 1 commit into
mainfrom
fix/config-export-rules-synonyms

Conversation

@NatanTechofNY

Copy link
Copy Markdown
Collaborator

Summary

algolia index config export never included rules or synonyms, and --scope rules / --scope synonyms on their own failed with No config to export.

GetRules and GetSynonyms collect results through the API client's BrowseRules / BrowseSynonyms aggregator. The client passes the aggregator a pointer to the response (*SearchRulesResponse), but the helpers asserted the value type and discarded the failed assertion, so every page was silently dropped. rules browse and synonyms browse already use the pointer type, which is why they worked.

Changes

  • Assert *search.SearchRulesResponse / *search.SearchSynonymsResponse and skip nil responses (the aggregator is also called with a nil response on request failure).
  • Add config_test.go covering GetIndexConfig for all scopes, rules only, and synonyms only. These fail on main and pass with the fix.

Fixes #190

Made with Cursor

The BrowseRules/BrowseSynonyms aggregator receives a pointer to the
response, but the helpers asserted the value type and silently dropped
every page. Rules and synonyms were never exported, and scopes limited
to them failed with 'No config to export'.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T16:30:52.651669Z 375c1b1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

lgtm 🔥

@NatanTechofNY
NatanTechofNY merged commit 987a65a into main Nov 11, 2026
2 checks passed
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.

Config export does not export rules or synonyms

3 participants