add(taskwarrior): pull implementation for new tasks

This implements the pull functionality for new tasks, which are not yet
in the local taskwarrior instance created. WIP for #3.
This commit is contained in:
2023-10-21 12:43:41 +02:00
parent 3ed3c53854
commit ba9683f290
5 changed files with 113 additions and 14 deletions

View File

@@ -6,6 +6,8 @@ import (
"fmt"
"net/http"
"time"
"gitea.yves-biener.de/yves-biener/gitwarrior/internal/taskwarrior"
)
type Milestone struct {
@@ -21,6 +23,11 @@ type Milestone struct {
Closed_at time.Time `json:"closed_at"`
}
// TODO: implement merge for milestone tasks
func (milestone *Milestone) Merge(task taskwarrior.Task) taskwarrior.Task {
return task
}
func (gitea *Gitea) GetMilestones(repo Repository) ([]Milestone, error) {
url := fmt.Sprintf("%s/repos/%s/milestones?state=all", gitea.Url(), repo.Full_name)
response, err := http.Get(url)