From a9bc03fb01b5d1ac41bf5592f384d22df5425aa4 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Sun, 6 Sep 2026 09:02:31 +1000 Subject: feat: vcs and secret management support --- src/marlin.web/Controllers/JobsController.cs | 31 ++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/marlin.web/Controllers/JobsController.cs') diff --git a/src/marlin.web/Controllers/JobsController.cs b/src/marlin.web/Controllers/JobsController.cs index 1cfdadb..c86cb2d 100644 --- a/src/marlin.web/Controllers/JobsController.cs +++ b/src/marlin.web/Controllers/JobsController.cs @@ -30,10 +30,23 @@ public class JobsController(ApplicationDbContext dbContext) : Controller return this.View(results); } + public record JobSpawnDetails( + ICollection Sources, + Guid? Vcs = null, + string? Ref = null, + string? Commit = null, + string? Recipe = null); + [HttpGet("spawn")] - public async Task Spawn() + public async Task Spawn(CancellationToken ct) { - return this.View(); + var sources = await dbContext.Sources + .Include(x => x.Branches) + .ThenInclude(x => x.Commit) + .ToListAsync(ct); + + var details = new JobSpawnDetails(sources); + return this.View(details); } public record JobSpawnRequest(Guid Vcs, string Ref, string Commit, string Recipe); @@ -62,4 +75,18 @@ public class JobsController(ApplicationDbContext dbContext) : Controller // cancel job // details job (recipe, status, agent, target, plan, log, artifacts) + [HttpGet("details/{id}")] + public async Task Details(Guid id) + { + var job = await dbContext.Jobs + .Include(x => x.Agent) + .Include(x => x.Source) + .Include(x => x.StatusUpdates) + .FirstOrDefaultAsync(x => x.Id == id); + + if (job == null) + return this.NotFound(); + + return this.View(job); + } } \ No newline at end of file -- cgit v1.3.1