Skip to content

PAT-1866 Migrate vault-api-client onto php-api-client-base#514

Merged
pepamartinec merged 5 commits into
mainfrom
pepa/common-api-lib-vault
Jun 22, 2026
Merged

PAT-1866 Migrate vault-api-client onto php-api-client-base#514
pepamartinec merged 5 commits into
mainfrom
pepa/common-api-lib-vault

Conversation

@pepamartinec

Copy link
Copy Markdown
Contributor

Release Notes

https://linear.app/keboola/issue/PAT-1866/unified-api-client-base
Depends on #513

Migrates keboola/vault-api-client onto the new keboola/php-api-client-base, removing its own copy of the transport/auth/retry/JSON plumbing. VariablesApiClient's public methods are unchanged; the only consumer-facing change is that the optional configuration argument is now Keboola\ApiClientBase\ApiClientConfiguration (callers update the import and pass an authenticator). Vault's {code, error} error-message format is preserved via an errorMessageResolver, so exception messages are unchanged.

Key changes:

  • Delete vault's duplicated ApiClient / ApiClientConfiguration / RetryDecider / Json / ResponseModelInterface / Exception\ClientException / Authentication\*; depend on the base via the monorepo path repository.
  • VariablesApiClient composes the base ApiClient; Variables\Model\Variable implements the base ResponseModelInterface.
  • Tests updated to the base namespaces; functional coverage retained (composer ci green, PHPStan level max).

Plans for customer communication

None.

Impact analysis

Breaking change for callers that construct VariablesApiClient with a configuration object: the type moves from Keboola\VaultApiClient\ApiClientConfiguration to Keboola\ApiClientBase\ApiClientConfiguration, and auth is supplied via a StorageApiTokenAuthenticator. Callers passing only (baseUrl, token) are unaffected. Released as a new major version. Cannot be released until php-api-client-base is published (see PR #513).

Change type

Refactoring

Justification

Deduplicate vault-api-client onto the unified API client base (PAT-1866).

Deployment

Merge & automatic deploy.

Rollback plan

Revert of this PR.

Post release support plan

None.

@linear

linear Bot commented Jun 9, 2026

Copy link
Copy Markdown

PAT-1866

@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch 9 times, most recently from 666151c to 6b5e44a Compare June 10, 2026 08:51
@pepamartinec pepamartinec marked this pull request as draft June 10, 2026 13:52
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch 2 times, most recently from c87062c to 18b07e7 Compare June 15, 2026 07:35
Base automatically changed from pepa/common-api-lib to main June 15, 2026 07:54
@pepamartinec pepamartinec marked this pull request as ready for review June 15, 2026 14:05

@keboola-pr-reviewer-bot keboola-pr-reviewer-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: needs_human (risk 3/5) · profile ajda

reviewer returned a payload that failed validation.

@romantmb romantmb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@janvanicek janvanicek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch from 18b07e7 to 1eb556f Compare June 17, 2026 08:44
@pepamartinec pepamartinec changed the base branch from main to pepa/PAT-1866_unifException June 17, 2026 08:44
Base automatically changed from pepa/PAT-1866_unifException to main June 17, 2026 10:15
Replace the duplicated transport/auth/retry/JSON plumbing with the shared
base lib. VariablesApiClient takes the storage token + tunable options as
flat constructor params (DI-friendly: logger autowired, scalars bound);
builds the authenticator internally and supplies vault's {code, error}
format via a standalone VaultErrorMessageResolver.
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch from 1eb556f to 6f5c772 Compare June 19, 2026 08:38
…variables-resolver

vault-api-client now requires php-api-client-base; as a downstream consumer,
configuration-variables-resolver must declare it directly so the canonical
path-repo dev version satisfies stability (it is also published on Packagist as stable).
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch from af9a5d3 to 143c5aa Compare June 19, 2026 14:37
… configuration-variables-resolver

vault-api-client dropped its ApiClientConfiguration (flattened into VariablesApiClient ctor params).
Re-add the same config object locally so UnifiedConfigurationResolverFactory keeps its config-object
constructor API and the previous default of 10 retries, mapping it onto the flat constructor.
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch from 143c5aa to cf6d297 Compare June 19, 2026 14:43
The migration onto php-api-client-base inadvertently dropped vault's historical default of
10 retries to the base client's 5. Restore 10 via a local constant; assert it via the
constructor default (reflection) to avoid 10 real exponential-backoff retries in the suite.
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-vault branch from 5fc8225 to 597ffb3 Compare June 22, 2026 07:27
@pepamartinec pepamartinec merged commit e9c6ea0 into main Jun 22, 2026
27 checks passed
@pepamartinec pepamartinec deleted the pepa/common-api-lib-vault branch June 22, 2026 07:33
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.

4 participants