Issues in forgejo can also depend on issues from other repositories. Ignore such external dependencies when building the techtree.
This commit is contained in:
parent
1451b42912
commit
c8b848d89b
1 changed files with 15 additions and 0 deletions
|
|
@ -68,6 +68,21 @@ pub async fn collect_tree(ctx: &crate::Context) -> anyhow::Result<crate::tree::T
|
|||
.with_context(|| format!("Failed to fetch issue dependencies for #{issue}",))?;
|
||||
|
||||
for dep in dependencies {
|
||||
// Check that the dependency is actually an issue in the techtree and not external
|
||||
let dep_repo = dep
|
||||
.repository
|
||||
.context("Dependency issue without repository info")?;
|
||||
if dep_repo.owner.as_ref() != Some(&ctx.owner)
|
||||
|| dep_repo.name.as_ref() != Some(&ctx.repo)
|
||||
{
|
||||
log::warn!(
|
||||
"Issue #{issue} depends on external {}#{}, ignoring.",
|
||||
dep_repo.full_name.as_deref().unwrap_or("unknown?"),
|
||||
dep.number.unwrap_or(9999)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
let dep_number = dep.number.context("Missing issue number in dependency")?;
|
||||
if !tree.find_element_by_issue_number(dep_number).is_some() {
|
||||
log::warn!("Found dependency from #{issue} on non-tracked issue #{dep_number}!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue