[9.3] Loosen apiClient ESLint rule on Security (#252212)#252665
Merged
steliosmavro merged 2 commits intoelastic:9.3from Feb 11, 2026
Merged
[9.3] Loosen apiClient ESLint rule on Security (#252212)#252665steliosmavro merged 2 commits intoelastic:9.3from
apiClient ESLint rule on Security (#252212)#252665steliosmavro merged 2 commits intoelastic:9.3from
Conversation
## Summary The Security Solution team has test cases that intentionally use `esClient` directly without `apiClient`, so enforcing the `scout_require_api_client_in_api_test` rule on their scout tests produces false positives. Instead of excluding Security Solution from the rule entirely, this PR enhances the rule with a configurable `alternativeFixtures` schema option so it can accept additional fixtures per directory. ## Changes - Added `alternativeFixtures` schema option to `scout_require_api_client_in_api_test`, allowing directories to configure additional accepted fixtures via `.eslintrc.js` - Generalized `functionUsesApiClient` to `functionUsesFixture`, parameterizing the fixture name so the same detection logic works for any fixture - Error messages are dynamic and list only the accepted fixtures for the given configuration - Added a Security Solution override in `.eslintrc.js` with `alternativeFixtures: ['esClient']` so their tests accept either `apiClient` or `esClient` - Added unit tests for the new `alternativeFixtures` option --------- Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co> (cherry picked from commit 24d327b) # Conflicts: # x-pack/solutions/security/plugins/entity_store/test/scout/api/tests/dsl_translation.spec.ts # x-pack/solutions/security/plugins/entity_store/test/scout/api/tests/esql_translation.spec.ts # x-pack/solutions/security/plugins/entity_store/test/scout/api/tests/painless_translation.spec.ts
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
dmlemeshko
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.3:apiClientESLint rule on Security (#252212)Questions ?
Please refer to the Backport tool documentation