feat(tvix/build): add BuildRequest validation
Change-Id: I8182e4c4a7e5694c1e6f1f56ce092751c22adf4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/10538 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
c9c95f4ef3
commit
986e9b73c3
5 changed files with 458 additions and 168 deletions
|
|
@ -141,7 +141,7 @@ where
|
|||
provide_bin_sh: true,
|
||||
});
|
||||
|
||||
Ok(BuildRequest {
|
||||
let build_request = BuildRequest {
|
||||
command_args,
|
||||
outputs: output_paths,
|
||||
|
||||
|
|
@ -161,7 +161,15 @@ where
|
|||
.into_iter()
|
||||
.map(|(path, contents)| AdditionalFile { path, contents }),
|
||||
),
|
||||
})
|
||||
};
|
||||
|
||||
debug_assert!(
|
||||
build_request.validate().is_ok(),
|
||||
"invalid BuildRequest: {}",
|
||||
build_request.validate().unwrap_err()
|
||||
);
|
||||
|
||||
Ok(build_request)
|
||||
}
|
||||
|
||||
/// handle passAsFile, if set.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue