Skip to content

Enable request overrides at the *Builder level and HyperClient method calls#149

Open
michaelborn wants to merge 11 commits intodevelopmentfrom
feat/allow-dynamic-override-connection-timeout
Open

Enable request overrides at the *Builder level and HyperClient method calls#149
michaelborn wants to merge 11 commits intodevelopmentfrom
feat/allow-dynamic-override-connection-timeout

Conversation

@michaelborn
Copy link
Contributor

@michaelborn michaelborn commented Mar 13, 2026

This PR adds the ability to set custom connection parameters for each request, both at the Builder level:

var response = getWirebox()
	.getInstance( "IndexBuilder@cbelasticsearch" )
	.withTimeout( 45 )
	.withHeader( "My-Custom-Header", "value" )
	.new( name = "foo", settings = { "refresh_interval" : "1s" } )
	.save();

as well as the individual HyperClient method calls like applyIndex(), indexExists(), executeSearch(), etc.:

var response = getWirebox()
	.getInstance( "HyperClient@cbelasticsearch" )
	.indexExists( "bar", { timeout = 300 } );

@michaelborn michaelborn marked this pull request as draft March 13, 2026 16:36
@gitguardian
Copy link

gitguardian bot commented Mar 13, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
28573790 Triggered Username Password b6caa22 test-harness/tests/specs/unit/HyperClientTest.cfc View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@michaelborn michaelborn requested a review from Copilot March 13, 2026 17:09
@michaelborn michaelborn marked this pull request as ready for review March 13, 2026 17:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces per-request connection/request configuration overrides across cbElasticsearch’s fluent builders (e.g., IndexBuilder, SearchBuilder, Document) and direct HyperClient method calls, allowing callers to tweak request-level settings such as timeouts, headers, and credentials without changing global config.

Changes:

  • Added a shared BaseModel that captures fluent .with*() calls into a requestOverrides struct for builder/model instances.
  • Extended HyperPool.newRequest() and many HyperClient methods to accept a requestOverrides struct and apply it to the underlying HyperRequest.
  • Added unit tests and documentation describing builder-level overrides and direct client call overrides.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
test-harness/tests/specs/unit/HyperClientTest.cfc Adds unit tests covering request override behavior (timeout, credentials, headers).
models/io/HyperPool.cfc Adds overrides parameter to newRequest() and attempts to apply override keys onto HyperRequest instances.
models/io/HyperClient.cfc Threads requestOverrides through many public API calls and merges them with builder-level overrides.
models/SearchBuilder.cfc Extends BaseModel to support fluent request overrides.
models/Pipeline.cfc Extends BaseModel to support fluent request overrides.
models/IndexBuilder.cfc Extends BaseModel to support fluent request overrides.
models/ILMPolicyBuilder.cfc Extends BaseModel to support fluent request overrides.
models/Document.cfc Extends BaseModel to support fluent request overrides.
models/BaseModel.cfc New base class implementing requestOverrides storage and .with*() capture via onMissingMethod().
models/AliasBuilder.cfc Extends BaseModel to support fluent request overrides.
docs/Getting-Started/Configuration.md Documents request override usage, merge precedence, and examples for builders and HyperClient calls.

michaelborn and others added 5 commits March 13, 2026 14:50
@github-actions
Copy link

github-actions bot commented Mar 13, 2026

lucee@5 Test Results

0 tests   - 255   0 ✅  - 255   0s ⏱️ -58s
0 suites  -  17   0 💤 ±  0 
0 files    -   1   0 ❌ ±  0 

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

adobe@2025 Test Results

  1 files  ± 0  17 suites  ±0   20s ⏱️ -39s
180 tests  - 75  92 ✅  - 163  0 💤 ±0  24 ❌ +24  64 🔥 +64 
177 runs   - 78  95 ✅  - 160  0 💤 ±0  24 ❌ +24  58 🔥 +58 

For more details on these failures and errors, see this check.

Results for commit e9ab26d. ± Comparison against base commit 0a12b02.

This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests new() with only an index argument
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests setters with get()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to persist a Document via save()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to reset a document
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests can save a document with a space in the id
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a callback for the builder syntax
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a full properties struct
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with no arguments
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests that a partial settings struct passed to new() will not override the defaults
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests the ability to reset the index builder
…
tests.specs.unit.DocumentTest ‑ tests.specs.unit.DocumentTest
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides BaseModel will throw on missing method
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom request headers
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom username/password
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set request overrides from IndexBuilder
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides indexExists() - can set custom connection timeout
tests.specs.unit.IndexBuilderTest ‑ tests.specs.unit.IndexBuilderTest
tests.specs.unit.SearchBuilderTest ‑ tests.specs.unit.SearchBuilderTest

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

adobe@2025 Test Results

  1 files  ± 0  17 suites  ±0   19s ⏱️ -40s
180 tests  - 75  92 ✅  - 163  0 💤 ±0  24 ❌ +24  64 🔥 +64 
177 runs   - 78  95 ✅  - 160  0 💤 ±0  24 ❌ +24  58 🔥 +58 

For more details on these failures and errors, see this check.

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests new() with only an index argument
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests setters with get()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to persist a Document via save()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to reset a document
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests can save a document with a space in the id
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a callback for the builder syntax
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a full properties struct
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with no arguments
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests that a partial settings struct passed to new() will not override the defaults
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests the ability to reset the index builder
…
tests.specs.unit.DocumentTest ‑ tests.specs.unit.DocumentTest
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides BaseModel will throw on missing method
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom request headers
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom username/password
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set request overrides from IndexBuilder
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides indexExists() - can set custom connection timeout
tests.specs.unit.IndexBuilderTest ‑ tests.specs.unit.IndexBuilderTest
tests.specs.unit.SearchBuilderTest ‑ tests.specs.unit.SearchBuilderTest

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

boxlang@be Test Results

260 tests  +5   260 ✅ +5   1m 1s ⏱️ -1s
 17 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

adobe@2023 Test Results

  1 files  ± 0  17 suites  ±0   21s ⏱️ -39s
180 tests  - 75  92 ✅  - 163  0 💤 ±0  24 ❌ +24  64 🔥 +64 
177 runs   - 78  95 ✅  - 160  0 💤 ±0  24 ❌ +24  58 🔥 +58 

For more details on these failures and errors, see this check.

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests new() with only an index argument
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests setters with get()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to persist a Document via save()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to reset a document
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests can save a document with a space in the id
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a callback for the builder syntax
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a full properties struct
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with no arguments
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests that a partial settings struct passed to new() will not override the defaults
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests the ability to reset the index builder
…
tests.specs.unit.DocumentTest ‑ tests.specs.unit.DocumentTest
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides BaseModel will throw on missing method
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom request headers
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom username/password
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set request overrides from IndexBuilder
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides indexExists() - can set custom connection timeout
tests.specs.unit.IndexBuilderTest ‑ tests.specs.unit.IndexBuilderTest
tests.specs.unit.SearchBuilderTest ‑ tests.specs.unit.SearchBuilderTest

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

boxlang@1 Test Results

260 tests  +5   260 ✅ +5   1m 1s ⏱️ -1s
 17 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

lucee@6 Test Results

260 tests  +5   260 ✅ +5   54s ⏱️ -3s
 17 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Mar 13, 2026

adobe@2021 Test Results

  1 files  ± 0  17 suites  ±0   20s ⏱️ -40s
180 tests  - 75  92 ✅  - 163  0 💤 ±0  24 ❌ +24  64 🔥 +64 
177 runs   - 78  95 ✅  - 160  0 💤 ±0  24 ❌ +24  58 🔥 +58 

For more details on these failures and errors, see this check.

Results for commit 834dfcc. ± Comparison against base commit 0a12b02.

This pull request removes 83 and adds 8 tests. Note that renamed tests count towards both.
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests new() with only an index argument
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests setters with get()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to persist a Document via save()
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests Tests the ability to reset a document
tests.specs.unit.DocumentTest ‑ Performs cbElasticsearch Document tests can save a document with a space in the id
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a callback for the builder syntax
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with a full properties struct
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests new() with no arguments
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests that a partial settings struct passed to new() will not override the defaults
tests.specs.unit.IndexBuilderTest ‑ Performs cbElasticsearch IndexBuilder tests Tests the ability to reset the index builder
…
tests.specs.unit.DocumentTest ‑ tests.specs.unit.DocumentTest
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides BaseModel will throw on missing method
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom request headers
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set custom username/password
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides Can set request overrides from IndexBuilder
tests.specs.unit.HyperClientTest ‑ Performs cbElasticsearch HyperClient tests connection overrides indexExists() - can set custom connection timeout
tests.specs.unit.IndexBuilderTest ‑ tests.specs.unit.IndexBuilderTest
tests.specs.unit.SearchBuilderTest ‑ tests.specs.unit.SearchBuilderTest

♻️ This comment has been updated with latest results.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants