You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(telemetry): Push once per day instead once per hour - #8942
Draft PRs are not automatically reviewed by default.
Trigger a manual review
To automatically review draft PRs, update your CodeRabbit configuration:
reviews:
auto_review:
drafts: true
Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The usage reporting task now runs every 24 hours. The mapper accepts explicit window boundaries and uses them for usage queries and snapshot timestamps. Reporting state records each organisation’s last successfully pushed window. Snapshot submission retries selected HTTP responses and updates that state after a successful push. Tests and the event catalogue reflect these changes.
Daily reporting now advances per-organisation state, and a repeat run in the same hour no longer sends an empty snapshot. A small number of organisations may have some usage reported twice at the first daily run after deployment. The author has accepted this edge case, so it is a bounded risk to be aware of.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Major · Update the expected snapshot timestamp to the 24-hour window start. · test_mappers.py:55-80
api/tests/unit/organisations/usage_reporting/test_mappers.py:55-80 Major · Functional Correctness · Quick win
Update the expected snapshot timestamp to the 24-hour window start.
The mapper now sets timestamp to hour_start, which is 24 hours before the current hour. Under the frozen time 2026-06-18T09:30:00+00:00, that is 2026-06-17 09:00 UTC. Both test_map_organisation_to_usage_snapshot__with_usage__returns_populated_snapshot and test_map_organisation_to_usage_snapshot__no_analytics__returns_zeroed_snapshot still expect 2026-06-18 08:00 UTC. Each full UsageSnapshot comparison fails on timestamp, so the test suite fails at head.
The window bounds are not asserted in this file. Update the timestamp in both tests:
Apply the same change in the zeroed-snapshot test.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: ASSERTIVE
Plan: Advanced
Run ID: baba5d1d-c915-4b72-b722-0c4ead45f7a3
Commits
Reviewing files that changed from the base of the PR and between d9c857a and 6354af3.
Files selected for processing: 2
api/organisations/tasks.py
api/organisations/usage_reporting/mappers.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.92%. Comparing base (e9acd24) to head (dfdbaab). ⚠️ Report is 7 commits behind head on main.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
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
apiIssue related to the REST APIfeatureNew feature or request
2 participants
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.
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Switch telemetry reporting from once per hour to once per day.
Contributes to ENG-652
How did you test this code?
Tests pass