Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #89]Add supports for additional fields in HR and Sleep. #92

Merged
merged 3 commits into from
Oct 4, 2022

Conversation

jzhou59
Copy link
Contributor

@jzhou59 jzhou59 commented Apr 7, 2022

This PR is related to the issue #89

Changes made in the PR:

  • Add FitbitRestingHeartRateAvroConverter.java
  • Add FitbitRestingHeartRateRoute.java
  • Update FitbitSleepAvroConverter.java
  • Update FitbitRequestGenerator.java
  • Update FitbitRestSourceConnectorConfig.java

@yatharthranjan
Copy link
Member

Hi, radar-schemas version 0.7.9 is now released (it might take a bit to be available on maven repo), please include that here so the CI can run the checks. Thanks.

@jzhou59
Copy link
Contributor Author

jzhou59 commented Apr 19, 2022

Ok, I have updated the radar-schemas version and Gradle runs successfully in my pc.

Copy link
Member

@yatharthranjan yatharthranjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks fine to me. Some minor comments.

Also, would be great if you can (if not done already) run and test against the actual fitibit API. Would also help you get set up with the dev workflow for any future work.

@blootsvoets, it would be great if you can review it too. Thanks.


JsonNode restingHeartRateNode = value.get("restingHeartRate");
if (restingHeartRateNode == null) {
logger.warn("Failed to get resting heart rate from {}, {}", request.getRequest().url(), root);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make each of these log statement more informative? Right now all say the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@@ -92,13 +95,14 @@ private List<RequestRoute> getRoutes(FitbitRestSourceConnectorConfig config) {
localRoutes.add(new FitbitIntradayHeartRateRoute(this, userRepository, avroData));
localRoutes.add(new FitbitIntradayCaloriesRoute(this, userRepository, avroData));
}
localRoutes.add(new FitbitRestingHeartRateRoute(this, userRepository, avroData));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move this above the intraday ones so all the non-intraday are together?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, do I need to rename the FitbitRestingHeartRateRoute to FitbitIntradayRestingHeartRateRoute?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sorry, I think you misunderstood, I meant above the if statement (not inside). It is not intraday so the name is fine. Just wanted to move the statement together with others like

    localRoutes.add(new FitbitSleepRoute(this, userRepository, avroData));
    localRoutes.add(new FitbitTimeZoneRoute(this, userRepository, avroData));
    localRoutes.add(new FitbitActivityLogRoute(this, userRepository, avroData));
    localRoutes.add(new FitbitRestingHeartRateRoute(this, userRepository, avroData));

    if (config.hasIntradayAccess()) {
      localRoutes.add(new FitbitIntradayStepsRoute(this, userRepository, avroData));
      localRoutes.add(new FitbitIntradayHeartRateRoute(this, userRepository, avroData));
      localRoutes.add(new FitbitIntradayCaloriesRoute(this, userRepository, avroData));
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I have updated codes according to your comments.

@jzhou59
Copy link
Contributor Author

jzhou59 commented Apr 21, 2022

Mostly looks fine to me. Some minor comments.

Also, would be great if you can (if not done already) run and test against the actual fitibit API. Would also help you get set up with the dev workflow for any future work.

@blootsvoets, it would be great if you can review it too. Thanks.

I have done the registration of Fitbit and run the docker according to readme in the very beginning, but it seems there is no data for my personal account. I will try to look into it in detail later.

@yatharthranjan yatharthranjan requested a review from blootsvoets May 9, 2022 08:55
Copy link
Member

@yatharthranjan yatharthranjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@blootsvoets blootsvoets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blootsvoets blootsvoets merged commit caa033a into RADAR-base:dev Oct 4, 2022
@blootsvoets blootsvoets mentioned this pull request May 31, 2023
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.

3 participants