controller: turn an archetype agent into a custom one
This commit is contained in:
parent
8a7f254c74
commit
0737798d78
1 changed files with 1008 additions and 44 deletions
|
|
@ -418,26 +418,29 @@ async fn render(
|
|||
CONFIG_ORG,
|
||||
&agent.name,
|
||||
Some(CONFIG_BRANCH),
|
||||
&["flake.lock"],
|
||||
&["flake.lock", "flake.nix"],
|
||||
)
|
||||
.await?
|
||||
else {
|
||||
tracing::warn!(agent = %agent.name, "meta flake: its config repo has no commit on {CONFIG_BRANCH}; leaving the agent out");
|
||||
continue;
|
||||
};
|
||||
let lock = head
|
||||
.files
|
||||
.first()
|
||||
.map(|f| String::from_utf8_lossy(&f.bytes).into_owned());
|
||||
let read = |path: &str| {
|
||||
head.files
|
||||
.iter()
|
||||
.find(|f| f.path == path)
|
||||
.map(|f| String::from_utf8_lossy(&f.bytes).into_owned())
|
||||
};
|
||||
let (lock, flake) = (read("flake.lock"), read("flake.nix"));
|
||||
Some(hive_meta_flake::AgentPin {
|
||||
url: hive_meta_flake::pinned_git_url(
|
||||
&settings.git_url(CONFIG_ORG, &agent.name),
|
||||
Some(&head.commit),
|
||||
)?,
|
||||
canonical_inputs: lock
|
||||
.as_deref()
|
||||
.map(hive_meta_flake::canonical_inputs_in_lock)
|
||||
.unwrap_or_default(),
|
||||
canonical_inputs: hive_meta_flake::canonical_inputs_declared(
|
||||
lock.as_deref(),
|
||||
flake.as_deref(),
|
||||
),
|
||||
})
|
||||
};
|
||||
specs.push(hive_meta_flake::AgentSpec {
|
||||
|
|
|
|||
Loading…
Reference in a new issue