Skip to content

Commit fd24f7e

Browse files
authored
Merge branch 'main' into feat(csharp)-add-support-for-widgets-in-rendering-content
2 parents 5473125 + 0cdb866 commit fd24f7e

File tree

273 files changed

+2411
-62868
lines changed

Some content is hidden

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

273 files changed

+2411
-62868
lines changed

.eslintrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ module.exports = {
209209

210210
plugins: ['@vitest/eslint-plugin'],
211211
},
212+
{
213+
files: ['guides/**/*.ts'],
214+
215+
rules: {
216+
'no-console': 0,
217+
218+
// TODO: remove this after https://algolia.atlassian.net/browse/DI-2984
219+
'@typescript-eslint/no-unused-vars': 0,
220+
'@typescript-eslint/explicit-function-return-type': 0,
221+
},
222+
},
212223
{
213224
files: ['*.json'],
214225
parserOptions: {

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ runs:
4545

4646
- name: Install JavaScript dependencies
4747
shell: bash
48-
run: YARN_ENABLE_HARDENED_MODE=0 yarn install
48+
run: YARN_ENABLE_HARDENED_MODE=0 YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
4949

5050
- name: Build scripts
5151
shell: bash

.github/workflows/check.yml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121
notification:
2222
runs-on: ubuntu-22.04
2323
timeout-minutes: 1
24-
if: ${{ !github.event.pull_request.head.repo.fork && github.event.number }}
24+
if: ${{ github.event.number }}
2525
permissions:
2626
pull-requests: write
2727
steps:
2828
- uses: actions/checkout@v4
2929

3030
- uses: marocchino/sticky-pull-request-comment@v2
3131
with:
32-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
32+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
3333
message: |
3434
### 🪓 The generated code will be pushed at the end of the CI.
3535
@@ -174,7 +174,7 @@ jobs:
174174
path: ${{ fromJSON(needs.setup.outputs.SPECS_MATRIX).bundledPath }}
175175

176176
client_gen_javascript:
177-
timeout-minutes: 10
177+
timeout-minutes: 15
178178
runs-on: ubuntu-22.04
179179
needs:
180180
- setup
@@ -265,21 +265,30 @@ jobs:
265265
- name: Run e2e CTS
266266
id: cts-e2e
267267
continue-on-error: true
268-
if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
268+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
269269
run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
270270

271271
- name: Retry e2e CTS
272-
if: ${{ !github.event.pull_request.head.repo.fork && steps.cts-e2e.outcome == 'failure' }}
272+
if: ${{ steps.cts-e2e.outcome == 'failure' }}
273273
run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --no-client --no-requests
274274

275275
- name: Run benchmarks
276276
run: yarn cli cts run javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }} --benchmark --no-client --no-requests --no-e2e
277277

278-
- name: Generate code snippets for documentation
278+
- name: Generate code snippets
279279
run: yarn cli snippets javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
280+
281+
- name: Build the snippets to check validity
282+
run: yarn cli build snippets javascript
283+
284+
- name: Generate code guides
285+
run: yarn cli guides javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).toRun }}
286+
287+
- name: Build the guides to check validity
288+
run: yarn cli build guides javascript
280289

281290
- name: Zip artifact before storing
282-
run: zip -r -y clients-javascript.zip clients/algoliasearch-client-javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).testsToStore }} ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).snippetsToStore }} -x "**/node_modules**" "**/.yarn/cache/**" "**/.yarn/install-state.gz" "**/build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/.nx/**"
291+
run: zip -r -y clients-javascript.zip clients/algoliasearch-client-javascript ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).testsToStore }} ${{ fromJSON(needs.setup.outputs.JAVASCRIPT_DATA).guidesToStore }} -x "**/node_modules**" "**/.yarn/cache/**" "**/.yarn/install-state.gz" "**/build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/.nx/**"
283292

284293
- name: Store javascript clients
285294
uses: actions/upload-artifact@v4
@@ -370,26 +379,32 @@ jobs:
370379
- name: Run e2e CTS
371380
id: cts-e2e
372381
continue-on-error: true
373-
if: ${{ !github.event.pull_request.head.repo.fork && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
382+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' && !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') }}
374383
run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
375384

376385
- name: Retry e2e CTS
377-
if: ${{ !github.event.pull_request.head.repo.fork && steps.cts-e2e.outcome == 'failure' }}
386+
if: ${{ steps.cts-e2e.outcome == 'failure' }}
378387
run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --no-client --no-requests
379388

380389
- name: Run benchmarks
381390
if: ${{ matrix.client.isMainVersion }}
382391
run: yarn cli cts run ${{ matrix.client.language }} ${{ matrix.client.toRun }} --benchmark --no-client --no-requests --no-e2e
383392

384-
- name: Generate code snippets for documentation
393+
- name: Generate code snippets
385394
run: yarn cli snippets ${{ matrix.client.language }} ${{ matrix.client.toRun }}
386395

