Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0a5d317
initial tests
guimachiavelli Oct 9, 2025
597d73b
add overview
guimachiavelli Oct 23, 2025
1db66d0
set references to top level for easier debugging
guimachiavelli Nov 13, 2025
e46d73f
Update code samples [skip ci]
github-actions[bot] Nov 13, 2025
fb65cd9
add openapi file with code samples
guimachiavelli Dec 9, 2025
c1d46e8
Add other languages
curquiza Dec 10, 2025
9d064b3
Remove example in docs.json
curquiza Dec 22, 2025
5fecc15
Add the newly and corrected open api file
curquiza Dec 22, 2025
74a717d
Remove useless files
curquiza Feb 5, 2026
a1d220c
New file for tests
curquiza Feb 5, 2026
d4f666d
Update code samples [skip ci]
github-actions[bot] Feb 5, 2026
a848ad0
Fix GitHub typo
curquiza Feb 5, 2026
6d3e870
Add right file for tests
curquiza Feb 5, 2026
98cb043
Add overview and errors page done by gui
curquiza Feb 8, 2026
4535c6f
Change name of section
curquiza Feb 8, 2026
502facb
Test CI with no node version
curquiza Feb 8, 2026
06b3f18
Fix link
curquiza Feb 8, 2026
bd203b9
Test CI
curquiza Feb 8, 2026
f2d8e5e
Update open api section
curquiza Feb 8, 2026
0ece54c
First version of open api CI
curquiza Feb 8, 2026
daa1bff
v2 of CI
curquiza Feb 8, 2026
3bd0cd8
Add CI to check code samples and open api file
curquiza Feb 9, 2026
de4ef1e
Update script to pull code samples
curquiza Feb 10, 2026
f68e231
Add pull request template
curquiza Feb 10, 2026
b88e4f7
Add CI to check validity of SDK code samples for docs
curquiza Feb 10, 2026
9bd6bac
Update code samples CI
curquiza Feb 10, 2026
d064907
Add missing assets
curquiza Feb 10, 2026
dd05522
Remove useless CI
curquiza Feb 10, 2026
df254bd
Remove useless files
curquiza Feb 10, 2026
1e775d6
Rename a job in CI
curquiza Feb 10, 2026
3969b6b
Add name to CI job
curquiza Feb 10, 2026
e1dc940
Make post deployment work on every commit on main
curquiza Feb 10, 2026
e154cd2
Improve CI for code samples
curquiza Feb 11, 2026
6f383f1
Make CI fetch only 1 open-api-file
curquiza Feb 13, 2026
73938e7
Add code sample for /fields route
curquiza Feb 13, 2026
64b932b
Add script to generate open-api-file for mintlify
curquiza Feb 13, 2026
8bd663c
Add script to package.json
curquiza Feb 13, 2026
b4bf130
Fix code samples import
curquiza Feb 13, 2026
79c8b0f
Rename script
curquiza Feb 13, 2026
49fd96f
Add new openAPI files
curquiza Feb 13, 2026
142219e
Add CI to generate new mintlify open API file
curquiza Feb 14, 2026
adb68a8
Remove old tip for authentication
curquiza Feb 15, 2026
715f464
Add openAPI files
curquiza Feb 16, 2026
ccfc21c
Use appropriate URL for API + make Guides section down
curquiza Feb 16, 2026
a4f050d
Fix link in docs
curquiza Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1576,3 +1576,8 @@ multi_search_remote_federated_1: |-
}
}
]
# post_indexes_indexUid_fields
list_index_fields_1: |-
curl \
-X POST 'MEILISEARCH_URL/indexes/INDEX_NAME/fields' \
-H 'Content-Type: application/json'
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Description

<!-- Describe the changes and purpose of the PR -->

## Checklist

For internal Meilisearch team member only:
- [ ] I checked and followed our [internal guidelines](https://www.notion.so/meilisearch/Updating-docs-for-engineers-3034b06b651f808da3c6c4f5e34914fc?source=copy_link)
- [ ] ⚠️ I updated the code samples according to our [internal guidelines](https://www.notion.so/meilisearch/Updating-docs-for-engineers-3034b06b651f808da3c6c4f5e34914fc?source=copy_link#3034b06b651f8026bd63cfa294dfa0c6)

For external maintainers
- [ ] 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.
- [ ] Have you made sure that the title is accurate and descriptive of the changes?
10 changes: 5 additions & 5 deletions .github/workflows/docs-sdk-code-samples-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Runs daily and on workflow_dispatch.
# - Job 1: Fails if local code samples are not properly used (route comment → OpenAPI, no comment → snippet in docs).
# - Job 2: Fails if any SDK has code samples not present in the local .code-samples.meilisearch.yaml.
# - Job 3: Informational only (never fails) – lists local samples missing from each SDK.
# - Job 3: Informational only (never fails) – lists CodeSamples* import keys missing from each SDK.
name: Check Docs & SDK code sample files

on:
Expand All @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v6

- name: Check local code samples are used
run: node scripts/check-code-samples-usage.mjs
run: npm run check-code-samples-usage

# Fails if an SDK's .code-samples.meilisearch.yaml contains keys absent from
# the local .code-samples.meilisearch.yaml (those SDK samples are useless).
Expand All @@ -34,10 +34,10 @@ jobs:
run: npm ci

- name: Check for unused SDK code samples
run: node scripts/check-unused-sdk-samples.mjs
run: npm run check-unused-sdk-samples

# Informational only – this job never fails.
# Lists local samples that are missing from each SDK.
# Lists code sample keys referenced by CodeSamples* imports in the docs that are missing from each SDK.
missing-sdk-samples:
name: "[Info only - never fails] Missing SDK code samples"
runs-on: ubuntu-latest
Expand All @@ -48,4 +48,4 @@ jobs:
run: npm ci

- name: List missing SDK code samples (informational, never fails)
run: node scripts/check-missing-sdk-samples.mjs
run: npm run check-missing-sdk-samples
34 changes: 34 additions & 0 deletions .github/workflows/openapi-code-samples-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# On every push to main, check meilisearch-openapi-mintlify.json for code samples:
# - Job 1: Ensure every route that has x-codeSamples includes a cURL sample (can fail).
# - Job 2: Informational only – list routes and all missing code sample languages (never fails).
name: OpenAPI code samples check

on:
workflow_dispatch:
push:
branches:
- main

jobs:
# Fails if any route with x-codeSamples has no cURL sample.
require-curl-samples:
name: Require cURL in x-codeSamples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Check routes have cURL in x-codeSamples
run: |
npm run check-openapi-code-samples -- curl-check assets/open-api/meilisearch-openapi-mintlify.json

# Informational only: list routes and missing code sample languages.
# This job never fails the workflow (information check only).
info-missing-code-samples:
name: "[Info only - never fails] Missing code samples per route"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: List routes and missing code samples (informational, never fails)
run: |
npm run check-openapi-code-samples -- info assets/open-api/meilisearch-openapi-mintlify.json || true
126 changes: 116 additions & 10 deletions .github/workflows/post-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,151 @@ name: Post Deployment

on:
workflow_dispatch:
# schedule:
# - cron: '0 23 * * *' # Every day at 11:00 PM UTC
# push:
# branches:
# - 'main'
schedule:
- cron: '0 23 * * *' # Every day at 11:00 PM UTC
push:
branches:
- 'main'

jobs:
update-samples:
build-code-samples:
name: Build code samples
runs-on: ubuntu-latest
outputs:
run_openapi_automation: ${{ steps.openapi_automation.outputs.run }}

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
token: ${{ secrets.GH_TOKEN }}

- name: Get OpenAPI automation flag from docs.json
id: openapi_automation
run: |
value=$(jq -r '.. | select(type == "object" and has("internal-meili-fetch-automation")) | .["internal-meili-fetch-automation"] | select(. != null) | tostring' docs.json 2>/dev/null | head -1)
echo "run=${value:-false}" >> "$GITHUB_OUTPUT"

- name: Setup Node.js
uses: actions/setup-node@v6

- name: Install dependencies
run: npm install

- name: Generate code sample snippets
run: node scripts/generate-code-sample-snippets.mjs
run: npm run generate-code-sample-snippets-file

- name: Check for changes
id: changes
run: |
echo "has_changes=$(git diff --quiet snippets/ && echo "false" || echo "true")" >> "$GITHUB_ENV"
if git diff --quiet snippets/; then
echo "has_changes=false" >> "$GITHUB_ENV"
else
echo "has_changes=true" >> "$GITHUB_ENV"
fi

- name: Commit changes
run: |
if [[ $has_changes == "true" ]]; then
echo "There are changes in the Git working directory."
git config user.name "meili-bot"
git config user.email "meili-bot@meilisearch.com"
git config user.email "robot@meilisearch.com"
git add snippets/
git commit -m "Update code samples"
git commit -m "[AUTOMATION POST DEPLOYMENT] Update code samples"
git push origin main
else
echo "No changes in the Git working directory."
fi

# We need to wait for build-code-samples to commit first so we can push a separate commit
# (avoid stacking both changes in one run and keep history clear).
# Only runs when docs.json has "internal-meili-fetch-automation": true.
# In case of issues with the latest release OpenAPI file: fetch the desired OpenAPI file
# manually, then set "internal-meili-fetch-automation" to false to prevent this automation from running.
fetch-openapi-file:
name: Fetch OpenAPI file from Meilisearch release
runs-on: ubuntu-latest
needs: build-code-samples
if: needs.build-code-samples.outputs.run_openapi_automation == 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: main
token: ${{ secrets.GH_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v6

- name: Fetch latest meilisearch-openapi.json from Meilisearch release
run: npm run fetch-meilisearch-openapi-file

- name: Check for changes
id: openapi_changes
run: |
if git diff --quiet assets/open-api/meilisearch-openapi.json; then
echo "has_changes=false" >> "$GITHUB_ENV"
else
echo "has_changes=true" >> "$GITHUB_ENV"
fi

- name: Commit changes
run: |
if [[ $has_changes == "true" ]]; then
echo "There are changes in the OpenAPI file."
git config user.name "meili-bot"
git config user.email "robot@meilisearch.com"
git add assets/open-api/meilisearch-openapi.json
git commit -m "[AUTOMATION POST DEPLOYMENT] Update meilisearch-openapi.json from latest Meilisearch release"
git push origin main
else
echo "No changes in the OpenAPI file."
fi

# Runs after fetch-openapi-file: generate Mintlify OpenAPI file, validate with mint openapi-check, commit if valid.
generate-and-check-mintlify-openapi:
name: Generate and check Mintlify OpenAPI file
runs-on: ubuntu-latest
needs: fetch-openapi-file

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: main
token: ${{ secrets.GH_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v6

- name: Install dependencies
run: npm install && npm install mintlify

- name: Generate Mintlify OpenAPI file
run: npm run generate-mintlify-openapi-file

- name: Validate OpenAPI with Mintlify CLI
run: npx mintlify openapi-check assets/open-api/meilisearch-openapi-mintlify.json

- name: Check for changes
id: mintlify_changes
run: |
if git diff --quiet assets/open-api/meilisearch-openapi-mintlify.json; then
echo "has_changes=false" >> "$GITHUB_ENV"
else
echo "has_changes=true" >> "$GITHUB_ENV"
fi

- name: Commit changes
run: |
if [[ $has_changes == "true" ]]; then
echo "There are changes in the Mintlify OpenAPI file."
git config user.name "meili-bot"
git config user.email "robot@meilisearch.com"
git add assets/open-api/meilisearch-openapi-mintlify.json
git commit -m "[AUTOMATION POST DEPLOYMENT] Update meilisearch-openapi-mintlify.json"
git push origin main
else
echo "No changes in the Mintlify OpenAPI file."
fi
34 changes: 0 additions & 34 deletions .github/workflows/pull-code-samples.yml

This file was deleted.

Loading