Skip to content

Commit

Permalink
fix: fix ENVREQ name and update abbs before getting environment requi…
Browse files Browse the repository at this point in the history
…rement
  • Loading branch information
jiegec committed Mar 21, 2024
1 parent 5cd696a commit 087c250
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions buildit-utils/src/github.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,8 @@ pub fn get_environment_requirement(
for arch in ALL_ARCH {
let res_arch: &mut EnvironmentRequirement = res.entry(*arch).or_default();
if let Some(env_req) = spec
.get(&format!("ENV_REQ__{arch}"))
.or_else(|| spec.get("ENV_REQ"))
.get(&format!("ENVREQ__{arch}"))
.or_else(|| spec.get("ENVREQ"))
{
for req in env_req.split(" ") {
if let Some((key, value)) = req.split_once("=") {
Expand Down
26 changes: 17 additions & 9 deletions server/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,23 @@ pub async fn pipeline_new(
};

// find environment requirements
let resolved_pkgs = resolve_packages(
&packages
.split(",")
.map(|s| s.to_string())
.collect::<Vec<String>>(),
&ARGS.abbs_path,
)
.context("Resolve packages")?;
let env_req = get_environment_requirement(&ARGS.abbs_path, &resolved_pkgs);
let env_req = {
let resolved_pkgs = resolve_packages(
&packages
.split(",")
.map(|s| s.to_string())
.collect::<Vec<String>>(),
&ARGS.abbs_path,
)
.context("Resolve packages")?;

let _lock = ABBS_REPO_LOCK.lock().await;
update_abbs(git_branch, &ARGS.abbs_path)
.await
.context("Failed to update ABBS tree")?;

get_environment_requirement(&ARGS.abbs_path, &resolved_pkgs)
};

// create a new pipeline
let mut conn = pool
Expand Down

0 comments on commit 087c250

Please sign in to comment.