387396
- name: Build the snippets to check validity
388397
run: yarn cli build snippets ${{ matrix.client.language }}
389398

399+
- name: Generate code guides
400+
run: yarn cli guides ${{ matrix.client.language }} ${{ matrix.client.toRun }}
401+
402+
- name: Build the guides to check validity
403+
run: yarn cli build guides ${{ matrix.client.language }}
404+
390405
- name: Zip artifact before storing
391406
if: ${{ matrix.client.isMainVersion }}
392-
run: zip -r -y clients-${{ matrix.client.language }}.zip ${{ matrix.client.path }} ${{ matrix.client.testsToStore }} ${{ matrix.client.snippetsToStore }} -x "**/node_modules**" "**/__pycache__/**" "**/.yarn/cache/**" "**/build/**" "**/.build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/vendor/**" "**/target/**" "**/.dart_tool/**"
407+
run: zip -r -y clients-${{ matrix.client.language }}.zip ${{ matrix.client.path }} ${{ matrix.client.testsToStore }} ${{ matrix.client.guidesToStore }} -x "**/node_modules**" "**/__pycache__/**" "**/.yarn/cache/**" "**/build/**" "**/.build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/vendor/**" "**/target/**" "**/.dart_tool/**"
393408

394409
- name: Store ${{ matrix.client.language }} clients
395410
if: ${{ matrix.client.isMainVersion }}
@@ -464,22 +479,26 @@ jobs:
464479
name: client swift${{ needs.setup.outputs.RUN_MACOS_SWIFT_CTS == 'true' && format('@{0}', fromJSON(needs.setup.outputs.SWIFT_DATA).version) || '' }} macos
465480
steps:
466481
- uses: actions/checkout@v4
482+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
467483

468484
- name: Download artifacts
485+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
469486
uses: ./scripts/ci/actions/restore-artifacts
470487
with:
471488
type: languages
472489
languages: |
473490
swift
474491
475492
- name: Setup
493+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
476494
uses: ./.github/actions/setup
477495
with:
478496
type: minimal
479497
language: swift
480498
version: ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).version }}
481499

482500
- name: Run tests on macOS
501+
if: ${{ env.ALGOLIA_APPLICATION_ID != '' }}
483502
id: run-test
484503
continue-on-error: true
485504
run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v ${{ !contains(format('{0} {1}', github.event.pull_request.title, github.event.head_commit.message), '[skip-e2e]') && '--no-e2e' || '' }}
@@ -513,8 +532,7 @@ jobs:
513532
with:
514533
fetch-depth: 0
515534
ref: ${{ github.event.pull_request.head.ref }}
516-
token: ${{ secrets.ALGOLIA_BOT_TOKEN }}
517-
repository: ${{ github.event.pull_request.head.repo.full_name }}
535+
token: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
518536

519537
- name: Download all artifacts
520538
uses: ./scripts/ci/actions/restore-artifacts
@@ -557,14 +575,14 @@ jobs:
557575
id: pushGeneratedCode
558576
run: yarn workspace scripts pushGeneratedCode
559577
env:
560-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
578+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
561579
PR_NUMBER: ${{ github.event.number }}
562580

563581
- name: update generation comment
564582
uses: marocchino/sticky-pull-request-comment@v2
565583
if: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT == '' }}
566584
with:
567-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
585+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
568586
message: |
569587
### No code generated
570588
@@ -576,7 +594,7 @@ jobs:
576594
uses: marocchino/sticky-pull-request-comment@v2
577595
if: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT != '' }}
578596
with:
579-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
597+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
580598
message: |
581599
### ✔️ Code generated!
582600
@@ -645,9 +663,8 @@ jobs:
645663
- uses: actions/checkout@v4
646664
with:
647665
fetch-depth: 0
648-
ref: ${{ needs.codegen.outputs.generatedCommit }}
666+
ref: ${{ github.event.pull_request.head.ref }}
649667
token: ${{ secrets.ALGOLIA_BOT_TOKEN }}
650-
repository: ${{ github.event.pull_request.head.repo.full_name }}
651668

652669
- name: Setup
653670
uses: ./.github/actions/setup

.github/workflows/pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Pull Request title rules
1717
uses: Slashgear/[email protected]
1818
with:
19-
regexp: '^(docs|chore|snippets)|((?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)\((?:clients|generators|playground|csharp|dart|go|java|javascript|kotlin|php|python|ruby|scala|swift|cts|specs|scripts|ci|templates|deps)\)): .+'
19+
regexp: '^(docs|chore|snippets|guides)|((?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)\((?:clients|generators|playground|csharp|dart|go|java|javascript|kotlin|php|python|ruby|scala|swift|cts|specs|scripts|ci|templates|deps)\)): .+'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ pubspec.lock
5555
swiftformat
5656

5757
foo
58+
59+
/snippets

0 commit comments

Comments
 (0)