Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
46a7228
refactor: remove deprecated logging tools and manifests
cameroncooke Apr 8, 2026
d922fd7
refactor: add pipeline event types, xcodebuild parsers, and event bui…
cameroncooke Apr 8, 2026
255ecb4
fix: preserve suiteName in Swift Testing issue parser
cameroncooke Apr 9, 2026
904c110
fix: handle arbitrary nesting depth in parseRawTestName
cameroncooke Apr 9, 2026
8415cd7
fix: delete consumed pendingFailureDurations entries to prevent stale…
cameroncooke Apr 9, 2026
ccb2ed9
fix: correct parser patterns validated against real xcodebuild output
cameroncooke Apr 9, 2026
1f3cb73
fix: snapshot array mutation, overly broad noise regex, and Swift Tes…
cameroncooke Apr 9, 2026
ac3f9c1
fix: apply prettier formatting to Swift Testing parser files
cameroncooke Apr 9, 2026
5b1e785
fix: increment failedCount for failed results without pending issue
cameroncooke Apr 9, 2026
f7a685c
test: add failing tests for dedup key collision and parameterized cas…
cameroncooke Apr 9, 2026
e3e04ac
fix: include test name in dedup key and capture parameterized case count
cameroncooke Apr 9, 2026
fdad5b6
fix: handle colons in parameterized argument values and fix formatting
cameroncooke Apr 9, 2026
3c7fe5f
test: add failing test for parameterized caseCount in xcodebuild even…
cameroncooke Apr 9, 2026
ce10d30
fix: use caseCount for parameterized test progress in both event parsers
cameroncooke Apr 9, 2026
7c13ea9
fix: remove dead noise patterns and rename durationText to displayDur…
cameroncooke Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 199 additions & 0 deletions src/types/pipeline-events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
export type XcodebuildOperation = 'BUILD' | 'TEST';

export type XcodebuildStage =
| 'RESOLVING_PACKAGES'
| 'COMPILING'
| 'LINKING'
| 'PREPARING_TESTS'
| 'RUN_TESTS'
| 'ARCHIVING'
| 'COMPLETED';

export const STAGE_RANK: Record<XcodebuildStage, number> = {
RESOLVING_PACKAGES: 0,
COMPILING: 1,
LINKING: 2,
PREPARING_TESTS: 3,
RUN_TESTS: 4,
ARCHIVING: 5,
COMPLETED: 6,
};

interface BaseEvent {
timestamp: string;
}

// --- Canonical types (used by ALL tools) ---

export interface HeaderEvent extends BaseEvent {
type: 'header';
operation: string;
params: Array<{ label: string; value: string }>;
}

export interface StatusLineEvent extends BaseEvent {
type: 'status-line';
level: 'success' | 'error' | 'info' | 'warning';
message: string;
}

export interface SummaryEvent extends BaseEvent {
type: 'summary';
operation?: string;
status: 'SUCCEEDED' | 'FAILED';
totalTests?: number;
passedTests?: number;
failedTests?: number;
skippedTests?: number;
durationMs?: number;
}

export interface SectionEvent extends BaseEvent {
type: 'section';
title: string;
icon?: 'red-circle' | 'yellow-circle' | 'green-circle' | 'checkmark' | 'cross' | 'info';
lines: string[];
blankLineAfterTitle?: boolean;
}

export interface DetailTreeEvent extends BaseEvent {
type: 'detail-tree';
items: Array<{ label: string; value: string }>;
}

export interface TableEvent extends BaseEvent {
type: 'table';
heading?: string;
columns: string[];
rows: Array<Record<string, string>>;
}

export interface FileRefEvent extends BaseEvent {
type: 'file-ref';
label?: string;
path: string;
}

export interface NextStepsEvent extends BaseEvent {
type: 'next-steps';
steps: Array<{
label?: string;
tool?: string;
workflow?: string;
cliTool?: string;
params?: Record<string, string | number | boolean>;
}>;
runtime?: 'cli' | 'daemon' | 'mcp';
}

// --- Xcodebuild-specific types ---

export interface BuildStageEvent extends BaseEvent {
type: 'build-stage';
operation: XcodebuildOperation;
stage: XcodebuildStage;
message: string;
}

export interface CompilerWarningEvent extends BaseEvent {
type: 'compiler-warning';
operation: XcodebuildOperation;
message: string;
location?: string;
rawLine: string;
}

export interface CompilerErrorEvent extends BaseEvent {
type: 'compiler-error';
operation: XcodebuildOperation;
message: string;
location?: string;
rawLine: string;
}

export interface TestDiscoveryEvent extends BaseEvent {
type: 'test-discovery';
operation: 'TEST';
total: number;
tests: string[];
truncated: boolean;
}

export interface TestProgressEvent extends BaseEvent {
type: 'test-progress';
operation: 'TEST';
completed: number;
failed: number;
skipped: number;
}

export interface TestFailureEvent extends BaseEvent {
type: 'test-failure';
operation: 'TEST';
target?: string;
suite?: string;
test?: string;
message: string;
location?: string;
durationMs?: number;
}

// --- Union types ---

/** Generic UI/output events usable by any tool */
export type CommonPipelineEvent =
| HeaderEvent
| StatusLineEvent
| SummaryEvent
| SectionEvent
| DetailTreeEvent
| TableEvent
| FileRefEvent
| NextStepsEvent;

/** Build/test-specific events (xcodebuild, swift build/test/run) */
export type BuildTestPipelineEvent =
| BuildStageEvent
| CompilerWarningEvent
| CompilerErrorEvent
| TestDiscoveryEvent
| TestProgressEvent
| TestFailureEvent;

export type PipelineEvent = CommonPipelineEvent | BuildTestPipelineEvent;

// --- Build-run notice types (used by xcodebuild pipeline internals) ---

export type NoticeLevel = 'info' | 'success' | 'warning';

export type BuildRunStepName =
| 'resolve-app-path'
| 'resolve-simulator'
| 'boot-simulator'
| 'install-app'
| 'extract-bundle-id'
| 'launch-app';

export type BuildRunStepStatus = 'started' | 'succeeded';

export interface BuildRunStepNoticeData {
step: BuildRunStepName;
status: BuildRunStepStatus;
appPath?: string;
}

export interface BuildRunResultNoticeData {
scheme: string;
platform: string;
target: string;
appPath: string;
launchState: 'requested' | 'running';
bundleId?: string;
appId?: string;
processId?: number;
buildLogPath?: string;
runtimeLogPath?: string;
osLogPath?: string;
}

export type NoticeCode = 'build-run-step' | 'build-run-result';
Loading
Loading