mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
fix: handle empty dates in pagure milestone migration (#10169)
Don't panic during pagure migration if a milestone has no date. Fixes https://forge.fedoraproject.org/forge/forge/issues/281 ### Manual testing Here's how to confirm that the change is working. Simply migrate a repository having milestones with deadlines from Pagure over to Forgejo to test. At the source namespace, https://pagure.io/protop2g-test-srce/roadmap This change assumes that the milestone's deadline is stored in Pagure in Unix time format (the default). At the destination namespace, check that the due date is correct. Signed-off-by: Akashdeep Dhar <akashdeep.dhar@gmail.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10169 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Akashdeep Dhar <akashdeep.dhar@gmail.com> Co-committed-by: Akashdeep Dhar <akashdeep.dhar@gmail.com>
This commit is contained in:
parent
ba778097ee
commit
c4c2b8c1fb
1 changed files with 6 additions and 2 deletions
|
|
@ -334,11 +334,15 @@ func (d *PagureDownloader) GetMilestones() ([]*base.Milestone, error) {
|
|||
state = "open"
|
||||
}
|
||||
|
||||
deadline := processDate(details.Date)
|
||||
var deadline *time.Time
|
||||
if details.Date != nil && *details.Date != "" {
|
||||
parsedDeadline := processDate(details.Date)
|
||||
deadline = &parsedDeadline
|
||||
}
|
||||
milestones = append(milestones, &base.Milestone{
|
||||
Title: name,
|
||||
Description: "",
|
||||
Deadline: &deadline,
|
||||
Deadline: deadline,
|
||||
State: state,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue