Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVN-GitLab Migration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Stud.IP
Plugins
SVN-GitLab Migration
Commits
69dfa583
Commit
69dfa583
authored
6 years ago
by
Thomas Hackl
Browse files
Options
Downloads
Patches
Plain Diff
close Gitlab issue if Trac ticket was already closed
parent
408072d4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/GitLab.php
+11
-0
11 additions, 0 deletions
src/GitLab.php
src/Migration.php
+5
-3
5 additions, 3 deletions
src/Migration.php
with
16 additions
and
3 deletions
src/GitLab.php
+
11
−
0
View file @
69dfa583
...
...
@@ -86,6 +86,17 @@ class GitLab
return
$issue
;
}
/**
* Closes an issue.
* @param mixed $projectId project ID or path
* @param int $issueId issue to close
* @param string $time time in ISO8601 format
*/
public
function
closeIssue
(
$projectId
,
$issueId
,
$time
)
{
$this
->
client
->
api
(
'issues'
)
->
update
(
$projectId
,
$issueId
,
[
'state_event'
=>
'close'
,
'updated_at'
=>
$time
]);
}
/**
* Creates a new note in the given project and on the given issue id (NOTE: id, not iid). When working in admin mode, tries to create the note
* as the given author (SUDO) and if that fails, tries creating the note again as the admin.
...
...
This diff is collapsed.
Click to expand it.
src/Migration.php
+
5
−
3
View file @
69dfa583
...
...
@@ -128,9 +128,6 @@ class Migration
echo "\tAlso created " . count($ticket[4]) . " note(s)\n";
}*/
// Map old image filenames to new markdown links
$images
=
[];
/*
* Add files attached to Trac ticket to new Gitlab issue.
*/
...
...
@@ -144,6 +141,11 @@ class Migration
echo
"
\t
Attached file "
.
$a
[
'filename'
]
.
" to issue "
.
$issue
[
'iid'
]
.
".
\n
"
;
}
// Close issue if Trac ticket was closed.
if
(
$ticket
[
3
][
'status'
]
===
'closed'
)
{
$this
->
gitLab
->
closeIssue
(
$gitLabProject
,
$issue
[
'iid'
],
$dateUpdated
);
}
}
return
$mapping
;
}
...
...
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