This repository was archived by the owner on May 22, 2025. It is now read-only.

Description
That's pretty simple to reproduce.
- Create a new issue
- Using a quick-action in a comment, enter:
/spend 1d
- With
gtt output the full data for the created issue, specifying anything else than 8 hours per day. For example,
gtt report [group/project] iid --hours_per_day=7 --time_format [%hours_overall]
The TIME STATS section outputs a total spent and a spent of 8, which is fine.
The ISSUES and TIME RECORDS sections respectively show a spent and a time of 7. Which is NOT consistent with the TIME STATS and with Gitlab.
I tracked down the code, from the regex that extracts added [x] time spent at [y] -
|
let timeString = match ? match[1] : (subMatch ? `-${subMatch[1]}` : `-${Time.toHumanReadable(timeSpent, this.config.get('hoursPerDay'))}`); |
It calls the time constructor which in turn calls the time.parse function passing the this._hoursPerDay as hoursPerDay argument from the config instead of specifying the Gitlab default 8 hours.
|
this.seconds = time.parse(timeString, this._hoursPerDay, this._daysPerWeek, this._weeksPerMonth); |
Gitlab does NOT support anything else than 1d = 8h and saves the issue time tracking stats in seconds. This means that querying the issue in Gitlab actually tells to everyone that there are a total of 28800 seconds spent on the issue - see total_time_spent https://docs.gitlab.com/ee/api/issues.html#get-time-tracking-stats - not 25200 seconds.