Skip to content

Add support for v30.1#45

Merged
jaeyson merged 4 commits intomainfrom
44-add-support-for-v301
Apr 13, 2026
Merged

Add support for v30.1#45
jaeyson merged 4 commits intomainfrom
44-add-support-for-v301

Conversation

@jaeyson
Copy link
Copy Markdown
Owner

@jaeyson jaeyson commented Apr 13, 2026

Closes #44

Summary by Sourcery

Add support for Typesense server version 30.1 across tests, CI, and local development, including minor API typing adjustment for analytics rules.

Enhancements:

  • Broaden the return type of upsert_analytics_rule/3 to handle both analytics rule responses and analytics rule schema responses.

Build:

  • Introduce a dedicated ci_v30.1.yml workflow running tests and linting against Typesense 30.1 across multiple Elixir/OTP versions.
  • Update the shared LLM workflow to consume the v30.1 CI workflow and adjust its Typesense/Elixir/OTP test matrix.
  • Relax linting in the v30.0 CI workflow matrix.

CI:

  • Ensure CI test selection uses the 30.1 tag and that many tests now run for Typesense 30.1 alongside existing supported versions.

Deployment:

  • Update the local development Docker configuration to use the Typesense 30.1 image.

Tests:

  • Extend existing integration and feature tests with a 30.1 version tag so they execute against Typesense 30.1 as well as earlier supported versions.

@jaeyson jaeyson self-assigned this Apr 13, 2026
@jaeyson jaeyson added the documentation Improvements or additions to documentation label Apr 13, 2026
@jaeyson jaeyson linked an issue Apr 13, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 13, 2026

Reviewer's Guide

Adds official support for Typesense v30.1 by updating version-tagged tests, CI workflows, and Docker configuration, and broadens the Analytics.upsert_analytics_rule return type to handle an additional server response schema.

File-Level Changes

Change Details Files
Add v30.1 to version-tagged tests and adjust version gating for existing scenarios.
  • Update @tag metadata in documents, collections, operations, connection, join, stemming, conversations, keys, stopwords, health, presets, debug, override, synonyms, analytics, curation, curation_sets, custom_client, and default_client tests to include version 30.1 alongside existing versions.
  • Extend v30.0-only tests (e.g., deprecation/behavior checks in synonyms, analytics, curation, curation_sets) to also run for v30.1, and in some cases gate older behavior for 29.0+ instead of 30.0+.
  • Ensure join-related tests that previously started at 29.0 now also cover 30.0 and 30.1.
test/operations/documents_test.exs
test/connection_test.exs
test/operations/join_test.exs
test/operations/operations_test.exs
test/operations/collections_test.exs
test/operations/stemming_test.exs
test/operations/conversations_test.exs
test/operations/keys_test.exs
test/operations/stopwords_test.exs
test/operations/health_test.exs
test/operations/presets_test.exs
test/custom_client_test.exs
test/default_client_test.exs
test/operations/synonyms_test.exs
test/operations/analytics_test.exs
test/operations/curation_sets_test.exs
test/operations/debug_test.exs
test/operations/curation_test.exs
test/operations/override_test.exs
Update CI workflows to run against Typesense v30.1 and adjust linting matrix.
  • Switch llm workflow to reuse new ci_v30.1 workflow instead of ci_v30.0.
  • Reorder the llm workflow matrix so 30.1 combinations are included and ensure 29.0 remains covered.
  • Disable linting in the v30.0 workflow matrix and introduce a new v30.1 workflow that runs linting on the 30.1/OTP 28/Elixir 1.18 job.
  • Remove workflow_call trigger from v29.0 and v30.0 workflows and configure trigger modes for the new v30.1 workflow.
.github/workflows/llm.yml
.github/workflows/ci_v30.0.yml
.github/workflows/ci_v29.0.yml
.github/workflows/ci_v30.1.yml
Align local/dev environment with Typesense v30.1.
  • Update docker-compose typesense service image from 29.0 to 30.1 to match the new default supported version.
docker-compose.yml
Broaden Analytics.upsert_analytics_rule return type to support a new response schema.
  • Change the @SPEC for upsert_analytics_rule to allow either AnalyticsRule or AnalyticsRuleSchema as the success tuple payload, reflecting API differences between versions.
  • Leave implementation logic unchanged, only adjusting the typespec to prevent Dialyzer/spec mismatches across Typesense versions.
lib/open_api_typesense/operations/analytics.ex

Assessment against linked issues

Issue Objective Addressed Explanation
#44 Configure the project to run against Typesense server v30.1 (tests, Docker, and CI workflows) so that the library is validated with Typesense 30.1.
#44 Update the library code and type specifications where necessary to be compatible with Typesense API v30.1 behavior and responses.

