From cf17934d9c86a579143c3583a638717992f05516 Mon Sep 17 00:00:00 2001 From: Cory Forsstrom Date: Fri, 15 Nov 2024 15:17:24 -0800 Subject: [PATCH] Pass profile remotes to build job --- source/summit/build/queue.d | 4 +++- source/summit/fixtures.d | 7 +++++++ source/summit/models/profile.d | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/summit/build/queue.d b/source/summit/build/queue.d index 4a51f27..dcebdda 100644 --- a/source/summit/build/queue.d +++ b/source/summit/build/queue.d @@ -452,7 +452,9 @@ private: auto mProject = projectManager.bySlug(project.slug); auto mRepo = mProject.bySlug(repo.name); auto entry = mRepo.db.byID(task.pkgID); - return JobMapper(entry, task, [profile.volatileIndexURI], profile.volatileIndexURI); + + return JobMapper(entry, task, + profile.remotes ~ [profile.volatileIndexURI], profile.volatileIndexURI); } /** diff --git a/source/summit/fixtures.d b/source/summit/fixtures.d index 039beca..d2c6eef 100644 --- a/source/summit/fixtures.d +++ b/source/summit/fixtures.d @@ -17,6 +17,9 @@ module summit.fixtures; import moss.service.context; import std.path : buildPath; +import std.algorithm.sorting : sort; +import std.algorithm.iteration : map; +import std.array : array; import summit.models; import summit.projects; import vibe.core.file : readFileUTF8; @@ -113,6 +116,10 @@ static void loadFixtures(ServiceContext context, ProjectManager projectManager) p.name = profile.name; p.arch = profile.arch; p.volatileIndexURI = profile.indexURI; + p.remotes = profile.remotes + .sort!((a, b) => a.priority < b.priority) + .map!(a => a.uri) + .array; immutable err = project.addProfile(p); enforceHTTP(err.isNull, HTTPStatus.internalServerError, err.message); } diff --git a/source/summit/models/profile.d b/source/summit/models/profile.d index ad05690..2f9a753 100644 --- a/source/summit/models/profile.d +++ b/source/summit/models/profile.d @@ -54,4 +54,6 @@ public @Model struct Profile * What project does this belong to? */ ProjectID projectID; + + string[] remotes; }