diff --git a/src/pages/BuildProgress.tsx b/src/pages/BuildProgress.tsx index d9014a7..1a862d1 100644 --- a/src/pages/BuildProgress.tsx +++ b/src/pages/BuildProgress.tsx @@ -1,6 +1,13 @@ import { useMutation, useQuery } from 'convex/react' import { pick } from 'convex-helpers' -import { ArrowLeft, CheckCircle, Loader2, Share2, XCircle } from 'lucide-react' +import { + AlertCircle, + ArrowLeft, + CheckCircle, + Loader2, + Share2, + XCircle, +} from 'lucide-react' import { useState } from 'react' import { Link, useParams } from 'react-router-dom' import { toast } from 'sonner' @@ -146,6 +153,53 @@ export default function BuildProgress() { } } + // Compute build flags from config (same logic as computeFlagsFromConfig in convex/builds.ts) + const computeFlagsFromConfig = (config: typeof build.config): string => { + return Object.keys(config.modulesExcluded) + .sort() + .filter((module) => config.modulesExcluded[module]) + .map((moduleExcludedName: string) => `-D${moduleExcludedName}=1`) + .join(' ') + } + + // Generate GitHub issue URL with prefilled body + const generateIssueUrl = (): string => { + const flags = computeFlagsFromConfig(build.config) + const plugins = build.config.pluginsEnabled?.join(', ') || '(none)' + const timestamp = new Date(build.startedAt).toISOString() + const githubRunLink = githubActionUrl + ? `[View run](${githubActionUrl})` + : '(not available)' + + const issueTitle = `Build ${build.status === 'failure' ? 'Failed' : 'Issue'}: ${targetLabel} (${build.buildHash.substring(0, 8)})` + + const issueBody = `## Build ${build.status === 'failure' ? 'Failed' : 'Information'} + +**Build Hash**: \`${build.buildHash}\` +**Target Board**: ${build.config.target} +**Firmware Version**: ${build.config.version} +**Build Flags**: ${flags || '(none)'} +**Plugins**: ${plugins} +**Build Timestamp**: ${timestamp} + +**GitHub Run**: ${githubRunLink} + +## Additional Information +(Please add any additional details about the issue here)` + + const baseUrl = 'https://github.com/MeshEnvy/mesh-forge/issues/new' + const params = new URLSearchParams({ + title: issueTitle, + body: issueBody, + }) + + return `${baseUrl}?${params.toString()}` + } + + const handleReportIssue = () => { + window.open(generateIssueUrl(), '_blank', 'noopener,noreferrer') + } + return (
@@ -190,13 +244,23 @@ export default function BuildProgress() {
- +
+ + +
{status !== 'success' && status !== 'failure' && (