Possibly linked issues

  • Add support for v30.1 #44: PR updates tags, Docker image, workflows, and types to fully support Typesense v30.1 as requested in issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jaeyson jaeyson moved this to In Progress in OpenAPI Typesense Apr 13, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 4 issues, and left some high level feedback:

  • The @tag lists for Typesense versions are repeated verbatim across many tests; consider extracting these into shared module attributes or helper macros per major version to reduce duplication and make future version bumps less error‑prone.
  • The new ci_v30.1.yml workflow is both reusable (workflow_call) and directly triggered on pull_request, while llm.yml also calls it via uses; this will cause duplicate runs on PRs, so you may want to remove the direct pull_request trigger from the reusable workflow and keep it only in the caller.
  • In ci_v30.1.yml, the cache save step references steps.beam.outputs.*, but the setup-beam step has no id: beam; either add id: beam to that step or adjust the cache key to avoid referring to a non‑existent step output.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `@tag` lists for Typesense versions are repeated verbatim across many tests; consider extracting these into shared module attributes or helper macros per major version to reduce duplication and make future version bumps less error‑prone.
- The new `ci_v30.1.yml` workflow is both reusable (`workflow_call`) and directly triggered on `pull_request`, while `llm.yml` also calls it via `uses`; this will cause duplicate runs on PRs, so you may want to remove the direct `pull_request` trigger from the reusable workflow and keep it only in the caller.
- In `ci_v30.1.yml`, the cache save step references `steps.beam.outputs.*`, but the `setup-beam` step has no `id: beam`; either add `id: beam` to that step or adjust the cache key to avoid referring to a non‑existent step output.

## Individual Comments

### Comment 1
<location path=".github/workflows/ci_v30.1.yml" line_range="24-25" />
<code_context>
+  # - [skip actions]
+  # - [actions skip]
+
+  test:
+    if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
+    runs-on: ubuntu-latest
+    environment: review
</code_context>
<issue_to_address>
**issue (bug_risk):** The `test` job will never run when this workflow is invoked via `workflow_call` (e.g. from `llm.yml`).

Because the `if` only allows `push` or `pull_request`, this job is always skipped when invoked via `workflow_call`, so `llm.yml` does not actually run these CI steps.

If this job should also run when used as a reusable workflow, either remove the `if` altogether or expand it to include `workflow_call` (e.g. by allowing any event except `schedule`, or explicitly checking for `workflow_call`).
</issue_to_address>

### Comment 2
<location path=".github/workflows/ci_v30.1.yml" line_range="46-51" />
<code_context>
-          lint: true
+          lint: false

     services:
       typesense:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Typesense is defined both as a GitHub Actions service and started manually with `docker run`, which is redundant and may conflict.

You both define a `services.typesense` container and start another Typesense via `docker run` on port 8108. Only the manually started instance is actually waited on, so the service container is unused and can cause port/name conflicts. Please choose a single approach: either rely on the `services.typesense` container and drop the manual `docker run`, or remove the `services` block and use only the manually started container.

```suggestion
    steps:
      - name: Checkout repo
```
</issue_to_address>

### Comment 3
<location path=".github/workflows/ci_v30.1.yml" line_range="155-164" />
<code_context>
+        run: mix coveralls.github
+        if: ${{ matrix.lint && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
+
+      - name: Save cache
+        id: cache_save
+        uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7
+        if: ${{ matrix.lint }}
+        with:
+          path: |
+            deps
+            _build
+            priv/plts
+          key: |
+            ${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
</code_context>
<issue_to_address>
**issue (performance):** The cache save key does not match the restore key and references a non-existent `beam` step.

The restore key uses `matrix.typesense`, `matrix.otp`, and `matrix.elixir`, while the save key uses `${{ steps.beam.outputs.otp-version }}` and `${{ steps.beam.outputs.elixir-version }}`. Since there is no step with `id: beam`, those outputs will be empty and the save key will never match the restore key, so the cache won't be reused.

To fix this, either:
- Give the `erlef/setup-beam` step `id: beam` and use its outputs in both restore and save keys, or
- Use the same `matrix.*`-based key in both steps.
</issue_to_address>

### Comment 4
<location path=".github/workflows/ci_v30.0.yml" line_range="43" />
<code_context>
           otp: '28'
           elixir: '1.18'
-          lint: true
+          lint: false

     services:
</code_context>
<issue_to_address>
**issue (testing):** Disabling `lint` here means this workflow no longer runs any lint/static-analysis steps in any matrix variant.

This change disables the only matrix entry that previously ran the lint/static-analysis steps (`deps.unlock --check-unused`, `hex.audit`, `deps.audit`, Credo, format, Dialyzer, Coveralls`), so `ci_v30.0.yml` will no longer run any linting. If you still want lint/static analysis in this workflow, keep this entry as `lint: true` or designate another matrix entry for linting instead.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 13, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

codescene-delta-analysis[bot]

This comment was marked as outdated.

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Absence of Expected Change Pattern

  • open_api_typesense/lib/open_api_typesense/operations/analytics.ex is usually changed with: open_api_typesense/lib/open_api_typesense/operations/debug.ex, open_api_typesense/lib/open_api_typesense/operations/collections.ex, open_api_typesense/lib/open_api_typesense/operations/operations.ex, open_api_typesense/lib/open_api_typesense/operations/synonyms.ex, open_api_typesense/lib/open_api_typesense/operations/override.ex, open_api_typesense/lib/open_api_typesense/operations/presets.ex, open_api_typesense/lib/open_api_typesense/operations/curation.ex, open_api_typesense/lib/open_api_typesense/operations/conversations.ex

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@jaeyson jaeyson merged commit 71dcc92 into main Apr 13, 2026
26 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenAPI Typesense Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add support for v30.1

1 participant