Skip to content

Add preset aggregation interval API inspired by shinyorg/Health#51

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/research-shinyorg-health-implementation
Draft

Add preset aggregation interval API inspired by shinyorg/Health#51
Copilot wants to merge 2 commits intomainfrom
copilot/research-shinyorg-health-implementation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

This issue asked us to evaluate shinyorg/Health and bring over practical concepts where they improve this library.
This PR adopts its interval preset idea for bucketed queries while preserving existing TimeSpan-based APIs.

  • What changed

    • Added HealthAggregationInterval enum (Minute, Hour, Day) as first-class presets for aggregate bucketing.
    • Added HealthAggregationIntervalExtensions.ToTimeSpan() to map presets to canonical TimeSpan values.
    • Added a new IHealthService overload:
      • GetAggregatedHealthDataByInterval<TDto>(HealthTimeRange, HealthAggregationInterval, CancellationToken)
    • Implemented overload in HealthService by delegating to the existing TimeSpan overload (no platform logic duplication).
  • API ergonomics

    • Keeps current behavior and signatures intact.
    • Adds a clearer path for common interval use cases without requiring callers to manually construct TimeSpan.
  • Documentation

    • Updated README aggregation-by-interval usage with the new preset overload.
  • Example

    var hourly = await _healthService.GetAggregatedHealthDataByInterval<StepsDto>(
        weekRange,
        HealthAggregationInterval.Hour);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/shinyorg/Health/contents
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 20, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Investigate concepts from shinyorg Health for our implementation Add preset aggregation interval API inspired by shinyorg/Health Apr 20, 2026
Copilot AI requested a review from Kebechet April 20, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inspire from shinyorg Health

2 participants