Skip to content

PAT-1866 Migrate git-service-api-client onto php-api-client-base#516

Merged
pepamartinec merged 2 commits into
mainfrom
pepa/common-api-lib-git-service
Jun 19, 2026
Merged

PAT-1866 Migrate git-service-api-client onto php-api-client-base#516
pepamartinec merged 2 commits into
mainfrom
pepa/common-api-lib-git-service

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/git-service-api-client onto keboola/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 GitServiceApiClient facade 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 $manageToken uses X-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-testable GitServiceErrorMessageResolver.

Key changes:

  • Delete the duplicated 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).
  • Models implement the base ResponseModelInterface; error handling moves to GitServiceErrorMessageResolver.

Plans for customer communication

None.

Impact analysis

Breaking change for direct constructors: GitServiceApiClient no longer takes an ApiClientConfiguration; auth is now the ?string $manageToken param (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 until php-api-client-base is published (see PR #513). Note: this lib is split-published to the read-only keboola/git-service-php-api-client repo.

Change type

Refactoring

Justification

Deduplicate git-service-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 10, 2026

Copy link
Copy Markdown

PAT-1866

@pepamartinec pepamartinec marked this pull request as draft June 10, 2026 13:52
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-git-service branch 2 times, most recently from 9253523 to f90cd5b 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:07

@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

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.

@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.

+1

@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.

👍

@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-git-service branch from f90cd5b to f6662fe Compare June 17, 2026 08:44
@pepamartinec pepamartinec changed the base branch from main to pepa/PAT-1866_unifException June 17, 2026 08:45
Base automatically changed from pepa/PAT-1866_unifException to main June 17, 2026 10:15
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.
@pepamartinec pepamartinec force-pushed the pepa/common-api-lib-git-service branch from f6662fe to 93bf863 Compare June 19, 2026 08:36
@pepamartinec pepamartinec merged commit f0f08d4 into main Jun 19, 2026
26 checks passed
@pepamartinec pepamartinec deleted the pepa/common-api-lib-git-service branch June 19, 2026 08:41
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