PAT-1959 Own the runId generator; drop client-wrapper StorageClientRequestFactory#547
Merged
Conversation
pepamartinec
force-pushed
the
pepa/PAT-1959_noCw
branch
from
July 23, 2026 10:03
6bde4f1 to
eea49f9
Compare
janvanicek
requested changes
Jul 23, 2026
janvanicek
left a comment
Contributor
There was a problem hiding this comment.
Jen ten jeden test case, jinak ok
| @@ -52,9 +52,10 @@ public function testRunIdFallsBackToGeneratedValueWhenHeaderMissing(): void | |||
|
|
|||
| public function testRunIdGeneratorUsedWhenHeaderMissing(): void | |||
Contributor
There was a problem hiding this comment.
Přidal bych test na ověření, že run id generator must not be called when the X-KBC-RunId header is present
Contributor
Author
There was a problem hiding this comment.
Added testRunIdGeneratorNotCalledWhenHeaderPresent: the injected generator calls self::fail() if invoked and the request carries X-KBC-RunId: 42, so it asserts the header wins and the generator is never called. Verified it fails with that message when the header short-circuit is removed. 👍
branch-wrapper 7.0 removed ClientOptions::runIdGenerator and its
Factory\StorageClientRequestFactory. StorageClientRequestFactory now takes the
run id generator as its own optional Closure dependency and resolves from it,
preserving the header > generator > uniqid('run-') order. A new
keboola_api.storage_client_options.run_id_generator config knob injects the
generator service; it is grouped with the other Storage client options but wired
to the factory (not merged into ClientOptions), so it may accompany the service
form. This replaces the runIdGenerator on a custom ClientOptions service.
pepamartinec
force-pushed
the
pepa/PAT-1959_noCw
branch
from
July 23, 2026 12:03
eea49f9 to
33e56ef
Compare
janvanicek
approved these changes
Jul 23, 2026
janvanicek
reviewed
Jul 23, 2026
Comment on lines
+267
to
+269
| // ------------------------------------------------------------------------- | ||
| // run_id_generator | ||
| // ------------------------------------------------------------------------- |
Contributor
There was a problem hiding this comment.
Ještě tohle nevim nevim teda
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.
Release Notes
https://linear.app/keboola/issue/PAT-1959/api-bundle-own-the-runid-generator-drop-client-wrapper
Related
storage-api-php-client-branch-wrapper7.0: keboola/storage-api-php-client-branch-wrapper#39 (PAT-1954)branch-wrapper 7.0 removed
ClientOptions::runIdGenerator(and itsget/setRunIdGenerator()) together withKeboola\StorageApiBranch\Factory\StorageClientRequestFactory, so api-bundle'sStorageClientRequestFactory::resolveRunId()— which read the generator offClientOptions— no longer compiles against it. The bundle now owns the generator:StorageClientRequestFactorytakes it as an optional?Closure(ClientOptions): stringconstructor dependency and resolves from it, with the run id order unchanged —X-KBC-RunIdheader → configured generator →uniqid('run-').Because the generator is a closure and therefore not YAML-expressible, consumers inject it through a new
keboola_api.storage_client_options.run_id_generator: <service-id>knob, wired inKeboolaApiExtensionto the factory's$runIdGeneratorargument. The referenced service must resolve to aClosure(exposed via a factory, sinceClosureis not directly constructible). It is grouped understorage_client_optionsfor config cohesion but — unlike the other keys — is passed to the factory rather than merged intoClientOptions, so it is exempt from theservice-vs-individual-options exclusivity and may accompany either form. This replaces the previous approach of settingrunIdGeneratoron a customClientOptionsservice, which the client wrapper no longer supports.Key changes:
StorageClientRequestFactoryowns the run id generator (?Closurector dep); no moreClientOptions::getRunIdGenerator().keboola_api.storage_client_options.run_id_generatorconfig knob +KeboolaApiExtensionwiring.keboola/storage-api-php-client-branch-wrapperbumped to^7.0.runIdGeneratorfrom the custom-ClientOptions-service docs; added a "Customizing the run id" section.StorageApiToken/ClientOptions-with-token construction — every site already passesauthType/tokenType, so 7.0's "token requires authType" enforcement is satisfied; no code changes were needed there.Plans for customer communication
None.
Impact analysis
To be released as api-bundle 6.1.0. It moves the
keboola/storage-api-php-client-branch-wrapperrequirement to^7.0; the only service affected by the runId-generator change isrunner-sync-api(the sole user of a custom generator), migrated in lockstep via PAT-1960. Any service that injected a run id generator through a customClientOptionsservice must move to thekeboola_api.storage_client_options.run_id_generatorknob. No end-user (runtime) impact — run id resolution behaviour is unchanged.Change type
Refactoring
Justification
Adapt api-bundle to storage-api-php-client-branch-wrapper 7.0, which removed
ClientOptions::runIdGeneratorandFactory\StorageClientRequestFactory.Deployment
Merge & automatic deploy.
Rollback plan
Revert of this PR.
Post release support plan
None.