feat(tracker-web): hardcoded repo dropdown for PR-mode jobs (base=main)
MVP: the New Job form picks a PR target from a fixed dropdown of local repos; base branch is fixed to main. Empty selection = no PR (plain job). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
d350159025
commit
2adddce754
@ -21,6 +21,28 @@ const STAGES = [
|
|||||||
];
|
];
|
||||||
const POLL_INTERVAL = 30_000;
|
const POLL_INTERVAL = 30_000;
|
||||||
|
|
||||||
|
// MVP: PR-mode target repos (local checkouts under the factory's repo base).
|
||||||
|
// Base branch is fixed to `main`. Empty selection = no PR (plain job).
|
||||||
|
const FLEET_REPOS = [
|
||||||
|
'learning_ai_common_plat',
|
||||||
|
'learning_ai_devops_tools',
|
||||||
|
'learning_voice_ai_agent',
|
||||||
|
'learning_multimodal_memory_agents',
|
||||||
|
'learning_ai_clock',
|
||||||
|
'learning_ai_jarvis_jr',
|
||||||
|
'learning_ai_fastgap',
|
||||||
|
'learning_ai_peakpulse',
|
||||||
|
'learning_ai_flowmonk',
|
||||||
|
'learning_ai_notes',
|
||||||
|
'learning_ai_trails',
|
||||||
|
'learning_ai_efforise',
|
||||||
|
'learning_ai_local_memory_gpt',
|
||||||
|
'learning_ai_2nd_brain',
|
||||||
|
'learning_ai_auth_app',
|
||||||
|
'learning_agent_monitoring_fx',
|
||||||
|
];
|
||||||
|
const FLEET_BASE_BRANCH = 'main';
|
||||||
|
|
||||||
export default function FleetJobsPage() {
|
export default function FleetJobsPage() {
|
||||||
const { token } = useAuth();
|
const { token } = useAuth();
|
||||||
const [jobs, setJobs] = useState<FleetJob[]>([]);
|
const [jobs, setJobs] = useState<FleetJob[]>([]);
|
||||||
@ -33,7 +55,6 @@ export default function FleetJobsPage() {
|
|||||||
const [priority, setPriority] = useState<'critical' | 'high' | 'medium' | 'low'>('high');
|
const [priority, setPriority] = useState<'critical' | 'high' | 'medium' | 'low'>('high');
|
||||||
const [caps, setCaps] = useState('build');
|
const [caps, setCaps] = useState('build');
|
||||||
const [repo, setRepo] = useState('');
|
const [repo, setRepo] = useState('');
|
||||||
const [baseBranch, setBaseBranch] = useState('main');
|
|
||||||
const [submitting, setSubmitting] = useState(false);
|
const [submitting, setSubmitting] = useState(false);
|
||||||
const [submitMsg, setSubmitMsg] = useState<{ ok: boolean; text: string } | null>(null);
|
const [submitMsg, setSubmitMsg] = useState<{ ok: boolean; text: string } | null>(null);
|
||||||
|
|
||||||
@ -74,7 +95,7 @@ export default function FleetJobsPage() {
|
|||||||
bodyMd: body.trim(),
|
bodyMd: body.trim(),
|
||||||
priority,
|
priority,
|
||||||
capabilities,
|
capabilities,
|
||||||
...(repo.trim() ? { repo: repo.trim(), baseBranch: baseBranch.trim() || 'main' } : {}),
|
...(repo ? { repo, baseBranch: FLEET_BASE_BRANCH } : {}),
|
||||||
});
|
});
|
||||||
setSubmitMsg({ ok: true, text: `Submitted ${job.id} (stage: ${job.stage}).` });
|
setSubmitMsg({ ok: true, text: `Submitted ${job.id} (stage: ${job.stage}).` });
|
||||||
setBody('');
|
setBody('');
|
||||||
@ -85,7 +106,7 @@ export default function FleetJobsPage() {
|
|||||||
} finally {
|
} finally {
|
||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
}
|
}
|
||||||
}, [body, caps, priority, repo, baseBranch, refresh]);
|
}, [body, caps, priority, repo, refresh]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-6 space-y-6">
|
<div className="p-6 space-y-6">
|
||||||
@ -149,29 +170,27 @@ export default function FleetJobsPage() {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="job-repo" className="mb-1 block text-sm font-medium">
|
<label htmlFor="job-repo" className="mb-1 block text-sm font-medium">
|
||||||
Repo (optional, PR mode)
|
Repo (optional — opens a PR)
|
||||||
</label>
|
</label>
|
||||||
<input
|
<select
|
||||||
id="job-repo"
|
id="job-repo"
|
||||||
value={repo}
|
value={repo}
|
||||||
onChange={e => setRepo(e.target.value)}
|
onChange={e => setRepo(e.target.value)}
|
||||||
placeholder="owner/name"
|
|
||||||
className="rounded border bg-background px-2 py-1 text-sm font-mono"
|
className="rounded border bg-background px-2 py-1 text-sm font-mono"
|
||||||
/>
|
>
|
||||||
|
<option value="">— none (no PR) —</option>
|
||||||
|
{FLEET_REPOS.map(r => (
|
||||||
|
<option key={r} value={r}>
|
||||||
|
{r}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
{repo && (
|
||||||
|
<p className="mt-1 text-xs text-muted-foreground">
|
||||||
|
PR against <span className="font-mono">{FLEET_BASE_BRANCH}</span>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{repo.trim() && (
|
|
||||||
<div>
|
|
||||||
<label htmlFor="job-base" className="mb-1 block text-sm font-medium">
|
|
||||||
Base branch
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
id="job-base"
|
|
||||||
value={baseBranch}
|
|
||||||
onChange={e => setBaseBranch(e.target.value)}
|
|
||||||
className="rounded border bg-background px-2 py-1 text-sm font-mono"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<Button onClick={handleSubmit} disabled={submitting} aria-label="Submit new job">
|
<Button onClick={handleSubmit} disabled={submitting} aria-label="Submit new job">
|
||||||
{submitting ? 'Submitting…' : 'Submit Job'}
|
{submitting ? 'Submitting…' : 'Submit Job'}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user