stable

Clone or download

Read-only

fix: git read access history does not take into account the access hour

request #35859 git read access history does not take into account the access hour The bug was due to the date format saved in the DB which, the stored format is `Ymd` (YearMonthDay without separator, e.g 20241030). The consequence is when a project admin want to see the git read access history, the time displayed (LocalTime column) is always like `01:00`, `00:00`or `23:00` etc... depending of the timezone. A new column with the timestamp of the last read access of a git repository is created in `plugin_git_log_read_daily`, with that we should not break the place relying on the date legacy format (Ymd). Retrieving the stored git read access date rely on the timestamp of the access and not just the day as before. To limit space taken and limit the time take to parse the gitolite logs (see request #10106) only the last read access of the day is saved in the DB. Note: import_all_giotlite3_logs.php script has been removed because it does not works since several years and it is not used. How to test: - make dev-forgeupgrade - Go in the DB, and look at the `plugin_git_log_read_daily` table => The new column `day_timestamp` is displayed => All the existing date in `day` are converted in to unix timestamp in `day_timestamp` - Go into a git repository - Go to the `Access Logs` page in Project administraion and look at the Git access => The date diplayed in `Date` column is the right day => The time displayed in `LocalTime` column should be the right time of the day - Wait for at least one or two minute (go take a coffee) - Go again into the same git repository as before => The date diplayed in `Date` column is the right day => The time displayed in `LocalTime` column should be updated - The convertion of gitolite full logs to aggregated logs script should still work (convert_gitolite_full_logs.php) Change-Id: I7586541f4358389069c43c518230887b4418abd1

Modified Files

Name
D plugins/git/bin/import_all_giotlite3_logs.php +0 −49 Go to diff View file
M plugins/git/db/install.sql +3 −1 Go to diff View file
A plugins/git/db/mysql/updates/2024/202401241728_add_last_access_timestamp_to_read_access_log_table.php +49 −0 Go to diff View file
M plugins/git/include/Git/Gitolite/Gitolite3LogParser.php +16 −62 Go to diff View file
M plugins/git/include/Git/Gitolite/GitoliteFullLogsToAggregatedLogs.php +2 −2 Go to diff View file
M plugins/git/include/GitLog.class.php +1 −1 Go to diff View file
M plugins/git/include/History/Dao.php +5 −5 Go to diff View file
M plugins/git/include/History/GitPhpAccessLogger.php +3 −4 Go to diff View file
M plugins/git/tests/unit/Git/Gitolite/Gitolite3LogParserTest.php +4 −4 Go to diff View file