PAT-1866 Migrate git-service-api-client onto php-api-client-base#516
Merged
Conversation
9253523 to
f90cd5b
Compare
keboola-pr-reviewer-bot
left a comment
There was a problem hiding this comment.
Verdict: needs_human (risk 3/5) · profile ajda
This PR is a clean, well-tested refactor but triggers multiple mandatory-escalation rules from POLICY.md.
Concerns:
libs/git-service-api-client/src/ApiClient.php: Public class deleted — BC break in platform-libraries; triggers always-needs-human rule.libs/git-service-api-client/src/GitServiceApiClient.php: Constructor signature fully replaced; all existing callers passing ApiClientConfiguration will break.libs/git-service-api-client/src/Auth/ManageApiTokenAuth.php: Auth class deleted; token-handling code removed without verifying all consumers migrated.
f90cd5b to
f6662fe
Compare
Replace the duplicated transport/auth/retry/JSON plumbing (git-service was
the reference the base lib was extracted from) with the shared base. The
GitServiceApiClient facade takes the Manage API token + tunable options as
flat constructor params; a null token defaults to service-account auth (the
projected SA token), preserving the original default behavior. The
{code, error} error format is a standalone GitServiceErrorMessageResolver.
f6662fe to
93bf863
Compare
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-1866/unified-api-client-base
Depends on #513
Migrates
keboola/git-service-api-clientontokeboola/php-api-client-base. git-service was the reference implementation the base lib was extracted from, so this removes its now-duplicated transport/auth/retry/JSON plumbing and depends on the shared base.The
GitServiceApiClientfacade takes the Manage API token plus tunable options (logger, retries, timeouts) as flat constructor params. Authentication follows the service's two supported schemes via a single nullable token: a provided$manageTokenusesX-KBC-ManageApiToken; a null token (the default) uses the projected Kubernetes service-account token (X-Kubernetes-Authorization), preserving the original default behavior. The{code, error}error-message format is a standalone, unit-testableGitServiceErrorMessageResolver.Key changes:
ApiClient/ApiClientConfiguration/RetryDecider/Json/ResponseModelInterface/Exception\ClientException/Auth\*; depend on the base via the monorepo path repository.GitServiceApiClient::__construct(string $baseUrl, ?string $manageToken = null, ?LoggerInterface $logger = null, int $backoffMaxTries = …, int $connectTimeout = …, int $requestTimeout = …, string $userAgent = …, …$requestHandler).ResponseModelInterface; error handling moves toGitServiceErrorMessageResolver.Plans for customer communication
None.
Impact analysis
Breaking change for direct constructors:
GitServiceApiClientno longer takes anApiClientConfiguration; auth is now the?string $manageTokenparam (null → service-account) and options are flat params. Callers using the default service-account auth only change if they passed a configuration object. Released as a new major version. Cannot be released untilphp-api-client-baseis published (see PR #513). Note: this lib is split-published to the read-onlykeboola/git-service-php-api-clientrepo.Change type
Refactoring
Justification
Deduplicate
git-service-api-clientonto the unified API client base (PAT-1866).Deployment
Merge & automatic deploy.
Rollback plan
Revert of this PR.
Post release support plan
None.