Skip to content

Commit 40f22c9

Browse files
authored
Merge branch 'main' into feat/specs-cURL-snippet
2 parents 9b2e727 + 1f715a1 commit 40f22c9

File tree

1,619 files changed

+31387
-77838
lines changed

Some content is hidden

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

1,619 files changed

+31387
-77838
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
# Java for code generation
2020
- name: Install Java
2121
if: inputs.type != 'minimal'
22-
uses: actions/setup-java@v4.3.0
22+
uses: actions/setup-java@v4.4.0
2323
with:
2424
distribution: zulu
2525
java-version-file: config/.java-version
@@ -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: 39 additions & 16 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
@@ -553,18 +571,23 @@ jobs:
553571
} >> "$GITHUB_OUTPUT"
554572
rm -rf tests/output/**/benchmarkResult.json
555573
574+
- name: Extract branch name
575+
id: extract_branch
576+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
577+
556578
- name: Push generated code
557579
id: pushGeneratedCode
558580
run: yarn workspace scripts pushGeneratedCode
559581
env:
560-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
582+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
561583
PR_NUMBER: ${{ github.event.number }}
584+
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
562585

563586
- name: update generation comment
564587
uses: marocchino/sticky-pull-request-comment@v2
565588
if: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT == '' }}
566589
with:
567-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
590+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
568591
message: |
569592
### No code generated
570593
@@ -576,7 +599,7 @@ jobs:
576599
uses: marocchino/sticky-pull-request-comment@v2
577600
if: ${{ steps.pushGeneratedCode.outputs.GENERATED_COMMIT != '' }}
578601
with:
579-
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN }}
602+
GITHUB_TOKEN: ${{ secrets.ALGOLIA_BOT_TOKEN != '' && secrets.ALGOLIA_BOT_TOKEN || secrets.GITHUB_TOKEN }}
580603
message: |
581604
### ✔️ Code generated!
582605

.github/workflows/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- run: git push -d origin generated/${{ github.head_ref }} || true
17+
- run: git push -d origin "generated/${{ github.head_ref }}" || true

.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

clients/algoliasearch-client-csharp/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [7.5.0](https://github.com/algolia/algoliasearch-client-csharp/compare/7.4.3...7.5.0)
2+
3+
- [788483537](https://github.com/algolia/api-clients-automation/commit/788483537) chore(clients): add workflow to auto-close PR ([#3834](https://github.com/algolia/api-clients-automation/pull/3834)) by [@shortcuts](https://github.com/shortcuts/)
4+
- [e59dd41d5](https://github.com/algolia/api-clients-automation/commit/e59dd41d5) fix(specs): API key description will be obfuscated ([#3840](https://github.com/algolia/api-clients-automation/pull/3840)) by [@kai687](https://github.com/kai687/)
5+
- [dc28c0268](https://github.com/algolia/api-clients-automation/commit/dc28c0268) feat(specs): add recommend batch rules endpoint ([#3782](https://github.com/algolia/api-clients-automation/pull/3782)) by [@raed667](https://github.com/raed667/)
6+
- [6f58ae2dc](https://github.com/algolia/api-clients-automation/commit/6f58ae2dc) chore(deps): dependencies 2024-09-30 ([#3842](https://github.com/algolia/api-clients-automation/pull/3842)) by [@algolia-bot](https://github.com/algolia-bot/)
7+
18
## [7.4.3](https://github.com/algolia/algoliasearch-client-csharp/compare/7.4.2...7.4.3)
29

310
- [022131871](https://github.com/algolia/api-clients-automation/commit/022131871) fix(specs): correct query params for ingestion [skip-bc] ([#3830](https://github.com/algolia/api-clients-automation/pull/3830)) by [@millotp](https://github.com/millotp/)

clients/algoliasearch-client-csharp/algoliasearch/Algolia.Search.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<RepositoryUrl>https://github.com/algolia/algoliasearch-client-csharp</RepositoryUrl>
2121
<RepositoryType>git</RepositoryType>
2222
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
23-
<Version>7.4.3</Version>
23+
<Version>7.5.0</Version>
2424
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2525
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
2626
<IncludeSymbols>true</IncludeSymbols>

clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class AbtestingConfig : AlgoliaConfig
2828
/// <param name="appId">Your application ID</param>
2929
/// <param name="apiKey">Your API Key</param>
3030
/// <param name="region">Targeted region (optional)</param>
31-
public AbtestingConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Abtesting", "7.4.3")
31+
public AbtestingConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Abtesting", "7.5.0")
3232
{
3333
DefaultHosts = GetDefaultHosts(region);
3434
Compression = CompressionType.None;

0 commit comments

Comments
 (0)