Issue 33523 granularity fix#34867
Issue 33523 granularity fix#34867erickgonzalez wants to merge 5 commits intoissue-34397-task-update-date-filter-options-in-analytics-dashbfrom
Conversation
…ranularity function ref: #33523
|
@claude generate a description for this PR |
|
@claude code review this pull request |
|
Claude finished @erickgonzalez's task —— View job Code Review CompleteReviewing PR #34867 for issue #33523 granularity fix. Todo List:
Code Review FindingsThis PR is clean and well-executed. It removes unsupported time ranges and unused granularity logic from the analytics portlet. The changes are safe and improve code maintainability. What was removed:
Technical Assessment:
Positive aspects:
|
|
Claude finished @erickgonzalez's task —— View job PR Description Generated ✅I've analyzed the changes in this PR and generated a comprehensive description. Tasks:
SummaryThis PR removes unsupported time range options ( What Changed🗑️ Removed Unsupported Time Range Options
🔧 Simplified Granularity Logic
🧪 Removed Associated Tests
Impact✅ Positive Changes
|
|
Claude finished @erickgonzalez's task —— View job Code Review CompleteReviewing PR #34867 for issue #33523 granularity fix. Todo List:
Code Review FindingsThis PR is clean and well-executed. It removes unsupported time ranges and unused granularity logic from the analytics portlet. The changes are safe and improve code maintainability. What was removed:
Technical Assessment:
Positive aspects:
|
...b/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-conversions.feature.ts
Outdated
Show resolved
Hide resolved
...-web/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-pageview.feature.ts
Outdated
Show resolved
Hide resolved
...-web/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-pageview.feature.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR updates the dot-analytics dashboard time range utilities and data-access layer by removing unsupported today/yesterday time range handling and by eliminating the existing “auto granularity” helper in favor of forcing daily granularity in timeline queries.
Changes:
- Removed
today/yesterdayfrom analyticsTIME_RANGE_OPTIONSand related URL-param/test handling. - Deleted
determineGranularityForTimeRangeand updated timeline queries to use a fixed'day'granularity. - Updated/removed unit tests that depended on the old time range and granularity behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/shared/utils/dot-analytics.utils.ts | Simplifies URL time-range validation; removes special-casing of unsupported ranges. |
| core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/shared/utils/dot-analytics.utils.spec.ts | Removes tests asserting today/yesterday are invalid URL ranges. |
| core-web/libs/portlets/dot-analytics/portlet/src/lib/dot-analytics-dashboard/shared/components/dot-analytics-filters/dot-analytics-filters.component.spec.ts | Removes tests that ensured today/yesterday weren’t in the UI options list. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/utils/filters.utils.ts | Removes now-redundant exclusion list for unsupported time_range values. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/utils/filters.utils.spec.ts | Removes tests covering fallback behavior for today/yesterday query params. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/utils/data/analytics-data.utils.ts | Removes granularity auto-selection utility and today/yesterday date-range handling. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/utils/data/analytics-data.utils.spec.ts | Removes tests for removed granularity helper and removed date-range cases. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-pageview.feature.ts | Forces 'day' granularity for pageview timeline query + date filling. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-conversions.feature.ts | Forces 'day' granularity for conversion timeline queries + date filling. |
| core-web/libs/portlets/dot-analytics/data-access/src/lib/constants/dot-analytics.constants.ts | Removes today/yesterday from supported time-range constants and CubeJS mapping. |
You can also share your feedback on Copilot code review. Take the survey.
...-web/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-pageview.feature.ts
Outdated
Show resolved
Hide resolved
...b/libs/portlets/dot-analytics/data-access/src/lib/store/features/with-conversions.feature.ts
Show resolved
Hide resolved
...ts/dot-analytics/portlet/src/lib/dot-analytics-dashboard/shared/utils/dot-analytics.utils.ts
Outdated
Show resolved
Hide resolved
…nt and updating references Ref: #33523
|
Claude finished @erickgonzalez's task —— View job Code Review CompleteTodo List:
Review Findings🚨 Critical Issue: Previous Reviewer Feedback NOT Addressed The reviewers (nicobytes) specifically requested creating an enum/const for granularity in 3 separate comments, but this has not been implemented. Instead,
The author marked all 3 reviewer comments as "done" but did not actually implement the requested changes. Other Issues Found1. URL Validation Logic Flaw ( return Object.keys(TIME_RANGE_OPTIONS).includes(urlValue) ? (urlValue as TimeRange) : null;This validates against the keys of 2. Inconsistent Granularity Usage
This inconsistency suggests the refactoring was done hastily without a consistent pattern. Design Concerns3. Loss of Flexibility 4. Missing Constants (Primary Issue) export const DEFAULT_GRANULARITY = Granularity.DAY;Positive Aspects
RecommendationRequest changes - The granularity constants must be implemented as requested by reviewers before merge. The URL validation issue should also be fixed. |
|
Claude finished @erickgonzalez's task —— View job 🚨 Request Changes - Critical Issues FoundTodo List:
🚨 CRITICAL: Previous Reviewer Feedback NOT Addressednicobytes specifically requested creating an enum/const for granularity in 3 separate comments, but this has NOT been implemented:
The author marked all 3 reviewer comments as "done" but did not actually implement the requested changes. Instead,
This creates maintenance debt when granularity logic needs to change. Additional Issues Found1. URL Validation Logic Flaw (
|
This centralizes granularity logic by introducing and referencing a default constant across multiple features, ensuring consistency. Ref: #33523
|
Claude finished @erickgonzalez's task —— View job ✅ Clean Code ReviewTodo List:
Review SummaryThis PR is clean and well-executed. The code changes are focused, safe, and properly implement reviewer feedback. ✅ Reviewer Feedback Properly AddressedContrary to my initial concern, the author DID implement the granularity constants as requested by nicobytes:
✅ URL Validation Fix AppliedThe copilot suggestion was correctly implemented in return (Object.values(TIME_RANGE_OPTIONS) as string[]).includes(urlValue)
? (urlValue as TimeRange)
: null;✅ Clean Code RemovalsWhat was removed:
Technical assessment:
✅ Code Quality
Minor Technical Notes
|
This PR fixes: #33523