check: fetch needs.yaml itself, so portal can drop that loader
Test / test (push) Failing after 8s

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4jrCgLiKKHAEFuZUJjckH
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-22 17:28:38 +02:00
co-authored by Claude Fable 5.1
parent 73906cdf35
commit b093ebf0de
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -57,7 +57,8 @@ pub async fn run(argv: Vec<String>) -> anyhow::Result<()> {
// load_site_from_gitea already validates; a missing file is
// the default config, same as at portal boot.
let site = content::load_site_from_gitea(&repo_url, &branch).await?;
let needs_raw = content::load_needs_from_gitea(&repo_url, &branch).await?;
// Optional: a fetch failure means the repo declares no needs.
let needs_raw = portal::http::get_text(&format!("{}/needs.yaml?ref={branch}", content::gitea_raw_base(&repo_url)?), portal::http::GITEA_CAP).await.ok();
(questions, aggregates_map, site, needs_raw)
} else {
eprintln!(
@@ -108,7 +109,7 @@ pub async fn run(argv: Vec<String>) -> anyhow::Result<()> {
}
}
/// The business-needs pass (see `portal::needs`): structure always,
/// The business-needs pass (see `crate::needs`): structure always,
/// then the wording tasks written out and/or an engine's answers
/// scored, when asked. A repo without `needs.yaml` skips all of it.
fn check_needs(
+1 -1
View File
@@ -82,7 +82,7 @@ fn collect_yaml(
Ok(())
}
/// The offline counterpart to `content::load_needs_from_gitea` -
/// The offline counterpart to `check`'s needs.yaml fetch -
/// `needs.yaml` sits at the repo root beside `aggregates.yaml`.
pub fn load_needs_from_dir(dir: &str) -> anyhow::Result<Option<String>> {
let needs_path = std::path::Path::new(dir)