Repository navigation
Fix/285 consistent reports across databases - #302
Merged
Merged
Conversation
New workflow integration.yml: for Nextcloud stable31 and stable35, each on SQLite, MySQL 8.4, MariaDB 11.4 and PostgreSQL 16, it checks out the server, puts the app into apps/timetracker, installs Nextcloud on that database and runs phpunit.integration.xml with the server's own PHPUnit version. MySQL and MariaDB run with ONLY_FULL_GROUP_BY, like Nextcloud's own CI. The integration bootstrap used OC::$loader, which no longer exists; it now loads Test\TestCase through the server's tests/autoload.php. Refs #285 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
Reports grouped by day, week, month or year differed between SQLite, MySQL/MariaDB and PostgreSQL: each database built the time groups with its own date functions, in UTC, and weeks were not ISO weeks around New Year. The report now reads the matching entries with one portable query and groups them in PHP: - time groups follow the user's Nextcloud time zone (fallback: the server's default time zone, then UTC), including daylight saving time - weeks are ISO 8601 weeks, labelled like 2025-W01 (30 Dec 2024 belongs to 2025-W01) - name, project, client and user lists of a group contain distinct values in order of appearance; name lists are shortened to 40 characters + '...' - rows are ordered by their first entry The time zone comes from a new UserTimeZone service. OCP\IDateTimeZone can't be used: during a web request it may be created before login and then always returns the server's default. Integration tests cover time groups (midnight, DST, ISO year boundary), grouping by project/client/user, filters and paging. Fixes #285 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
…eriods getStartOfWeek() combined the ISO week number with the calendar year, so 30 Dec 2024 (week 1 of 2025) was treated as week 1 of 2024, a year too early. Week and month starts were also computed in UTC instead of the user's time zone. Both now match the report grouping. Refs #285 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
With a database user that may create roles, like the root user of the postgres image, Nextcloud's installer connects to the target database before creating it, and fails with 'database "nextcloud" does not exist'. Nextcloud's own CI pre-creates it the same way. Refs #285 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KJpM1wJdw3Uxw5p86uRBD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #285