Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Requirements Manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Utilities
Requirements Manager
Commits
b44f194f
Verified
Commit
b44f194f
authored
2 years ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
chore: commit save point
parent
9575ffb6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
application/source/gitlab.go
+5
-5
5 additions, 5 deletions
application/source/gitlab.go
application/source/issues.go
+8
-8
8 additions, 8 deletions
application/source/issues.go
development/examples/example1/req1/1/test1.md
+3
-0
3 additions, 0 deletions
development/examples/example1/req1/1/test1.md
with
16 additions
and
13 deletions
application/source/gitlab.go
+
5
−
5
View file @
b44f194f
...
...
@@ -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
,
respo
n
se
,
err
:=
context
.
client
.
Issues
.
CreateIssue
(
context
.
project
.
ID
,
ptr
)
if
respose
.
StatusCode
==
401
{
if
respo
n
se
.
StatusCode
==
401
{
return
gitlabIssue
,
err
}
if
respose
.
StatusCode
>
299
{
if
respo
n
se
.
StatusCode
>
299
{
return
gitlabIssue
,
err
}
...
...
This diff is collapsed.
Click to expand it.
application/source/issues.go
+
8
−
8
View file @
b44f194f
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
development/examples/example1/req1/1/test1.md
+
3
−
0
View file @
b44f194f
...
...
@@ -45,6 +45,9 @@ Issues:
-
Gitlab:
Title: Test 1
Status: offen
Description: Lorem Ipsum
Lila Rot Blau1
Lila Rot Blau2
Labels:
-
a
-
b
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment