mirror of
https://github.com/pestphp/pest.git
synced 2026-12-04 15:05:09 +01:00
06400e721e
Extract BaselineSync into a provider architecture with an abstract BaseRemote class and concrete GitHubRemote/GitLabRemote implementations. GitLab support uses the glab CLI to fetch TIA baselines from CI pipelines. The GitLabRemote queries the GitLab API for the latest successful job matching the configured name on the default branch, then downloads artifacts via `glab job artifact`. Self-hosted GitLab instances are supported automatically: any non-GitHub remote is detected as GitLab when the glab CLI is installed, with authentication validated at fetch time. Key changes: - BaseRemote abstract class holds shared logic: CLI existence/auth checks, error classification, git remote URL parsing, and default branch resolution - GitHubRemote extracts existing gh CLI logic unchanged - GitLabRemote adds glab CLI support with default job name `tia-baseline`, configurable via `->baselined(job: "name")` - BaselineSync becomes a provider-agnostic orchestrator that iterates registered remotes to detect the matching CI provider - Configuration::baselined() accepts optional `job` parameter for GitLab job name customization - GitLab job query filters by both job name and default branch ref to ensure cache key matches downloaded artifact