This repository has been archived on 2025-10-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gitwarrior/cmd/gitw/main.go
Yves Biener a206c82061 add(gitea-api): individual issue and milestone getter
This implements the api getters for extracting a single issue and single
milestone for a given gitea repository and id. WIP for #1.
2023-10-18 17:20:48 +02:00

38 lines
1.1 KiB
Go

package main
import (
"fmt"
"os"
"gitea.yves-biener.de/yves-biener/gitwarrior/internal/gitea"
)
func main() {
repository := gitea.NewRepository("gitwarrior", "yves-biener")
server := gitea.NewGitea("https://gitea.yves-biener.de")
issue, err := server.GetIssue(repository, 1)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(-1)
}
milestone, err := server.GetMilestone(repository, 1)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(-1)
}
fmt.Printf("%#v\n", issue)
fmt.Println("---")
fmt.Printf("%#v\n", milestone)
// necessary configurations (see config file gitw.json)
// - access code for gitea
// - configuration for taskwarrior settings?
// cli actions and parameters
// - action: diff (i.e. what has changed between the current state of the taskwarrior tasks and the git issues / milestones)
// - action: status (are there changes between the taskwarrior tasks and the gitea issues / milestones, that would require a sync)
// - action: sync (synch diffs between taskwarrior tasks and gitea issues / milestones)
// - parameter: --dry-run (do only show changes that would be applied but do not apply them)
}