Centralized git logic from InstallationTypeDetector and UpdateChecker in GitVersionInfoProvider service

This commit is contained in:
Jan Böhmer 2026-02-02 18:18:36 +01:00
parent 7ff07a7ab4
commit 6dbead6d10
11 changed files with 242 additions and 214 deletions

View file

@ -7,8 +7,8 @@ namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProviderInterface;
use App\ApiResource\PartDBInfo;
use App\Services\Misc\GitVersionInfo;
use App\Services\System\BannerHelper;
use App\Services\System\GitVersionInfoProvider;
use App\Settings\SystemSettings\CustomizationSettings;
use App\Settings\SystemSettings\LocalizationSettings;
use Shivas\VersioningBundle\Service\VersionManagerInterface;
@ -17,7 +17,7 @@ class PartDBInfoProvider implements ProviderInterface
{
public function __construct(private readonly VersionManagerInterface $versionManager,
private readonly GitVersionInfo $gitVersionInfo,
private readonly GitVersionInfoProvider $gitVersionInfo,
private readonly BannerHelper $bannerHelper,
private readonly string $default_uri,
private readonly LocalizationSettings $localizationSettings,
@ -31,8 +31,8 @@ class PartDBInfoProvider implements ProviderInterface
{
return new PartDBInfo(
version: $this->versionManager->getVersion()->toString(),
git_branch: $this->gitVersionInfo->getGitBranchName(),
git_commit: $this->gitVersionInfo->getGitCommitHash(),
git_branch: $this->gitVersionInfo->getBranchName(),
git_commit: $this->gitVersionInfo->getCommitHash(),
title: $this->customizationSettings->instanceName,
banner: $this->bannerHelper->getBanner(),
default_uri: $this->default_uri,