tdpw
Version:
CLI tool for uploading Playwright test reports to TestDino platform with Azure storage support
67 lines • 1.99 kB
TypeScript
/**
* Git metadata structure matching server schema
*/
export interface GitMetadata {
branch: string;
commit: {
hash: string;
message: string;
author: string;
email: string;
timestamp: string;
};
repository: {
name: string;
url: string;
};
pr: {
id: string;
title: string;
url: string;
status: '' | 'open' | 'draft' | 'ready_for_review' | 'changes_requested' | 'approved' | 'merged' | 'closed';
};
}
/**
* Collector for Git metadata
*/
export declare class GitCollector {
private readonly git;
private readonly repoPath;
constructor(repoPath?: string);
/**
* Gather Git metadata: branch, latest commit, and remote repository info
* Uses git commands as primary source, falls back to environment variables in CI/CD
*/
getMetadata(): Promise<GitMetadata>;
/**
* Normalize PR status to match server enum
*/
private normalizeStatus;
/**
* Attempt to gather metadata using git commands with comprehensive error handling
* CRITICAL: Ensures no data loss - always collects what's available
*/
private getGitCommandMetadata;
/**
* Extract git metadata from environment variables (CI/CD contexts)
*/
private getEnvironmentMetadata;
/**
* Extract branch name from git ref (e.g., "refs/heads/main" -> "main")
*/
private extractBranchFromRef;
/**
* Extract repository name from URL (e.g., "https://github.com/user/repo.git" -> "user/repo")
*/
private extractRepoNameFromUrl;
/**
* Fetch the HEAD commit information from a specific branch to get the actual commit message
* This avoids merge commit messages in PR scenarios
*/
private fetchGitHubBranchCommit;
/**
* Fetch pull request details from GitHub API to get PR title and status
*/
private fetchGitHubPullRequestDetails;
}
//# sourceMappingURL=git.d.ts.map