project Websites / Gitlab Issue Listing Script avatar

websites/Gitlab-Issue-Listing-Script#54: Label Timeline omits issues in final month



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.5
Created: 27-Aug-22 14:52



Description

Found whilst testing v0.5-rc0

When we iterate over dates for the timeline, the final month is omitted.

In some cases, this leads to quite a weird timeline where you have an issue a month or two from the top, and then months and months and months of emptiness before the page stops scrolling.



Toggle State Changes

Activity


assigned to @btasker

Interestingly, I don't think it's that simple.

In the GILS project, the earliest issue with label Improvement is on 11 October (Issue relations).

That shows up in the timeline.

The testing I was doing is against a non-public project.

The label I was looking at has 3 issues

  • 23 Sep 21
  • 26 Sep 21
  • 06 Apr 22

The timeline shows the 06 Apr one, but not the others (the line ends at the beginning of October).

I think the key thing here is the day in the date, because we do

$begin = new DateTime($issues['start']);
$end = new DateTime($issues['end']);
....

$date = $end;
while($date >= $begin){

As we get down the end, we're testing if 06 Oct 21 is >= 23 Sep 21 (it is) and then if 06 Sep 21 >= 23 Sep 21 (it is not).

We probably just need to pad an additional date onto the end to account for that.

$begin->sub($dateinterval);
verified

mentioned in commit 25cfc05b736101968a24058d7bcbced80d90946f

Commit: 25cfc05b736101968a24058d7bcbced80d90946f 
Author: B Tasker                            
                            
Date: 2022-08-27T16:00:23.000+01:00 

Message

Fix bug found in timeline whilst testing (websites/Gitlab-Issue-Listing-Script#54)

If the most recent issue falls on a day-of-the-month numbered lower than the earliest does, the final month would be omitted from the timeline.

This change pads a final month onto the end of the timeline to mitigate that

+1 -0 (1 lines changed)