diff --git a/application/source/gitlab.go b/application/source/gitlab.go index 3518acc6e6725ac416bd6ddba8dd8449b9caaaa9..ea41623d574013a13002f85f9e051b849a1519f3 100644 --- a/application/source/gitlab.go +++ b/application/source/gitlab.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "net/url" + "path" "gopkg.in/yaml.v3" @@ -193,8 +194,6 @@ func recursiveRemove(nodes *yaml.Node) error { for i := 0; i < len(nodes.Content); i += 2 { - fmt.Println(nodes.Content[i].Value) - if nodes.Content[i].Value == "Issues" { found = i break @@ -265,6 +264,7 @@ func syncIssuesWithGitlab(pageData map[string]*requirement) { printErrorAndExit(2, "Failed to create issue %s", err.Error()) } pageData.Issues[k].GitlabRemote = issue + pageData.Issues[k].GitlabIntern = new(GitlabInternalIssueStruct) pageData.Issues[k].GitlabIntern.ID = issue.IID var change yaml.Node @@ -299,13 +299,13 @@ func createIssue(issue Issue) (*gitlab.Issue, error) { ptr := &createionOptions - gitlabIssue, respose, err := context.client.Issues.CreateIssue(context.project.ID, ptr) + gitlabIssue, response, err := context.client.Issues.CreateIssue(context.project.ID, ptr) - if respose.StatusCode == 401 { + if response.StatusCode == 401 { return gitlabIssue, err } - if respose.StatusCode > 299 { + if response.StatusCode > 299 { return gitlabIssue, err } diff --git a/application/source/issues.go b/application/source/issues.go index 221b3243614181d9b4d866157adac5081dc75fdf..0cb9f5b1eee784b24059e347f2203c75bf3b7728 100644 --- a/application/source/issues.go +++ b/application/source/issues.go @@ -11,14 +11,14 @@ import ( ) type GitlabInternalIssueStruct struct { - ID int `yaml:"ID"` - Title string `yaml:"Title"` - Description string `yaml:"Description"` - Priority string `yaml:"Priority"` - Status string `yaml:"Status"` - Assignee string `yaml:"Assignee"` - Milestone string `yaml:"Milestone"` - Labels []string `yaml:"Labels"` + ID int `yaml:"ID"` + Title string `yaml:"Title,omitempty"` + Description string `yaml:"Description,omitempty"` + //Priority string `yaml:"Priority,omitempty"` + Status string `yaml:"Status,omitempty"` + //Assignee string `yaml:"Assignee,omitempty"` + //Milestone string `yaml:"Milestone,omitempty"` + Labels []string `yaml:"Labels,omitempty"` } type Issue struct { diff --git a/development/examples/example1/req1/1/test1.md b/development/examples/example1/req1/1/test1.md index 035301070a01d62da51a4ae54fde9cbe00c55bc5..1812bde443fc88f8d99b36f69c98ef6afec6c1b4 100644 --- a/development/examples/example1/req1/1/test1.md +++ b/development/examples/example1/req1/1/test1.md @@ -45,6 +45,9 @@ Issues: - Gitlab: Title: Test 1 Status: offen + Description: Lorem Ipsum + Lila Rot Blau1 + Lila Rot Blau2 Labels: - a - b