diff --git a/README.md b/README.md index 45153fe..060fcc0 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ The status of each element is determined as follows: - **MISSING** when the element has not yet been achieved. - **ASSIGNED** when the issue has been assigned to someone. This means we are making progress! -- **COMPLETED** when the issue gets closed. Achievement unlocked! +- **COMPLETED** when the issue is labelled `Completed`. Achievement unlocked! #### Important notes There are a few gotchas that you should be aware of: @@ -136,10 +136,5 @@ There are a few gotchas that you should be aware of: unfortunately. You can force a trigger by editing the issue body or quickly adding and then removing the `Stale` label. -- You cannot add dependencies on closed issues via the Forgejo interface. To - model such dependencies, temporarily reopen the dependency issue and close it - again after adding the relationship. - - Issues that should no longer be a part of the techtree should either be - deleted (looses all tracking) or they can be made inert by removing the - `Type/###` label. + deleted (looses all tracking) or they can be made inert by closing them. diff --git a/techtree-manager/src/collect.rs b/techtree-manager/src/collect.rs index 79b23af..8fa3654 100644 --- a/techtree-manager/src/collect.rs +++ b/techtree-manager/src/collect.rs @@ -77,10 +77,12 @@ fn element_from_issue(issue: &forgejo_api::structs::Issue) -> anyhow::Result = issue + let labels = issue .labels .as_ref() - .context("Issue does not have any labels")? + .context("Issue does not have any labels")?; + + let ty_labels: Vec<_> = labels .iter() .filter_map(|l| l.name.as_deref()) .filter(|l| l.starts_with("Type/")) @@ -100,9 +102,15 @@ fn element_from_issue(issue: &forgejo_api::structs::Issue) -> anyhow::Result { - if issue.assignee.is_some() + if has_completed_label { + crate::tree::ElementStatus::Completed + } else if issue.assignee.is_some() || issue .assignees .as_ref() @@ -114,7 +122,7 @@ fn element_from_issue(issue: &forgejo_api::structs::Issue) -> anyhow::Result crate::tree::ElementStatus::Completed, + forgejo_api::structs::StateType::Closed => anyhow::bail!("Ignoring closed issue!"), }; Ok(crate::tree::Element {