Skip to content

Commit c826426

Browse files
authored
Add support for v30.0 (#41)
* fix test case not passing on Typesense v30.0 * consolidate caches for plt and mix dependencies * fix test failing on empty list * update CHANGELOG.md * update ci_v30.0.yml * add accessibility in url in markdown in CHANGELOG.md * update analytics * update natural language search model test * fix line break or newlines in json decoding * Add assertion for exceeding quota for using models * remove failing assertion * update llm.yml * update CHANGELOG.md [skip ci]
1 parent 7c12234 commit c826426

58 files changed

Lines changed: 3274 additions & 632 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dev.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export GOOGLE_GEMINI_API="YOUR_GOOGLE_AI_STUDIO_API_KEY"

.github/workflows/ci_v26.0.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252

5353
steps:
5454
- name: Checkout repo
55-
uses: actions/checkout@v6
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5656

5757
- name: Check for misspellings
58-
uses: codespell-project/actions-codespell@v2
58+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
5959

6060
- name: Start Typesense
6161
run: |
@@ -93,13 +93,13 @@ jobs:
9393
echo "Typesense healthcheck elapsed: ${elapsed}s"
9494
9595
- name: Setup Elixir/OTP
96-
uses: erlef/setup-beam@v1
96+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
9797
with:
9898
otp-version: ${{matrix.otp}}
9999
elixir-version: ${{matrix.elixir}}
100100

101101
- name: Cache dependencies/builds
102-
uses: actions/cache@v5
102+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
103103
with:
104104
path: |
105105
deps

.github/workflows/ci_v27.0.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252

5353
steps:
5454
- name: Checkout repo
55-
uses: actions/checkout@v6
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5656

5757
- name: Check for misspellings
58-
uses: codespell-project/actions-codespell@v2
58+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
5959

6060
- name: Start Typesense
6161
run: |
@@ -93,13 +93,13 @@ jobs:
9393
echo "Typesense healthcheck elapsed: ${elapsed}s"
9494
9595
- name: Setup Elixir/OTP
96-
uses: erlef/setup-beam@v1
96+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
9797
with:
9898
otp-version: ${{matrix.otp}}
9999
elixir-version: ${{matrix.elixir}}
100100

101101
- name: Cache dependencies/builds
102-
uses: actions/cache@v5
102+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
103103
with:
104104
path: |
105105
deps

.github/workflows/ci_v27.1.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ jobs:
5252

5353
steps:
5454
- name: Checkout repo
55-
uses: actions/checkout@v6
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5656

5757
- name: Check for misspellings
58-
uses: codespell-project/actions-codespell@v2
58+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
5959

6060
- name: Start Typesense
6161
run: |
@@ -93,13 +93,13 @@ jobs:
9393
echo "Typesense healthcheck elapsed: ${elapsed}s"
9494
9595
- name: Setup Elixir/OTP
96-
uses: erlef/setup-beam@v1
96+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
9797
with:
9898
otp-version: ${{matrix.otp}}
9999
elixir-version: ${{matrix.elixir}}
100100

101101
- name: Cache dependencies/builds
102-
uses: actions/cache@v5
102+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
103103
with:
104104
path: |
105105
deps

.github/workflows/ci_v28.0.yml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848

4949
steps:
5050
- name: Checkout repo
51-
uses: actions/checkout@v6
51+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5252

5353
- name: Check for misspellings
54-
uses: codespell-project/actions-codespell@v2
54+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
5555

5656
- name: Start Typesense
5757
run: |
@@ -89,13 +89,13 @@ jobs:
8989
echo "Typesense healthcheck elapsed: ${elapsed}s"
9090
9191
- name: Setup Elixir/OTP
92-
uses: erlef/setup-beam@v1
92+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
9393
with:
9494
otp-version: ${{matrix.otp}}
9595
elixir-version: ${{matrix.elixir}}
9696

9797
- name: Cache dependencies/builds
98-
uses: actions/cache@v5
98+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
9999
with:
100100
path: |
101101
deps
@@ -133,36 +133,6 @@ jobs:
133133
run: mix format --check-formatted
134134
if: ${{ matrix.lint }}
135135

136-
- name: Restore PLT cache
137-
id: plt_cache
138-
uses: actions/cache/restore@v5
139-
with:
140-
key: |
141-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
142-
restore-keys: |
143-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
144-
path: |
145-
priv/plts
146-
if: ${{ matrix.lint }}
147-
148-
- name: Create PLTs
149-
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
150-
run: mix dialyzer --plt
151-
152-
- name: Save PLT cache
153-
id: plt_cache_save
154-
uses: actions/cache/save@v5
155-
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
156-
with:
157-
key: |
158-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
159-
path: |
160-
priv/plts
161-
162-
- name: Dialyzer
163-
run: mix dialyzer --format github --format dialyxir
164-
if: ${{ matrix.lint }}
165-
166136
- name: Run tests
167137
run: mix test --only ${{ matrix.typesense }}:true --trace
168138

.github/workflows/ci_v29.0.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ jobs:
4141
- typesense: '29.0'
4242
otp: '28'
4343
elixir: '1.18'
44-
lint: true
44+
lint: false
4545

4646
services:
4747
typesense:
4848
image: typesense/typesense:${{ matrix.typesense }}
4949

5050
steps:
5151
- name: Checkout repo
52-
uses: actions/checkout@v6
52+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
5353

5454
- name: Check for misspellings
55-
uses: codespell-project/actions-codespell@v2
55+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
5656

5757
- name: Start Typesense
5858
run: |
@@ -90,13 +90,13 @@ jobs:
9090
echo "Typesense healthcheck elapsed: ${elapsed}s"
9191
9292
- name: Setup Elixir/OTP
93-
uses: erlef/setup-beam@v1
93+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
9494
with:
9595
otp-version: ${{matrix.otp}}
9696
elixir-version: ${{matrix.elixir}}
9797

9898
- name: Cache dependencies/builds
99-
uses: actions/cache@v5
99+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
100100
with:
101101
path: |
102102
deps
@@ -134,36 +134,6 @@ jobs:
134134
run: mix format --check-formatted
135135
if: ${{ matrix.lint }}
136136

137-
- name: Restore PLT cache
138-
id: plt_cache
139-
uses: actions/cache/restore@v5
140-
with:
141-
key: |
142-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
143-
restore-keys: |
144-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
145-
path: |
146-
priv/plts
147-
if: ${{ matrix.lint }}
148-
149-
- name: Create PLTs
150-
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
151-
run: mix dialyzer --plt
152-
153-
- name: Save PLT cache
154-
id: plt_cache_save
155-
uses: actions/cache/save@v5
156-
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
157-
with:
158-
key: |
159-
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
160-
path: |
161-
priv/plts
162-
163-
- name: Dialyzer
164-
run: mix dialyzer --format github --format dialyxir
165-
if: ${{ matrix.lint }}
166-
167137
- name: Run tests
168138
run: mix test --only ${{ matrix.typesense }}:true --only nls:true --trace
169139

.github/workflows/ci_v30.0.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: CI v30.0
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
branches: ["main"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
14+
# Workflows that would otherwise be triggered using `on: push` or
15+
# `on: pull_request` won't be triggered if you add any of the
16+
# following strings to the commit message in a push, or the HEAD
17+
# commit of a pull request:
18+
# - [skip ci]
19+
# - [ci skip]
20+
# - [no ci]
21+
# - [skip actions]
22+
# - [actions skip]
23+
24+
test:
25+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
26+
runs-on: ubuntu-latest
27+
environment: review
28+
29+
env:
30+
MIX_ENV: test
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
LATEST_TYPESENSE: '30.0'
33+
34+
strategy:
35+
matrix:
36+
include:
37+
- typesense: '30.0'
38+
otp: '25'
39+
elixir: '1.14'
40+
lint: false
41+
- typesense: '30.0'
42+
otp: '28'
43+
elixir: '1.18'
44+
lint: true
45+
46+
services:
47+
typesense:
48+
image: typesense/typesense:${{ matrix.typesense }}
49+
50+
steps:
51+
- name: Checkout repo
52+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
53+
54+
- name: Check for misspellings
55+
uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579
56+
57+
- name: Start Typesense
58+
run: |
59+
docker run -id \
60+
-p 8108:8108 \
61+
--name typesense \
62+
-v /tmp/typesense-data:/data \
63+
-v /tmp/typesense-analytics-data:/analytics-data \
64+
typesense/typesense:${{ matrix.typesense}} \
65+
--api-key xyz \
66+
--data-dir /data \
67+
--enable-search-analytics=true \
68+
--analytics-dir=/analytics-data \
69+
--analytics-flush-interval=60 \
70+
--analytics-minute-rate-limit=100 \
71+
--enable-cors
72+
73+
- name: Wait for Typesense to be healthy
74+
shell: bash
75+
run: |
76+
start_time=$(date +%s)
77+
timeout=30
78+
counter=0
79+
until curl -s http://localhost:8108/health | grep -q '"ok":true'; do
80+
if [ $counter -eq $timeout ]; then
81+
echo "Timed out waiting for Typesense to be healthy"
82+
exit 1
83+
fi
84+
echo "Waiting for Typesense to be healthy..."
85+
sleep 1
86+
counter=$((counter + 1))
87+
done
88+
end_time=$(date +%s)
89+
elapsed=$((end_time - start_time))
90+
echo "Typesense healthcheck elapsed: ${elapsed}s"
91+
92+
- name: Setup Elixir/OTP
93+
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93
94+
with:
95+
otp-version: ${{matrix.otp}}
96+
elixir-version: ${{matrix.elixir}}
97+
98+
- name: Restore cache
99+
id: cache_restore
100+
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7
101+
if: ${{ matrix.lint }}
102+
with:
103+
path: |
104+
deps
105+
_build
106+
priv/plts
107+
key: ${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp}}-${{ matrix.elixir}}-mix-${{ hashFiles('**/mix.lock') }}
108+
restore-keys: |
109+
${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
110+
111+
- name: Install Dependencies
112+
run: |
113+
mix local.rebar --if-missing
114+
mix local.hex --if-missing
115+
mix deps.get
116+
117+
- name: Find unused dependencies
118+
run: mix deps.unlock --check-unused
119+
if: ${{ matrix.lint }}
120+
121+
- name: Check retired dependencies
122+
run: mix hex.audit
123+
if: ${{ matrix.lint }}
124+
125+
- name: Security audit of dependencies
126+
run: mix deps.audit
127+
if: ${{ matrix.lint }}
128+
129+
- name: Compile project
130+
run: mix compile --all-warnings
131+
132+
- name: Run static analysis
133+
run: mix credo --all --strict
134+
if: ${{ matrix.lint }}
135+
136+
- name: Check format files
137+
run: mix format --check-formatted
138+
if: ${{ matrix.lint }}
139+
140+
- name: Create PLTs
141+
if: ${{ steps.cache_restore.outputs.cache-hit != 'true' && matrix.lint }}
142+
run: mix dialyzer --plt
143+
144+
- name: Dialyzer
145+
run: mix dialyzer --format github --format dialyxir
146+
if: ${{ matrix.lint }}
147+
148+
- name: Run tests
149+
run: mix test --only ${{ matrix.typesense }}:true --only nls:true --trace
150+
151+
- name: Post test coverage to Coveralls
152+
run: mix coveralls.github
153+
if: ${{ matrix.lint && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
154+
155+
- name: Save cache
156+
id: cache_save
157+
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7
158+
if: ${{ matrix.lint }}
159+
with:
160+
path: |
161+
deps
162+
_build
163+
priv/plts
164+
key: |
165+
${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}

0 commit comments

Comments
 (0)