bktide 1.0.1755547716 → 1.0.1755559112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/ShowBuild.js +88 -0
- package/dist/commands/ShowBuild.js.map +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/formatters/FormatterFactory.js +4 -0
- package/dist/formatters/FormatterFactory.js.map +1 -1
- package/dist/formatters/build-detail/AlfredFormatter.js +113 -0
- package/dist/formatters/build-detail/AlfredFormatter.js.map +1 -0
- package/dist/formatters/build-detail/Formatter.js +3 -0
- package/dist/formatters/build-detail/Formatter.js.map +1 -0
- package/dist/formatters/build-detail/JsonFormatter.js +132 -0
- package/dist/formatters/build-detail/JsonFormatter.js.map +1 -0
- package/dist/formatters/build-detail/PlainTextFormatter.js +680 -0
- package/dist/formatters/build-detail/PlainTextFormatter.js.map +1 -0
- package/dist/formatters/build-detail/index.js +21 -0
- package/dist/formatters/build-detail/index.js.map +1 -0
- package/dist/graphql/queries.js +181 -0
- package/dist/graphql/queries.js.map +1 -1
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/dist/services/BuildkiteClient.js +61 -1
- package/dist/services/BuildkiteClient.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainTextFormatter.js","sourceRoot":"/","sources":["formatters/build-detail/PlainTextFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAA4C,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAE3B,+BAA+B;AAC/B,2EAA2E;AAC3E,MAAM,cAAc,GAA2B;IAC7C,mBAAm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ChB,CAAC;IAEO,uBAAuB,CAAC,WAAkB;QAChD,MAAM,OAAO,GAA0B,EAAE,CAAC;QAE1C,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,MAAM,CAAC;YAC7D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACtB,CAAC;YACD,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,MAAc,EAAE,KAAU;QACpC,OAAO,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { BaseBuildDetailFormatter, BuildDetail, BuildDetailFormatterOptions } from './Formatter.js';\nimport { formatDistanceToNow } from 'date-fns';\nimport { htmlToText } from 'html-to-text';\nimport { \n formatEmptyState,\n formatError,\n SEMANTIC_COLORS,\n formatBuildStatus\n} from '../../ui/theme.js';\n\n// Standard emoji mappings only\n// Only map universally recognized emoji codes, not Buildkite-specific ones\nconst STANDARD_EMOJI: Record<string, string> = {\n // Faces & emotions\n ':smile:': '😊',\n ':grin:': '😁',\n ':joy:': '😂',\n ':laughing:': '😆',\n ':blush:': '😊',\n ':heart_eyes:': '😍',\n ':sob:': '😭',\n ':cry:': '😢',\n ':angry:': '😠',\n ':rage:': '😡',\n ':thinking:': '🤔',\n ':confused:': '😕',\n ':neutral_face:': '😐',\n \n // Hands & gestures\n ':thumbsup:': '👍',\n ':thumbsdown:': '👎',\n ':clap:': '👏',\n ':wave:': '👋',\n ':raised_hand:': '✋',\n ':ok_hand:': '👌',\n ':pray:': '🙏',\n ':muscle:': '💪',\n ':point_left:': '👈',\n ':point_right:': '👉',\n ':point_up:': '👆',\n ':point_down:': '👇',\n \n // Objects & symbols\n ':heart:': '❤️',\n ':broken_heart:': '💔',\n ':star:': '⭐',\n ':sparkles:': '✨',\n ':boom:': '💥',\n ':fire:': '🔥',\n ':zap:': '⚡',\n ':rocket:': '🚀',\n ':sun:': '☀️',\n ':moon:': '🌙',\n ':cloud:': '☁️',\n ':umbrella:': '☔',\n ':snowflake:': '❄️',\n \n // Status symbols\n ':white_check_mark:': '✅',\n ':x:': '❌',\n ':warning:': '⚠️',\n ':exclamation:': '❗',\n ':question:': '❓',\n ':heavy_plus_sign:': '➕',\n ':heavy_minus_sign:': '➖',\n ':heavy_check_mark:': '✔️',\n \n // Common tools/tech (universally recognized)\n ':computer:': '💻',\n ':iphone:': '📱',\n ':email:': '📧',\n ':package:': '📦',\n ':lock:': '🔒',\n ':key:': '🔑',\n ':mag:': '🔍',\n ':bulb:': '💡',\n ':books:': '📚',\n ':memo:': '📝',\n ':pencil:': '✏️',\n ':art:': '🎨',\n ':camera:': '📷',\n ':movie_camera:': '🎥',\n ':musical_note:': '🎵',\n ':bell:': '🔔',\n ':link:': '🔗',\n ':paperclip:': '📎',\n ':hourglass:': '⏳',\n ':alarm_clock:': '⏰',\n ':stopwatch:': '⏱️',\n ':timer_clock:': '⏲️',\n ':calendar:': '📅',\n ':date:': '📅',\n};\n\nexport class PlainTextFormatter extends BaseBuildDetailFormatter {\n name = 'plain-text';\n \n private parseEmoji(text: string): string {\n if (!text) return text;\n // Only replace standard emoji codes, leave Buildkite-specific ones as-is\n return text.replace(/:[\\w_]+:/g, (match) => {\n return STANDARD_EMOJI[match] || match;\n });\n }\n \n formatBuildDetail(buildData: BuildDetail | null, options?: BuildDetailFormatterOptions): string {\n // Handle error cases first\n if (options?.hasError || !buildData) {\n return this.formatErrorState(options);\n }\n \n const build = buildData.build;\n \n // Choose display mode based on options\n if (options?.summary) {\n return this.formatSummaryLine(build);\n }\n \n if (options?.full) {\n return this.formatFullDetails(build, options);\n }\n \n // Default: contextual display based on state\n switch (build.state) {\n case 'FAILED':\n return this.formatFailedBuild(build, options);\n case 'RUNNING':\n return this.formatRunningBuild(build, options);\n case 'BLOCKED':\n return this.formatBlockedBuild(build, options);\n case 'PASSED':\n return this.formatPassedBuild(build, options);\n case 'CANCELED':\n return this.formatCanceledBuild(build, options);\n default:\n return this.formatDefaultBuild(build, options);\n }\n }\n \n private formatErrorState(options?: BuildDetailFormatterOptions): string {\n if (options?.errorType === 'not_found') {\n return formatEmptyState(\n 'Build not found',\n ['Check the build reference format', 'Verify the build exists']\n );\n }\n \n return formatError(options?.errorMessage || 'Unknown error');\n }\n \n private formatSummaryLine(build: any): string {\n const status = this.getStatusIcon(build.state);\n const duration = this.formatDuration(build);\n const age = this.formatAge(build.createdAt);\n \n return `${status} #${build.number} ${build.state.toLowerCase()} • ${duration} • ${build.branch} • ${age}`;\n }\n \n private formatPassedBuild(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Header line\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n \n // Show annotations summary if present\n if (build.annotations?.edges?.length > 0) {\n lines.push('');\n lines.push(this.formatAnnotationSummary(build.annotations.edges));\n \n if (!options?.annotations) {\n lines.push(SEMANTIC_COLORS.dim(`→ bin/bktide build ${build.number} --annotations # view annotations`));\n }\n }\n \n // Show annotations detail if requested\n if (options?.annotations) {\n lines.push('');\n lines.push(this.formatAnnotationDetails(build.annotations.edges, options));\n }\n \n return lines.join('\\n');\n }\n \n private formatFailedBuild(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Header line\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n lines.push('');\n \n // Failed jobs summary\n const failedJobs = this.getFailedJobs(build.jobs?.edges);\n if (failedJobs.length > 0) {\n lines.push(this.formatFailedJobsSummary(failedJobs));\n }\n \n // Annotation summary\n if (build.annotations?.edges?.length > 0) {\n lines.push(this.formatAnnotationSummary(build.annotations.edges));\n }\n \n // Show detailed job info if requested\n if (options?.jobs || options?.failed) {\n lines.push('');\n lines.push(this.formatJobDetails(build.jobs?.edges, options));\n }\n \n // Show annotations detail if requested\n if (options?.annotations) {\n lines.push('');\n lines.push(this.formatAnnotationDetails(build.annotations.edges, options));\n }\n \n // Hints for more info (no Tips label)\n if (!options?.failed && failedJobs.length > 0) {\n lines.push('');\n lines.push(SEMANTIC_COLORS.dim(`→ bin/bktide build ${build.number} --failed # show failure details`));\n }\n if (!options?.annotations && build.annotations?.edges?.length > 0) {\n lines.push(SEMANTIC_COLORS.dim(`→ bin/bktide build ${build.number} --annotations # view annotations`));\n }\n \n return lines.join('\\n');\n }\n \n private formatRunningBuild(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Header line\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n lines.push('');\n \n // Progress information\n const jobStats = this.getJobStats(build.jobs?.edges);\n lines.push(`Progress: ${SEMANTIC_COLORS.count(String(jobStats.completed))}/${jobStats.total} complete, ${SEMANTIC_COLORS.info(String(jobStats.running))} running, ${jobStats.queued} queued`);\n \n // Show running jobs\n const runningJobs = this.getRunningJobs(build.jobs?.edges);\n if (runningJobs.length > 0) {\n const labels = runningJobs.map(j => this.parseEmoji(j.node.label)).join(', ');\n lines.push(`${SEMANTIC_COLORS.info('Running')}: ${labels}`);\n }\n \n // Show job details if requested\n if (options?.jobs) {\n lines.push('');\n lines.push(this.formatJobDetails(build.jobs?.edges, options));\n }\n \n return lines.join('\\n');\n }\n \n private formatBlockedBuild(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Header line\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n lines.push('');\n \n // Blocked information\n const blockedJobs = this.getBlockedJobs(build.jobs?.edges);\n if (blockedJobs.length > 0) {\n lines.push(`🚫 Blocked: \"${blockedJobs[0].node.label}\" (manual unblock required)`);\n }\n \n // Show jobs summary\n const jobStats = this.getJobStats(build.jobs?.edges);\n if (jobStats.completed > 0) {\n lines.push(`✅ ${jobStats.completed} jobs passed before block`);\n }\n \n // Show job details if requested\n if (options?.jobs) {\n lines.push('');\n lines.push(this.formatJobDetails(build.jobs?.edges, options));\n }\n \n return lines.join('\\n');\n }\n \n private formatCanceledBuild(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Header line\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n lines.push('');\n \n // Canceled information\n if (build.createdBy) {\n const creator = build.createdBy.name || build.createdBy.email;\n lines.push(`Canceled by: ${creator}`);\n }\n \n // Show jobs summary\n const jobStats = this.getJobStats(build.jobs?.edges);\n lines.push(`Completed: ${jobStats.completed}/${jobStats.total} jobs before cancellation`);\n \n // Show job details if requested\n if (options?.jobs) {\n lines.push('');\n lines.push(this.formatJobDetails(build.jobs?.edges, options));\n }\n \n return lines.join('\\n');\n }\n \n private formatDefaultBuild(build: any, options?: BuildDetailFormatterOptions): string {\n return this.formatPassedBuild(build, options);\n }\n \n private formatFullDetails(build: any, options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Full header information\n lines.push(this.formatHeader(build));\n lines.push(this.formatCommitInfo(build));\n lines.push('');\n \n // Build metadata\n lines.push('Build Details:');\n lines.push(` URL: ${build.url}`);\n lines.push(` Organization: ${build.organization?.name || 'Unknown'}`);\n lines.push(` Pipeline: ${build.pipeline?.name || 'Unknown'}`);\n \n if (build.pullRequest) {\n lines.push(` Pull Request: #${build.pullRequest.number}`);\n }\n \n if (build.triggeredFrom) {\n lines.push(` Triggered from: ${build.triggeredFrom.pipeline?.name} #${build.triggeredFrom.number}`);\n }\n \n lines.push('');\n \n // Jobs section\n lines.push('Jobs:');\n lines.push(this.formatJobDetails(build.jobs?.edges, { ...options, full: true }));\n \n // Annotations section\n if (build.annotations?.edges?.length > 0) {\n lines.push('');\n lines.push('Annotations:');\n lines.push(this.formatAnnotationDetails(build.annotations.edges, { ...options, annotationsFull: true }));\n }\n \n return lines.join('\\n');\n }\n \n private formatHeader(build: any): string {\n const status = this.getStatusIcon(build.state);\n const stateFormatted = formatBuildStatus(build.state, { useSymbol: false });\n const duration = this.formatDuration(build);\n const age = this.formatAge(build.createdAt);\n const branch = SEMANTIC_COLORS.identifier(build.branch);\n \n return `${status} ${SEMANTIC_COLORS.label(`#${build.number}`)} ${stateFormatted} • ${duration} • ${branch} • ${age}`;\n }\n \n private formatCommitInfo(build: any): string {\n const shortSha = build.commit ? build.commit.substring(0, 7) : 'unknown';\n const message = build.message || 'No commit message';\n const truncatedMessage = message.length > 60 ? message.substring(0, 57) + '...' : message;\n \n return ` \"${truncatedMessage}\" (${shortSha})`;\n }\n \n private formatAnnotationSummary(annotations: any[]): string {\n const counts = this.countAnnotationsByStyle(annotations);\n const parts = [];\n \n if (counts.ERROR > 0) parts.push(SEMANTIC_COLORS.error(`${counts.ERROR} error${counts.ERROR > 1 ? 's' : ''}`));\n if (counts.WARNING > 0) parts.push(SEMANTIC_COLORS.warning(`${counts.WARNING} warning${counts.WARNING > 1 ? 's' : ''}`));\n if (counts.INFO > 0) parts.push(SEMANTIC_COLORS.info(`${counts.INFO} info`));\n if (counts.SUCCESS > 0) parts.push(SEMANTIC_COLORS.success(`${counts.SUCCESS} success`));\n \n const total = annotations.length;\n return `📝 ${SEMANTIC_COLORS.count(String(total))} annotation${total > 1 ? 's' : ''}: ${parts.join(', ')}`;\n }\n \n private formatAnnotationDetails(annotations: any[], options?: BuildDetailFormatterOptions): string {\n const lines: string[] = [];\n \n // Group annotations by style\n const grouped = this.groupAnnotationsByStyle(annotations);\n \n for (const [style, items] of Object.entries(grouped)) {\n for (const annotation of items) {\n const icon = this.getAnnotationIcon(style);\n const context = annotation.node.context || 'default';\n \n if (options?.annotationsFull) {\n // Full content\n lines.push(`${icon} ${style} [${context}]:`);\n const body = htmlToText(annotation.node.body?.html || '', {\n wordwrap: 80,\n preserveNewlines: true\n });\n lines.push(body.split('\\n').map(l => ` ${l}`).join('\\n'));\n lines.push('');\n } else {\n // Summary only\n lines.push(`${icon} ${style} [${context}]`);\n }\n }\n }\n \n return lines.join('\\n');\n }\n \n private formatJobDetails(jobs: any[], options?: BuildDetailFormatterOptions): string {\n if (!jobs || jobs.length === 0) {\n return 'No jobs found';\n }\n \n const lines: string[] = [];\n const jobStats = this.getJobStats(jobs);\n \n // Summary line\n const parts = [];\n if (jobStats.passed > 0) parts.push(`✅ ${jobStats.passed} passed`);\n if (jobStats.failed > 0) parts.push(`❌ ${jobStats.failed} failed`);\n if (jobStats.running > 0) parts.push(`🔄 ${jobStats.running} running`);\n if (jobStats.blocked > 0) parts.push(`⏸️ ${jobStats.blocked} blocked`);\n if (jobStats.skipped > 0) parts.push(`⏭️ ${jobStats.skipped} skipped`);\n \n lines.push(`Jobs: ${parts.join(' ')}`);\n lines.push('');\n \n // Filter jobs based on options\n let filteredJobs = jobs;\n if (options?.failed) {\n filteredJobs = this.getFailedJobs(jobs);\n }\n \n // Group jobs by state\n const grouped = this.groupJobsByState(filteredJobs);\n \n for (const [state, stateJobs] of Object.entries(grouped)) {\n if (stateJobs.length === 0) continue;\n \n const icon = this.getJobStateIcon(state);\n const stateColored = this.colorizeJobState(state);\n lines.push(`${icon} ${stateColored} (${SEMANTIC_COLORS.count(String(stateJobs.length))}):`);\n \n for (const job of stateJobs) {\n const label = this.parseEmoji(job.node.label);\n const duration = this.formatJobDuration(job.node);\n const exitCode = job.node.exitStatus ? `, exit ${job.node.exitStatus}` : '';\n lines.push(` ${label} (${duration}${exitCode})`);\n \n if (options?.full && job.node.agent) {\n lines.push(` ${SEMANTIC_COLORS.dim(`Agent: ${job.node.agent.name || job.node.agent.hostname}`)}`);\n }\n }\n lines.push('');\n }\n \n return lines.join('\\n').trim();\n }\n \n private formatFailedJobsSummary(failedJobs: any[]): string {\n const lines: string[] = [];\n \n // Group identical jobs by label\n const jobGroups = this.groupJobsByLabel(failedJobs);\n \n // Show first 10 unique job types\n const displayGroups = jobGroups.slice(0, 10);\n \n for (const group of displayGroups) {\n const label = this.parseEmoji(group.label);\n if (group.count === 1) {\n const duration = this.formatJobDuration(group.jobs[0].node);\n lines.push(` ${SEMANTIC_COLORS.error('Failed')}: ${label} - ran ${duration}`);\n } else {\n // Multiple jobs with same label - show detailed breakdown\n const statusParts = [];\n \n if (group.stateCounts.failed > 0) {\n statusParts.push(`${group.stateCounts.failed} failed`);\n }\n if (group.stateCounts.broken > 0) {\n statusParts.push(`${group.stateCounts.broken} broken`);\n }\n if (group.stateCounts.notStarted > 0) {\n statusParts.push(`${group.stateCounts.notStarted} not started`);\n }\n if (group.stateCounts.passed > 0) {\n statusParts.push(`${group.stateCounts.passed} passed`);\n }\n if (group.stateCounts.other > 0) {\n statusParts.push(`${group.stateCounts.other} other`);\n }\n \n // Add exit codes if available\n if (group.exitCodes.length > 0) {\n const exitCodeStr = group.exitCodes.length === 1 \n ? `exit ${group.exitCodes[0]}`\n : `exits: ${group.exitCodes.join(', ')}`;\n statusParts.push(exitCodeStr);\n }\n \n const statusInfo = statusParts.join(', ') || 'various states';\n lines.push(` ${SEMANTIC_COLORS.error('Failed')}: ${label} (${SEMANTIC_COLORS.count(String(group.count))} jobs: ${statusInfo})`);\n }\n }\n \n // Add summary if there are more job types\n const remaining = jobGroups.length - displayGroups.length;\n if (remaining > 0) {\n lines.push(` ${SEMANTIC_COLORS.muted(`...and ${remaining} more job types`)}`);\n }\n \n return lines.join('\\n');\n }\n \n private groupJobsByLabel(jobs: any[]): any[] {\n const groups = new Map<string, any>();\n \n for (const job of jobs) {\n const label = job.node.label || 'Unnamed job';\n if (!groups.has(label)) {\n groups.set(label, {\n label,\n count: 0,\n jobs: [],\n exitCodes: new Set<number>(),\n stateCounts: {\n failed: 0,\n broken: 0,\n notStarted: 0,\n passed: 0,\n other: 0\n }\n });\n }\n \n const group = groups.get(label)!;\n group.count++;\n group.jobs.push(job);\n \n // Track exit codes\n if (job.node.exitStatus !== null && job.node.exitStatus !== undefined) {\n group.exitCodes.add(job.node.exitStatus);\n }\n \n // Count by state\n const state = job.node.state?.toUpperCase();\n if (!job.node.startedAt) {\n group.stateCounts.notStarted++;\n } else if (state === 'FAILED') {\n group.stateCounts.failed++;\n } else if (state === 'BROKEN') {\n group.stateCounts.broken++;\n } else if (state === 'PASSED' || job.node.passed === true) {\n group.stateCounts.passed++;\n } else {\n group.stateCounts.other++;\n }\n }\n \n // Convert to array and sort by count (most failures first)\n return Array.from(groups.values())\n .map(g => ({ ...g, exitCodes: Array.from(g.exitCodes) }))\n .sort((a, b) => b.count - a.count);\n }\n \n private formatDuration(build: any): string {\n if (!build.startedAt) {\n return 'not started';\n }\n \n const start = new Date(build.startedAt);\n const end = build.finishedAt ? new Date(build.finishedAt) : new Date();\n const durationMs = end.getTime() - start.getTime();\n \n const minutes = Math.floor(durationMs / 60000);\n const seconds = Math.floor((durationMs % 60000) / 1000);\n \n if (build.state === 'RUNNING') {\n return `${minutes}m ${seconds}s elapsed`;\n }\n \n return `${minutes}m ${seconds}s`;\n }\n \n private formatJobDuration(job: any): string {\n if (!job.startedAt) {\n return 'not started';\n }\n \n const start = new Date(job.startedAt);\n const end = job.finishedAt ? new Date(job.finishedAt) : new Date();\n const durationMs = end.getTime() - start.getTime();\n \n const minutes = Math.floor(durationMs / 60000);\n const seconds = Math.floor((durationMs % 60000) / 1000);\n \n return `${minutes}m ${seconds}s`;\n }\n \n private formatAge(createdAt: string): string {\n return formatDistanceToNow(new Date(createdAt), { addSuffix: true });\n }\n \n private colorizeJobState(state: string): string {\n switch (state.toLowerCase()) {\n case 'failed':\n return SEMANTIC_COLORS.error(state);\n case 'passed':\n return SEMANTIC_COLORS.success(state);\n case 'running':\n return SEMANTIC_COLORS.info(state);\n case 'blocked':\n return SEMANTIC_COLORS.warning(state);\n case 'skipped':\n case 'canceled':\n return SEMANTIC_COLORS.muted(state);\n default:\n return state;\n }\n }\n \n private getStatusIcon(state: string): string {\n const icons: Record<string, string> = {\n 'PASSED': '✅',\n 'FAILED': '❌',\n 'RUNNING': '🔄',\n 'BLOCKED': '⏸️',\n 'CANCELED': '🚫',\n 'SCHEDULED': '📅',\n 'SKIPPED': '⏭️'\n };\n \n return icons[state] || '❓';\n }\n \n private getJobStateIcon(state: string): string {\n const icons: Record<string, string> = {\n 'passed': '✅',\n 'failed': '❌',\n 'running': '🔄',\n 'blocked': '⏸️',\n 'canceled': '🚫',\n 'scheduled': '📅',\n 'skipped': '⏭️'\n };\n \n return icons[state.toLowerCase()] || '❓';\n }\n \n private getAnnotationIcon(style: string): string {\n const icons: Record<string, string> = {\n 'ERROR': '❌',\n 'WARNING': '⚠️',\n 'INFO': 'ℹ️',\n 'SUCCESS': '✅'\n };\n \n return icons[style.toUpperCase()] || '📝';\n }\n \n private getJobStats(jobs: any[]): any {\n const stats = {\n total: jobs?.length || 0,\n passed: 0,\n failed: 0,\n running: 0,\n blocked: 0,\n skipped: 0,\n queued: 0,\n completed: 0\n };\n \n if (!jobs) return stats;\n \n for (const job of jobs) {\n const state = job.node.state?.toUpperCase() || '';\n \n if (state === 'PASSED' || (job.node.passed === true && state !== 'BROKEN')) {\n stats.passed++;\n stats.completed++;\n } else if (state === 'FAILED' || state === 'BROKEN' || (job.node.exitStatus && job.node.exitStatus !== 0) || job.node.passed === false) {\n stats.failed++;\n stats.completed++;\n } else if (state === 'RUNNING') {\n stats.running++;\n } else if (state === 'BLOCKED') {\n stats.blocked++;\n } else if (state === 'SKIPPED' || state === 'CANCELED') {\n stats.skipped++;\n stats.completed++;\n } else if (state === 'SCHEDULED' || state === 'ASSIGNED') {\n stats.queued++;\n }\n }\n \n return stats;\n }\n \n private getFailedJobs(jobs: any[]): any[] {\n if (!jobs) return [];\n \n return jobs.filter(job => {\n const state = job.node.state?.toUpperCase();\n return state === 'FAILED' || state === 'BROKEN' || (job.node.exitStatus && job.node.exitStatus !== 0) || job.node.passed === false;\n });\n }\n \n private getRunningJobs(jobs: any[]): any[] {\n if (!jobs) return [];\n \n return jobs.filter(job => job.node.state?.toLowerCase() === 'running');\n }\n \n private getBlockedJobs(jobs: any[]): any[] {\n if (!jobs) return [];\n \n return jobs.filter(job => job.node.state?.toLowerCase() === 'blocked');\n }\n \n private groupJobsByState(jobs: any[]): Record<string, any[]> {\n const grouped: Record<string, any[]> = {\n 'Failed': [],\n 'Passed': [],\n 'Running': [],\n 'Blocked': [],\n 'Skipped': []\n };\n \n if (!jobs) return grouped;\n \n for (const job of jobs) {\n const state = job.node.state?.toUpperCase() || '';\n \n if (state === 'FAILED' || state === 'BROKEN' || (job.node.exitStatus && job.node.exitStatus !== 0) || job.node.passed === false) {\n grouped['Failed'].push(job);\n } else if (state === 'PASSED' || (job.node.passed === true && state !== 'BROKEN')) {\n grouped['Passed'].push(job);\n } else if (state === 'RUNNING') {\n grouped['Running'].push(job);\n } else if (state === 'BLOCKED') {\n grouped['Blocked'].push(job);\n } else if (state === 'SKIPPED' || state === 'CANCELED') {\n grouped['Skipped'].push(job);\n }\n }\n \n return grouped;\n }\n \n private countAnnotationsByStyle(annotations: any[]): Record<string, number> {\n const counts: Record<string, number> = {\n ERROR: 0,\n WARNING: 0,\n INFO: 0,\n SUCCESS: 0\n };\n \n for (const annotation of annotations) {\n const style = annotation.node.style?.toUpperCase() || 'INFO';\n if (style in counts) {\n counts[style]++;\n }\n }\n \n return counts;\n }\n \n private groupAnnotationsByStyle(annotations: any[]): Record<string, any[]> {\n const grouped: Record<string, any[]> = {};\n \n for (const annotation of annotations) {\n const style = annotation.node.style?.toUpperCase() || 'INFO';\n if (!grouped[style]) {\n grouped[style] = [];\n }\n grouped[style].push(annotation);\n }\n \n return grouped;\n }\n \n formatError(action: string, error: any): string {\n return formatError(action, error);\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PlainTextFormatter } from './PlainTextFormatter.js';
|
|
2
|
+
import { JsonFormatter } from './JsonFormatter.js';
|
|
3
|
+
import { AlfredFormatter } from './AlfredFormatter.js';
|
|
4
|
+
export function getBuildDetailFormatter(format) {
|
|
5
|
+
switch (format.toLowerCase()) {
|
|
6
|
+
case 'json':
|
|
7
|
+
return new JsonFormatter();
|
|
8
|
+
case 'alfred':
|
|
9
|
+
return new AlfredFormatter();
|
|
10
|
+
case 'plain':
|
|
11
|
+
case 'text':
|
|
12
|
+
case 'plain-text':
|
|
13
|
+
default:
|
|
14
|
+
return new PlainTextFormatter();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export { BaseBuildDetailFormatter } from './Formatter.js';
|
|
18
|
+
export { PlainTextFormatter } from './PlainTextFormatter.js';
|
|
19
|
+
export { JsonFormatter } from './JsonFormatter.js';
|
|
20
|
+
export { AlfredFormatter } from './AlfredFormatter.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["formatters/build-detail/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,QAAQ,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7B,KAAK,MAAM;YACT,OAAO,IAAI,aAAa,EAAE,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,IAAI,eAAe,EAAE,CAAC;QAC/B,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,YAAY,CAAC;QAClB;YACE,OAAO,IAAI,kBAAkB,EAAE,CAAC;IACpC,CAAC;AACH,CAAC;AAED,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["import { BaseBuildDetailFormatter } from './Formatter.js';\nimport { PlainTextFormatter } from './PlainTextFormatter.js';\nimport { JsonFormatter } from './JsonFormatter.js';\nimport { AlfredFormatter } from './AlfredFormatter.js';\n\nexport function getBuildDetailFormatter(format: string): BaseBuildDetailFormatter {\n switch (format.toLowerCase()) {\n case 'json':\n return new JsonFormatter();\n case 'alfred':\n return new AlfredFormatter();\n case 'plain':\n case 'text':\n case 'plain-text':\n default:\n return new PlainTextFormatter();\n }\n}\n\nexport { BaseBuildDetailFormatter } from './Formatter.js';\nexport { PlainTextFormatter } from './PlainTextFormatter.js';\nexport { JsonFormatter } from './JsonFormatter.js';\nexport { AlfredFormatter } from './AlfredFormatter.js';\n"]}
|
package/dist/graphql/queries.js
CHANGED
|
@@ -135,4 +135,185 @@ export const GET_BUILD_ANNOTATIONS = gql `
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
`;
|
|
138
|
+
export const GET_BUILD_SUMMARY = gql `
|
|
139
|
+
query GetBuildSummary($slug: ID!) {
|
|
140
|
+
build(slug: $slug) {
|
|
141
|
+
id
|
|
142
|
+
number
|
|
143
|
+
state
|
|
144
|
+
branch
|
|
145
|
+
message
|
|
146
|
+
commit
|
|
147
|
+
createdAt
|
|
148
|
+
startedAt
|
|
149
|
+
finishedAt
|
|
150
|
+
canceledAt
|
|
151
|
+
url
|
|
152
|
+
blockedState
|
|
153
|
+
createdBy {
|
|
154
|
+
... on User {
|
|
155
|
+
id
|
|
156
|
+
name
|
|
157
|
+
email
|
|
158
|
+
avatar {
|
|
159
|
+
url
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
... on UnregisteredUser {
|
|
163
|
+
name
|
|
164
|
+
email
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
pipeline {
|
|
168
|
+
id
|
|
169
|
+
name
|
|
170
|
+
slug
|
|
171
|
+
}
|
|
172
|
+
organization {
|
|
173
|
+
id
|
|
174
|
+
name
|
|
175
|
+
slug
|
|
176
|
+
}
|
|
177
|
+
jobs(first: 100) {
|
|
178
|
+
edges {
|
|
179
|
+
node {
|
|
180
|
+
... on JobTypeCommand {
|
|
181
|
+
id
|
|
182
|
+
uuid
|
|
183
|
+
label
|
|
184
|
+
state
|
|
185
|
+
exitStatus
|
|
186
|
+
startedAt
|
|
187
|
+
finishedAt
|
|
188
|
+
passed
|
|
189
|
+
}
|
|
190
|
+
... on JobTypeWait {
|
|
191
|
+
id
|
|
192
|
+
label
|
|
193
|
+
}
|
|
194
|
+
... on JobTypeTrigger {
|
|
195
|
+
id
|
|
196
|
+
label
|
|
197
|
+
state
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
annotations(first: 50) {
|
|
203
|
+
edges {
|
|
204
|
+
node {
|
|
205
|
+
id
|
|
206
|
+
style
|
|
207
|
+
context
|
|
208
|
+
body {
|
|
209
|
+
html
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;
|
|
217
|
+
export const GET_BUILD_FULL = gql `
|
|
218
|
+
query GetBuildFull($slug: ID!) {
|
|
219
|
+
build(slug: $slug) {
|
|
220
|
+
id
|
|
221
|
+
number
|
|
222
|
+
state
|
|
223
|
+
branch
|
|
224
|
+
message
|
|
225
|
+
commit
|
|
226
|
+
createdAt
|
|
227
|
+
startedAt
|
|
228
|
+
finishedAt
|
|
229
|
+
canceledAt
|
|
230
|
+
url
|
|
231
|
+
blockedState
|
|
232
|
+
createdBy {
|
|
233
|
+
... on User {
|
|
234
|
+
id
|
|
235
|
+
name
|
|
236
|
+
email
|
|
237
|
+
avatar {
|
|
238
|
+
url
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
... on UnregisteredUser {
|
|
242
|
+
name
|
|
243
|
+
email
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
pipeline {
|
|
247
|
+
id
|
|
248
|
+
name
|
|
249
|
+
slug
|
|
250
|
+
repository {
|
|
251
|
+
url
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
organization {
|
|
255
|
+
id
|
|
256
|
+
name
|
|
257
|
+
slug
|
|
258
|
+
}
|
|
259
|
+
pullRequest {
|
|
260
|
+
id
|
|
261
|
+
}
|
|
262
|
+
jobs(first: 100) {
|
|
263
|
+
edges {
|
|
264
|
+
node {
|
|
265
|
+
... on JobTypeCommand {
|
|
266
|
+
id
|
|
267
|
+
uuid
|
|
268
|
+
label
|
|
269
|
+
command
|
|
270
|
+
state
|
|
271
|
+
exitStatus
|
|
272
|
+
startedAt
|
|
273
|
+
finishedAt
|
|
274
|
+
passed
|
|
275
|
+
retried
|
|
276
|
+
retrySource {
|
|
277
|
+
... on JobTypeCommand {
|
|
278
|
+
id
|
|
279
|
+
uuid
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
agent {
|
|
283
|
+
... on Agent {
|
|
284
|
+
id
|
|
285
|
+
name
|
|
286
|
+
hostname
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
... on JobTypeWait {
|
|
291
|
+
id
|
|
292
|
+
label
|
|
293
|
+
}
|
|
294
|
+
... on JobTypeTrigger {
|
|
295
|
+
id
|
|
296
|
+
label
|
|
297
|
+
state
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
annotations(first: 100) {
|
|
303
|
+
edges {
|
|
304
|
+
node {
|
|
305
|
+
id
|
|
306
|
+
style
|
|
307
|
+
context
|
|
308
|
+
body {
|
|
309
|
+
html
|
|
310
|
+
}
|
|
311
|
+
createdAt
|
|
312
|
+
updatedAt
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;
|
|
138
319
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"/","sources":["graphql/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;CAY5B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BnC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBvC,CAAC","sourcesContent":["/**\n * Common GraphQL queries for the Buildkite API\n */\nimport { gql } from 'graphql-request';\n\nexport const GET_VIEWER = gql`\n query GetViewer {\n viewer {\n id\n user {\n id\n uuid\n name\n email\n }\n }\n }\n`;\n\nexport const GET_ORGANIZATIONS = gql`\n query GetOrganizations {\n viewer {\n organizations {\n edges {\n node {\n id\n name\n slug\n }\n }\n }\n }\n }\n`;\n\nexport const GET_PIPELINES = gql`\n query GetPipelines($organizationSlug: ID!, $first: Int, $after: String) {\n organization(slug: $organizationSlug) {\n pipelines(first: $first, after: $after, archived: false) {\n edges {\n node {\n uuid\n id\n name\n slug\n description\n url\n repository {\n url\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n`;\n\nexport const GET_BUILDS = gql`\n query GetBuilds($pipelineSlug: String!, $organizationSlug: ID!, $first: Int) {\n organization(slug: $organizationSlug) {\n pipelines(first: 1, search: $pipelineSlug) {\n edges {\n node {\n builds(first: $first) {\n edges {\n node {\n id\n number\n url\n state\n message\n commit\n branch\n createdAt\n startedAt\n finishedAt\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n }\n }\n }\n`;\n\nexport const GET_VIEWER_BUILDS = gql`\n query GetViewerBuilds($first: Int!) {\n viewer {\n builds(first: $first) {\n edges {\n node {\n id\n number\n state\n url\n createdAt\n branch\n message\n pipeline {\n name\n slug\n }\n organization {\n name\n slug\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n`;\n\nexport const GET_BUILD_ANNOTATIONS = gql`\n query GetBuildAnnotations($buildSlug: ID!) {\n build(slug: $buildSlug) {\n annotations(first: 100) {\n edges {\n node {\n context\n style\n body {\n html\n }\n }\n }\n }\n }\n }\n`; "]}
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"/","sources":["graphql/queries.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;CAY5B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;CAwB/B,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BnC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;CAgBvC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EnC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGhC,CAAC","sourcesContent":["/**\n * Common GraphQL queries for the Buildkite API\n */\nimport { gql } from 'graphql-request';\n\nexport const GET_VIEWER = gql`\n query GetViewer {\n viewer {\n id\n user {\n id\n uuid\n name\n email\n }\n }\n }\n`;\n\nexport const GET_ORGANIZATIONS = gql`\n query GetOrganizations {\n viewer {\n organizations {\n edges {\n node {\n id\n name\n slug\n }\n }\n }\n }\n }\n`;\n\nexport const GET_PIPELINES = gql`\n query GetPipelines($organizationSlug: ID!, $first: Int, $after: String) {\n organization(slug: $organizationSlug) {\n pipelines(first: $first, after: $after, archived: false) {\n edges {\n node {\n uuid\n id\n name\n slug\n description\n url\n repository {\n url\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n`;\n\nexport const GET_BUILDS = gql`\n query GetBuilds($pipelineSlug: String!, $organizationSlug: ID!, $first: Int) {\n organization(slug: $organizationSlug) {\n pipelines(first: 1, search: $pipelineSlug) {\n edges {\n node {\n builds(first: $first) {\n edges {\n node {\n id\n number\n url\n state\n message\n commit\n branch\n createdAt\n startedAt\n finishedAt\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n }\n }\n }\n`;\n\nexport const GET_VIEWER_BUILDS = gql`\n query GetViewerBuilds($first: Int!) {\n viewer {\n builds(first: $first) {\n edges {\n node {\n id\n number\n state\n url\n createdAt\n branch\n message\n pipeline {\n name\n slug\n }\n organization {\n name\n slug\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n`;\n\nexport const GET_BUILD_ANNOTATIONS = gql`\n query GetBuildAnnotations($buildSlug: ID!) {\n build(slug: $buildSlug) {\n annotations(first: 100) {\n edges {\n node {\n context\n style\n body {\n html\n }\n }\n }\n }\n }\n }\n`;\n\nexport const GET_BUILD_SUMMARY = gql`\n query GetBuildSummary($slug: ID!) {\n build(slug: $slug) {\n id\n number\n state\n branch\n message\n commit\n createdAt\n startedAt\n finishedAt\n canceledAt\n url\n blockedState\n createdBy {\n ... on User {\n id\n name\n email\n avatar {\n url\n }\n }\n ... on UnregisteredUser {\n name\n email\n }\n }\n pipeline {\n id\n name\n slug\n }\n organization {\n id\n name\n slug\n }\n jobs(first: 100) {\n edges {\n node {\n ... on JobTypeCommand {\n id\n uuid\n label\n state\n exitStatus\n startedAt\n finishedAt\n passed\n }\n ... on JobTypeWait {\n id\n label\n }\n ... on JobTypeTrigger {\n id\n label\n state\n }\n }\n }\n }\n annotations(first: 50) {\n edges {\n node {\n id\n style\n context\n body {\n html\n }\n }\n }\n }\n }\n }\n`;\n\nexport const GET_BUILD_FULL = gql`\n query GetBuildFull($slug: ID!) {\n build(slug: $slug) {\n id\n number\n state\n branch\n message\n commit\n createdAt\n startedAt\n finishedAt\n canceledAt\n url\n blockedState\n createdBy {\n ... on User {\n id\n name\n email\n avatar {\n url\n }\n }\n ... on UnregisteredUser {\n name\n email\n }\n }\n pipeline {\n id\n name\n slug\n repository {\n url\n }\n }\n organization {\n id\n name\n slug\n }\n pullRequest {\n id\n }\n jobs(first: 100) {\n edges {\n node {\n ... on JobTypeCommand {\n id\n uuid\n label\n command\n state\n exitStatus\n startedAt\n finishedAt\n passed\n retried\n retrySource {\n ... on JobTypeCommand {\n id\n uuid\n }\n }\n agent {\n ... on Agent {\n id\n name\n hostname\n }\n }\n }\n ... on JobTypeWait {\n id\n label\n }\n ... on JobTypeTrigger {\n id\n label\n state\n }\n }\n }\n }\n annotations(first: 100) {\n edges {\n node {\n id\n style\n context\n body {\n html\n }\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n`; "]}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import { BaseCommand, ShowViewer, ListOrganizations, ListBuilds, ListPipelines, ManageToken, ListAnnotations, GenerateCompletions } from './commands/index.js';
|
|
6
|
+
import { BaseCommand, ShowViewer, ListOrganizations, ListBuilds, ListPipelines, ManageToken, ListAnnotations, GenerateCompletions, ShowBuild } from './commands/index.js';
|
|
7
7
|
import { initializeErrorHandling } from './utils/errorUtils.js';
|
|
8
8
|
import { displayCLIError, setErrorFormat } from './utils/cli-error-handler.js';
|
|
9
9
|
import { logger, setLogLevel } from './services/logger.js';
|
|
@@ -204,6 +204,14 @@ program
|
|
|
204
204
|
logger.debug('Annotations context filter:', mergedOptions.context);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
+
else if (commandName === 'build') {
|
|
208
|
+
// Attach the build argument to options
|
|
209
|
+
cmd.mergedOptions.buildArg = cmd.args?.[0];
|
|
210
|
+
if (mergedOptions.debug) {
|
|
211
|
+
logger.debug('Build arg:', cmd.mergedOptions.buildArg);
|
|
212
|
+
logger.debug('Build options:', mergedOptions);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
207
215
|
if (mergedOptions.debug) {
|
|
208
216
|
logger.debug(`Executing command: ${commandName}`);
|
|
209
217
|
logger.debug('Options:', mergedOptions);
|
|
@@ -260,6 +268,18 @@ program
|
|
|
260
268
|
.argument('<build>', 'Build reference (org/pipeline/number or @https://buildkite.com/org/pipeline/builds/number)')
|
|
261
269
|
.option('--context <context>', 'Filter annotations by context (e.g., rspec, build-resources)')
|
|
262
270
|
.action(createCommandHandler(ListAnnotations));
|
|
271
|
+
// Add build command
|
|
272
|
+
program
|
|
273
|
+
.command('build')
|
|
274
|
+
.description('Show details for a specific build')
|
|
275
|
+
.argument('<build>', 'Build reference (org/pipeline/number or @https://buildkite.com/org/pipeline/builds/number)')
|
|
276
|
+
.option('--jobs', 'Show job summary and details')
|
|
277
|
+
.option('--failed', 'Show only failed job details (implies --jobs)')
|
|
278
|
+
.option('--annotations', 'Show annotation details with context')
|
|
279
|
+
.option('--annotations-full', 'Show complete annotation content')
|
|
280
|
+
.option('--full', 'Show all available information')
|
|
281
|
+
.option('--summary', 'Single-line summary only (for scripts)')
|
|
282
|
+
.action(createCommandHandler(ShowBuild));
|
|
263
283
|
// Add completions command
|
|
264
284
|
program
|
|
265
285
|
.command('completions [shell]')
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,aAAa,EACb,WAAW,EACX,eAAe,EACf,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,qDAAqD;AACrD,MAAM,wBAAwB,GAAG,CAAC,GAAU,EAAE,EAAE;IAC9C,mDAAmD;IACnD,MAAM,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACxD,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC1B,IAAI,QAAQ,KAAK,wBAAwB,EAAE,CAAC;YAC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IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,4CAA4C;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;AAC/B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,6CAA6C;IAC7C,WAAW,CAAC,OAAO,CAAC,CAAC;IACrB,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AACtD,CAAC;KAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9B,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,CAAC,QAAQ,yBAAyB,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,CAAC,KAAK,CAAC;IACX,GAAG,EAAE,OAAO,CAAC,GAAG;CACjB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport {\n BaseCommand,\n ShowViewer,\n ListOrganizations,\n ListBuilds,\n ListPipelines,\n ManageToken,\n ListAnnotations,\n GenerateCompletions\n} from './commands/index.js';\nimport { initializeErrorHandling } from './utils/errorUtils.js';\nimport { displayCLIError, setErrorFormat } from './utils/cli-error-handler.js';\nimport { logger, setLogLevel } from './services/logger.js';\nimport { WidthAwareHelp } from './ui/help.js';\n\n// Set a global error handler for uncaught exceptions\nconst uncaughtExceptionHandler = (err: Error) => {\n // Remove any existing handlers to avoid duplicates\n const handlers = process.listeners('uncaughtException');\n handlers.forEach(listener => {\n if (listener !== uncaughtExceptionHandler) {\n process.removeListener('uncaughtException', listener);\n }\n });\n \n displayCLIError(\n err, \n process.argv.includes('--debug')\n );\n};\nprocess.on('uncaughtException', uncaughtExceptionHandler);\n\n// Set a global error handler for unhandled promise rejections\nconst unhandledRejectionHandler = (reason: unknown) => {\n // Remove any existing handlers to avoid duplicates\n const handlers = process.listeners('unhandledRejection');\n handlers.forEach(listener => {\n if (listener !== unhandledRejectionHandler) {\n process.removeListener('unhandledRejection', listener);\n }\n });\n \n displayCLIError(\n reason, \n process.argv.includes('--debug')\n );\n};\nprocess.on('unhandledRejection', unhandledRejectionHandler);\n\n// Initialize error handling after our handlers are registered\ninitializeErrorHandling();\n\nconst program = new Command();\n\n// Define a generic interface for the command classes that includes the execute method\ninterface CommandWithExecute {\n execute(options: any): Promise<number>;\n}\n\n// Define a type for the constructor that includes static properties\ntype CommandConstructor = {\n new (options?: any): BaseCommand & CommandWithExecute;\n requiresToken: boolean;\n}\n\n// Extend the Command type to include our custom properties\ninterface ExtendedCommand extends Command {\n mergedOptions?: any;\n pipelineOptions?: {\n organization?: string;\n count?: number;\n filter?: string;\n };\n buildOptions?: {\n organization?: string;\n pipeline?: string;\n branch?: string;\n state?: string;\n count: number;\n page: number;\n filter?: string;\n };\n}\n\n// Handler for executing commands with proper option handling\nconst createCommandHandler = (CommandClass: CommandConstructor) => {\n return async function(this: ExtendedCommand) {\n try {\n const options = this.mergedOptions || this.opts();\n const cacheOptions = { enabled: options.cache !== false, ttl: options.cacheTtl, clear: options.clearCache };\n\n if (CommandClass.requiresToken) {\n const token = await BaseCommand.getToken(options);\n options.token = token;\n }\n \n const handler = new CommandClass({\n ...cacheOptions,\n token: options.token,\n debug: options.debug,\n format: options.format,\n quiet: options.quiet,\n tips: options.tips,\n });\n \n // Pass command-specific options if available\n const commandName = this.name();\n if (commandName === 'pipelines' && this.pipelineOptions) {\n logger.debug('Using pipeline options:', this.pipelineOptions);\n }\n else if (commandName === 'builds' && this.buildOptions) {\n logger.debug('Using build options:', this.buildOptions);\n }\n \n const exitCode = await handler.execute(options);\n // Set process.exitCode to propagate the exit code\n process.exitCode = exitCode;\n } catch (error) {\n const debug = this.mergedOptions?.debug || this.opts().debug || false;\n // No need to pass format - will use global format set in preAction hook\n displayCLIError(error, debug);\n process.exitCode = 1; // Set error exit code\n }\n };\n};\n\nfunction resolveAppVersion(): string {\n // Prefer environment-provided version (set in CI before publish)\n if (process.env.BKTIDE_VERSION && process.env.BKTIDE_VERSION.trim().length > 0) {\n return process.env.BKTIDE_VERSION.trim();\n }\n\n try {\n // Attempt to read package.json near compiled dist/index.js\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n const candidatePaths = [\n path.resolve(__dirname, '..', 'package.json'), // when running from dist/\n path.resolve(__dirname, '..', '..', 'package.json'), // fallback\n ];\n for (const pkgPath of candidatePaths) {\n if (fs.existsSync(pkgPath)) {\n const raw = fs.readFileSync(pkgPath, 'utf-8');\n const pkg = JSON.parse(raw) as { version?: string };\n if (pkg.version) return pkg.version;\n }\n }\n } catch {\n // ignore\n }\n\n // Last resort\n return '0.0.0';\n}\n\n// Create custom help instance\nconst customHelp = new WidthAwareHelp();\n\nprogram\n .name('bktide')\n .description('Buildkite CLI tool')\n .version(resolveAppVersion())\n .configureHelp(customHelp)\n .showSuggestionAfterError()\n .option('--log-level <level>', 'Set logging level (trace, debug, info, warn, error, fatal)', 'info')\n .option('-d, --debug', 'Show debug information for errors')\n .option('--no-cache', 'Disable caching of API responses')\n .option('--cache-ttl <milliseconds>', 'Set cache time-to-live in milliseconds', parseInt)\n .option('--clear-cache', 'Clear all cached data before executing command')\n .option('-t, --token <token>', 'Buildkite API token (set BUILDKITE_API_TOKEN or BK_TOKEN env var)', process.env.BUILDKITE_API_TOKEN || process.env.BK_TOKEN)\n .option('--save-token', 'Save the token to system keychain for future use')\n .option('-f, --format <format>', 'Output format for results and errors (plain, json, alfred)', 'plain')\n .option('--color <mode>', 'Color output: auto|always|never', 'auto')\n .option('-q, --quiet', 'Suppress non-error output (plain format only)')\n .option('--tips', 'Show helpful tips and suggestions')\n .option('--no-tips', 'Hide helpful tips and suggestions')\n .option('--ascii', 'Use ASCII symbols instead of Unicode');\n\n// Add hooks for handling options\nprogram\n .hook('preAction', (_thisCommand, actionCommand) => {\n // Cast to our extended command type\n const cmd = actionCommand as unknown as ExtendedCommand;\n \n // Merge global options with command-specific options\n const globalOpts = program.opts();\n const commandOpts = cmd.opts();\n const mergedOptions = { ...globalOpts, ...commandOpts };\n \n // Set the global error format from the command line options\n if (mergedOptions.format) {\n setErrorFormat(mergedOptions.format);\n }\n\n // Apply color mode\n if (mergedOptions.color) {\n const mode = String(mergedOptions.color).toLowerCase();\n // Respect NO_COLOR when mode is never; clear when always\n if (mode === 'never') {\n process.env.NO_COLOR = '1';\n } else if (mode === 'always') {\n // Explicitly enable color by unsetting NO_COLOR; downstream code should still TTY-check\n if (process.env.NO_COLOR) {\n delete process.env.NO_COLOR;\n }\n process.env.BKTIDE_COLOR_MODE = 'always';\n } else {\n // auto\n process.env.BKTIDE_COLOR_MODE = 'auto';\n }\n }\n \n if (mergedOptions.cacheTtl && (isNaN(mergedOptions.cacheTtl) || mergedOptions.cacheTtl <= 0)) {\n logger.error('cache-ttl must be a positive number');\n process.exitCode = 1;\n return;\n }\n \n if (mergedOptions.cache === false && mergedOptions.cacheTtl) {\n logger.warn('--no-cache and --cache-ttl used together. Cache will be disabled regardless of TTL setting.');\n }\n \n // Validate count options\n if (mergedOptions.count && (isNaN(parseInt(mergedOptions.count)) || parseInt(mergedOptions.count) <= 0)) {\n logger.error('count must be a positive number');\n process.exitCode = 1;\n return;\n }\n\n cmd.mergedOptions = mergedOptions;\n\n const commandName = cmd.name();\n\n if (commandName === 'pipelines') {\n // Create pipeline-specific options structure\n cmd.pipelineOptions = {\n organization: mergedOptions.org,\n count: mergedOptions.count ? parseInt(mergedOptions.count) : undefined,\n filter: mergedOptions.filter\n };\n \n if (mergedOptions.debug) {\n logger.debug('Pipeline options:', cmd.pipelineOptions);\n }\n }\n else if (commandName === 'builds') {\n // Create builds-specific options structure\n cmd.buildOptions = {\n organization: mergedOptions.org,\n pipeline: mergedOptions.pipeline,\n branch: mergedOptions.branch,\n state: mergedOptions.state,\n count: mergedOptions.count ? parseInt(mergedOptions.count) : 10,\n page: mergedOptions.page ? parseInt(mergedOptions.page) : 1,\n filter: mergedOptions.filter\n };\n \n if (mergedOptions.debug) {\n logger.debug('Build options:', cmd.buildOptions);\n }\n }\n else if (commandName === 'annotations') {\n // Attach the build argument to options\n cmd.mergedOptions.buildArg = cmd.args?.[0];\n \n if (mergedOptions.debug) {\n logger.debug('Annotations build arg:', cmd.mergedOptions.buildArg);\n logger.debug('Annotations context filter:', mergedOptions.context);\n }\n }\n \n if (mergedOptions.debug) {\n logger.debug(`Executing command: ${commandName}`);\n logger.debug('Options:', mergedOptions);\n }\n })\n .hook('postAction', (_thisCommand, actionCommand) => {\n // Cast to our extended command type\n const cmd = actionCommand as unknown as ExtendedCommand;\n \n // Accessing the custom property\n const options = cmd.mergedOptions || {};\n if (options.debug) {\n logger.debug(`Command ${cmd.name()} completed`);\n }\n });\n\nprogram\n .command('viewer')\n .description('Show logged in user information')\n .action(createCommandHandler(ShowViewer));\n\nprogram\n .command('orgs')\n .description('List organizations')\n .action(createCommandHandler(ListOrganizations));\n\nprogram\n .command('pipelines')\n .description('List pipelines for an organization')\n .option('-o, --org <org>', 'Organization slug (optional - will search all your orgs if not specified)')\n .option('-n, --count <count>', 'Limit to specified number of pipelines per organization')\n .option('--filter <name>', 'Filter pipelines by name (case insensitive)')\n .action(createCommandHandler(ListPipelines));\n\n// Update the builds command to include REST API filtering options\nprogram\n .command('builds')\n .description('List builds for the current user')\n .option('-o, --org <org>', 'Organization slug (optional - will search all your orgs if not specified)')\n .option('-p, --pipeline <pipeline>', 'Filter by pipeline slug')\n .option('-b, --branch <branch>', 'Filter by branch name')\n .option('-s, --state <state>', 'Filter by build state (running, scheduled, passed, failing, failed, canceled, etc.)')\n .option('-n, --count <count>', 'Number of builds per page', '10')\n .option('--page <page>', 'Page number', '1')\n .option('--filter <filter>', 'Fuzzy filter builds by name or other properties')\n .action(createCommandHandler(ListBuilds));\n\n// Add token management command\nprogram\n .command('token')\n .description('Manage API tokens')\n .option('--check', 'Check if a token is stored in the system keychain')\n .option('--store', 'Store a token in the system keychain')\n .option('--reset', 'Delete the stored token from system keychain')\n .action(createCommandHandler(ManageToken));\n\n// Add annotations command\nprogram\n .command('annotations')\n .description('Show annotations for a build')\n .argument('<build>', 'Build reference (org/pipeline/number or @https://buildkite.com/org/pipeline/builds/number)')\n .option('--context <context>', 'Filter annotations by context (e.g., rspec, build-resources)')\n .action(createCommandHandler(ListAnnotations));\n\n// Add completions command\nprogram\n .command('completions [shell]')\n .description('Generate shell completions')\n .action(async (shell) => {\n const handler = new GenerateCompletions();\n const exitCode = await handler.execute({ shell, quiet: program.opts().quiet, debug: program.opts().debug });\n process.exitCode = exitCode;\n });\n\nprogram\n .command('boom')\n .description('Test error handling')\n .option('--type <type>', 'Type of error to throw (basic, api, object)', 'basic')\n .option('--format <format>', 'Output format (plain, json, alfred)', 'plain')\n .action((options) => {\n switch (options.type) {\n case 'api':\n const apiError = new Error('API request failed');\n (apiError as any).response = {\n errors: [\n { message: 'Invalid token', path: ['viewer'] }\n ]\n };\n throw apiError;\n \n case 'object':\n throw {\n message: 'This is not an Error instance',\n code: 'CUSTOM_ERROR'\n };\n \n case 'basic':\n default:\n throw new Error('Boom! This is a test error');\n }\n });\n\nprogram.parse();\n\n// Apply log level from command line options\nconst options = program.opts();\nif (options.debug) {\n // Debug mode takes precedence over log-level\n setLogLevel('debug');\n logger.debug('Debug mode enabled via --debug flag');\n} else if (options.logLevel) {\n setLogLevel(options.logLevel);\n logger.debug(`Log level set to ${options.logLevel} via --log-level option`);\n}\n\nlogger.debug({ \n pid: process.pid, \n}, 'Buildkite CLI started'); "]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,O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M,EAAE;oBACN,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE;iBAC/C;aACF,CAAC;YACF,MAAM,QAAQ,CAAC;QAEjB,KAAK,QAAQ;YACX,MAAM;gBACJ,OAAO,EAAE,+BAA+B;gBACxC,IAAI,EAAE,cAAc;aACrB,CAAC;QAEJ,KAAK,OAAO,CAAC;QACb;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,4CAA4C;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;AAC/B,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,6CAA6C;IAC7C,WAAW,CAAC,OAAO,CAAC,CAAC;IACrB,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;AACtD,CAAC;KAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5B,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9B,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,CAAC,QAAQ,yBAAyB,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,CAAC,KAAK,CAAC;IACX,GAAG,EAAE,OAAO,CAAC,GAAG;CACjB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport {\n BaseCommand,\n ShowViewer,\n ListOrganizations,\n ListBuilds,\n ListPipelines,\n ManageToken,\n ListAnnotations,\n GenerateCompletions,\n ShowBuild\n} from './commands/index.js';\nimport { initializeErrorHandling } from './utils/errorUtils.js';\nimport { displayCLIError, setErrorFormat } from './utils/cli-error-handler.js';\nimport { logger, setLogLevel } from './services/logger.js';\nimport { WidthAwareHelp } from './ui/help.js';\n\n// Set a global error handler for uncaught exceptions\nconst uncaughtExceptionHandler = (err: Error) => {\n // Remove any existing handlers to avoid duplicates\n const handlers = process.listeners('uncaughtException');\n handlers.forEach(listener => {\n if (listener !== uncaughtExceptionHandler) {\n process.removeListener('uncaughtException', listener);\n }\n });\n \n displayCLIError(\n err, \n process.argv.includes('--debug')\n );\n};\nprocess.on('uncaughtException', uncaughtExceptionHandler);\n\n// Set a global error handler for unhandled promise rejections\nconst unhandledRejectionHandler = (reason: unknown) => {\n // Remove any existing handlers to avoid duplicates\n const handlers = process.listeners('unhandledRejection');\n handlers.forEach(listener => {\n if (listener !== unhandledRejectionHandler) {\n process.removeListener('unhandledRejection', listener);\n }\n });\n \n displayCLIError(\n reason, \n process.argv.includes('--debug')\n );\n};\nprocess.on('unhandledRejection', unhandledRejectionHandler);\n\n// Initialize error handling after our handlers are registered\ninitializeErrorHandling();\n\nconst program = new Command();\n\n// Define a generic interface for the command classes that includes the execute method\ninterface CommandWithExecute {\n execute(options: any): Promise<number>;\n}\n\n// Define a type for the constructor that includes static properties\ntype CommandConstructor = {\n new (options?: any): BaseCommand & CommandWithExecute;\n requiresToken: boolean;\n}\n\n// Extend the Command type to include our custom properties\ninterface ExtendedCommand extends Command {\n mergedOptions?: any;\n pipelineOptions?: {\n organization?: string;\n count?: number;\n filter?: string;\n };\n buildOptions?: {\n organization?: string;\n pipeline?: string;\n branch?: string;\n state?: string;\n count: number;\n page: number;\n filter?: string;\n };\n}\n\n// Handler for executing commands with proper option handling\nconst createCommandHandler = (CommandClass: CommandConstructor) => {\n return async function(this: ExtendedCommand) {\n try {\n const options = this.mergedOptions || this.opts();\n const cacheOptions = { enabled: options.cache !== false, ttl: options.cacheTtl, clear: options.clearCache };\n\n if (CommandClass.requiresToken) {\n const token = await BaseCommand.getToken(options);\n options.token = token;\n }\n \n const handler = new CommandClass({\n ...cacheOptions,\n token: options.token,\n debug: options.debug,\n format: options.format,\n quiet: options.quiet,\n tips: options.tips,\n });\n \n // Pass command-specific options if available\n const commandName = this.name();\n if (commandName === 'pipelines' && this.pipelineOptions) {\n logger.debug('Using pipeline options:', this.pipelineOptions);\n }\n else if (commandName === 'builds' && this.buildOptions) {\n logger.debug('Using build options:', this.buildOptions);\n }\n \n const exitCode = await handler.execute(options);\n // Set process.exitCode to propagate the exit code\n process.exitCode = exitCode;\n } catch (error) {\n const debug = this.mergedOptions?.debug || this.opts().debug || false;\n // No need to pass format - will use global format set in preAction hook\n displayCLIError(error, debug);\n process.exitCode = 1; // Set error exit code\n }\n };\n};\n\nfunction resolveAppVersion(): string {\n // Prefer environment-provided version (set in CI before publish)\n if (process.env.BKTIDE_VERSION && process.env.BKTIDE_VERSION.trim().length > 0) {\n return process.env.BKTIDE_VERSION.trim();\n }\n\n try {\n // Attempt to read package.json near compiled dist/index.js\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = path.dirname(__filename);\n const candidatePaths = [\n path.resolve(__dirname, '..', 'package.json'), // when running from dist/\n path.resolve(__dirname, '..', '..', 'package.json'), // fallback\n ];\n for (const pkgPath of candidatePaths) {\n if (fs.existsSync(pkgPath)) {\n const raw = fs.readFileSync(pkgPath, 'utf-8');\n const pkg = JSON.parse(raw) as { version?: string };\n if (pkg.version) return pkg.version;\n }\n }\n } catch {\n // ignore\n }\n\n // Last resort\n return '0.0.0';\n}\n\n// Create custom help instance\nconst customHelp = new WidthAwareHelp();\n\nprogram\n .name('bktide')\n .description('Buildkite CLI tool')\n .version(resolveAppVersion())\n .configureHelp(customHelp)\n .showSuggestionAfterError()\n .option('--log-level <level>', 'Set logging level (trace, debug, info, warn, error, fatal)', 'info')\n .option('-d, --debug', 'Show debug information for errors')\n .option('--no-cache', 'Disable caching of API responses')\n .option('--cache-ttl <milliseconds>', 'Set cache time-to-live in milliseconds', parseInt)\n .option('--clear-cache', 'Clear all cached data before executing command')\n .option('-t, --token <token>', 'Buildkite API token (set BUILDKITE_API_TOKEN or BK_TOKEN env var)', process.env.BUILDKITE_API_TOKEN || process.env.BK_TOKEN)\n .option('--save-token', 'Save the token to system keychain for future use')\n .option('-f, --format <format>', 'Output format for results and errors (plain, json, alfred)', 'plain')\n .option('--color <mode>', 'Color output: auto|always|never', 'auto')\n .option('-q, --quiet', 'Suppress non-error output (plain format only)')\n .option('--tips', 'Show helpful tips and suggestions')\n .option('--no-tips', 'Hide helpful tips and suggestions')\n .option('--ascii', 'Use ASCII symbols instead of Unicode');\n\n// Add hooks for handling options\nprogram\n .hook('preAction', (_thisCommand, actionCommand) => {\n // Cast to our extended command type\n const cmd = actionCommand as unknown as ExtendedCommand;\n \n // Merge global options with command-specific options\n const globalOpts = program.opts();\n const commandOpts = cmd.opts();\n const mergedOptions = { ...globalOpts, ...commandOpts };\n \n // Set the global error format from the command line options\n if (mergedOptions.format) {\n setErrorFormat(mergedOptions.format);\n }\n\n // Apply color mode\n if (mergedOptions.color) {\n const mode = String(mergedOptions.color).toLowerCase();\n // Respect NO_COLOR when mode is never; clear when always\n if (mode === 'never') {\n process.env.NO_COLOR = '1';\n } else if (mode === 'always') {\n // Explicitly enable color by unsetting NO_COLOR; downstream code should still TTY-check\n if (process.env.NO_COLOR) {\n delete process.env.NO_COLOR;\n }\n process.env.BKTIDE_COLOR_MODE = 'always';\n } else {\n // auto\n process.env.BKTIDE_COLOR_MODE = 'auto';\n }\n }\n \n if (mergedOptions.cacheTtl && (isNaN(mergedOptions.cacheTtl) || mergedOptions.cacheTtl <= 0)) {\n logger.error('cache-ttl must be a positive number');\n process.exitCode = 1;\n return;\n }\n \n if (mergedOptions.cache === false && mergedOptions.cacheTtl) {\n logger.warn('--no-cache and --cache-ttl used together. Cache will be disabled regardless of TTL setting.');\n }\n \n // Validate count options\n if (mergedOptions.count && (isNaN(parseInt(mergedOptions.count)) || parseInt(mergedOptions.count) <= 0)) {\n logger.error('count must be a positive number');\n process.exitCode = 1;\n return;\n }\n\n cmd.mergedOptions = mergedOptions;\n\n const commandName = cmd.name();\n\n if (commandName === 'pipelines') {\n // Create pipeline-specific options structure\n cmd.pipelineOptions = {\n organization: mergedOptions.org,\n count: mergedOptions.count ? parseInt(mergedOptions.count) : undefined,\n filter: mergedOptions.filter\n };\n \n if (mergedOptions.debug) {\n logger.debug('Pipeline options:', cmd.pipelineOptions);\n }\n }\n else if (commandName === 'builds') {\n // Create builds-specific options structure\n cmd.buildOptions = {\n organization: mergedOptions.org,\n pipeline: mergedOptions.pipeline,\n branch: mergedOptions.branch,\n state: mergedOptions.state,\n count: mergedOptions.count ? parseInt(mergedOptions.count) : 10,\n page: mergedOptions.page ? parseInt(mergedOptions.page) : 1,\n filter: mergedOptions.filter\n };\n \n if (mergedOptions.debug) {\n logger.debug('Build options:', cmd.buildOptions);\n }\n }\n else if (commandName === 'annotations') {\n // Attach the build argument to options\n cmd.mergedOptions.buildArg = cmd.args?.[0];\n \n if (mergedOptions.debug) {\n logger.debug('Annotations build arg:', cmd.mergedOptions.buildArg);\n logger.debug('Annotations context filter:', mergedOptions.context);\n }\n }\n else if (commandName === 'build') {\n // Attach the build argument to options\n cmd.mergedOptions.buildArg = cmd.args?.[0];\n \n if (mergedOptions.debug) {\n logger.debug('Build arg:', cmd.mergedOptions.buildArg);\n logger.debug('Build options:', mergedOptions);\n }\n }\n \n if (mergedOptions.debug) {\n logger.debug(`Executing command: ${commandName}`);\n logger.debug('Options:', mergedOptions);\n }\n })\n .hook('postAction', (_thisCommand, actionCommand) => {\n // Cast to our extended command type\n const cmd = actionCommand as unknown as ExtendedCommand;\n \n // Accessing the custom property\n const options = cmd.mergedOptions || {};\n if (options.debug) {\n logger.debug(`Command ${cmd.name()} completed`);\n }\n });\n\nprogram\n .command('viewer')\n .description('Show logged in user information')\n .action(createCommandHandler(ShowViewer));\n\nprogram\n .command('orgs')\n .description('List organizations')\n .action(createCommandHandler(ListOrganizations));\n\nprogram\n .command('pipelines')\n .description('List pipelines for an organization')\n .option('-o, --org <org>', 'Organization slug (optional - will search all your orgs if not specified)')\n .option('-n, --count <count>', 'Limit to specified number of pipelines per organization')\n .option('--filter <name>', 'Filter pipelines by name (case insensitive)')\n .action(createCommandHandler(ListPipelines));\n\n// Update the builds command to include REST API filtering options\nprogram\n .command('builds')\n .description('List builds for the current user')\n .option('-o, --org <org>', 'Organization slug (optional - will search all your orgs if not specified)')\n .option('-p, --pipeline <pipeline>', 'Filter by pipeline slug')\n .option('-b, --branch <branch>', 'Filter by branch name')\n .option('-s, --state <state>', 'Filter by build state (running, scheduled, passed, failing, failed, canceled, etc.)')\n .option('-n, --count <count>', 'Number of builds per page', '10')\n .option('--page <page>', 'Page number', '1')\n .option('--filter <filter>', 'Fuzzy filter builds by name or other properties')\n .action(createCommandHandler(ListBuilds));\n\n// Add token management command\nprogram\n .command('token')\n .description('Manage API tokens')\n .option('--check', 'Check if a token is stored in the system keychain')\n .option('--store', 'Store a token in the system keychain')\n .option('--reset', 'Delete the stored token from system keychain')\n .action(createCommandHandler(ManageToken));\n\n// Add annotations command\nprogram\n .command('annotations')\n .description('Show annotations for a build')\n .argument('<build>', 'Build reference (org/pipeline/number or @https://buildkite.com/org/pipeline/builds/number)')\n .option('--context <context>', 'Filter annotations by context (e.g., rspec, build-resources)')\n .action(createCommandHandler(ListAnnotations));\n\n// Add build command\nprogram\n .command('build')\n .description('Show details for a specific build')\n .argument('<build>', 'Build reference (org/pipeline/number or @https://buildkite.com/org/pipeline/builds/number)')\n .option('--jobs', 'Show job summary and details')\n .option('--failed', 'Show only failed job details (implies --jobs)')\n .option('--annotations', 'Show annotation details with context')\n .option('--annotations-full', 'Show complete annotation content')\n .option('--full', 'Show all available information')\n .option('--summary', 'Single-line summary only (for scripts)')\n .action(createCommandHandler(ShowBuild));\n\n// Add completions command\nprogram\n .command('completions [shell]')\n .description('Generate shell completions')\n .action(async (shell) => {\n const handler = new GenerateCompletions();\n const exitCode = await handler.execute({ shell, quiet: program.opts().quiet, debug: program.opts().debug });\n process.exitCode = exitCode;\n });\n\nprogram\n .command('boom')\n .description('Test error handling')\n .option('--type <type>', 'Type of error to throw (basic, api, object)', 'basic')\n .option('--format <format>', 'Output format (plain, json, alfred)', 'plain')\n .action((options) => {\n switch (options.type) {\n case 'api':\n const apiError = new Error('API request failed');\n (apiError as any).response = {\n errors: [\n { message: 'Invalid token', path: ['viewer'] }\n ]\n };\n throw apiError;\n \n case 'object':\n throw {\n message: 'This is not an Error instance',\n code: 'CUSTOM_ERROR'\n };\n \n case 'basic':\n default:\n throw new Error('Boom! This is a test error');\n }\n });\n\nprogram.parse();\n\n// Apply log level from command line options\nconst options = program.opts();\nif (options.debug) {\n // Debug mode takes precedence over log-level\n setLogLevel('debug');\n logger.debug('Debug mode enabled via --debug flag');\n} else if (options.logLevel) {\n setLogLevel(options.logLevel);\n logger.debug(`Log level set to ${options.logLevel} via --log-level option`);\n}\n\nlogger.debug({ \n pid: process.pid, \n}, 'Buildkite CLI started'); "]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GraphQLClient } from 'graphql-request';
|
|
2
2
|
import { CacheManager } from './CacheManager.js';
|
|
3
3
|
// Import the queries - we'll use them for both string queries and typed SDK
|
|
4
|
-
import { GET_VIEWER, GET_ORGANIZATIONS, GET_PIPELINES, GET_BUILDS, GET_VIEWER_BUILDS, GET_BUILD_ANNOTATIONS } from '../graphql/queries.js';
|
|
4
|
+
import { GET_VIEWER, GET_ORGANIZATIONS, GET_PIPELINES, GET_BUILDS, GET_VIEWER_BUILDS, GET_BUILD_ANNOTATIONS, GET_BUILD_SUMMARY, GET_BUILD_FULL } from '../graphql/queries.js';
|
|
5
5
|
import { logger } from './logger.js';
|
|
6
6
|
/**
|
|
7
7
|
* BuildkiteClient provides methods to interact with the Buildkite GraphQL API
|
|
@@ -516,5 +516,65 @@ export class BuildkiteClient {
|
|
|
516
516
|
}
|
|
517
517
|
return result;
|
|
518
518
|
}
|
|
519
|
+
async getBuildSummary(buildSlug) {
|
|
520
|
+
const variables = {
|
|
521
|
+
slug: buildSlug,
|
|
522
|
+
};
|
|
523
|
+
if (this.debug) {
|
|
524
|
+
logger.debug(`🕒 Starting GraphQL query: GetBuildSummary for ${buildSlug}`);
|
|
525
|
+
}
|
|
526
|
+
// Check if result is in cache
|
|
527
|
+
if (this.cacheManager) {
|
|
528
|
+
const cachedResult = await this.cacheManager.get('GET_BUILD_SUMMARY', variables);
|
|
529
|
+
if (cachedResult) {
|
|
530
|
+
if (this.debug) {
|
|
531
|
+
logger.debug(`✅ Served from cache: GetBuildSummary`);
|
|
532
|
+
}
|
|
533
|
+
return cachedResult;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
const startTime = process.hrtime.bigint();
|
|
537
|
+
const result = await this.client.request(GET_BUILD_SUMMARY.toString(), variables);
|
|
538
|
+
// Store result in cache if caching is enabled
|
|
539
|
+
if (this.cacheManager) {
|
|
540
|
+
await this.cacheManager.set('GET_BUILD_SUMMARY', result, variables);
|
|
541
|
+
}
|
|
542
|
+
const endTime = process.hrtime.bigint();
|
|
543
|
+
const duration = Number(endTime - startTime) / 1000000; // Convert to milliseconds
|
|
544
|
+
if (this.debug) {
|
|
545
|
+
logger.debug(`✅ GraphQL query completed: GetBuildSummary (${duration.toFixed(2)}ms)`);
|
|
546
|
+
}
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
549
|
+
async getBuildFull(buildSlug) {
|
|
550
|
+
const variables = {
|
|
551
|
+
slug: buildSlug,
|
|
552
|
+
};
|
|
553
|
+
if (this.debug) {
|
|
554
|
+
logger.debug(`🕒 Starting GraphQL query: GetBuildFull for ${buildSlug}`);
|
|
555
|
+
}
|
|
556
|
+
// Check if result is in cache
|
|
557
|
+
if (this.cacheManager) {
|
|
558
|
+
const cachedResult = await this.cacheManager.get('GET_BUILD_FULL', variables);
|
|
559
|
+
if (cachedResult) {
|
|
560
|
+
if (this.debug) {
|
|
561
|
+
logger.debug(`✅ Served from cache: GetBuildFull`);
|
|
562
|
+
}
|
|
563
|
+
return cachedResult;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const startTime = process.hrtime.bigint();
|
|
567
|
+
const result = await this.client.request(GET_BUILD_FULL.toString(), variables);
|
|
568
|
+
// Store result in cache if caching is enabled
|
|
569
|
+
if (this.cacheManager) {
|
|
570
|
+
await this.cacheManager.set('GET_BUILD_FULL', result, variables);
|
|
571
|
+
}
|
|
572
|
+
const endTime = process.hrtime.bigint();
|
|
573
|
+
const duration = Number(endTime - startTime) / 1000000; // Convert to milliseconds
|
|
574
|
+
if (this.debug) {
|
|
575
|
+
logger.debug(`✅ GraphQL query completed: GetBuildFull (${duration.toFixed(2)}ms)`);
|
|
576
|
+
}
|
|
577
|
+
return result;
|
|
578
|
+
}
|
|
519
579
|
}
|
|
520
580
|
//# sourceMappingURL=BuildkiteClient.js.map
|