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

Expose Location information #239

Merged

Conversation

juzuluag
Copy link
Contributor

@juzuluag juzuluag commented Jan 5, 2023

Issue Number: (microsoft#229, microsoft#214, #175)

Summary

Expose Locations data through all the 'user's' interfaces (WebApi, CLI, GSF SDK)

Changes

  • Add new WebApi route /locations
  • Add new CLI option caw locations
  • Add new GSF.CarbonAware API handler ILocationHandler

GetLocations2

Checklist

  • Local Tests Passing?
  • CICD and Pipeline Tests Passing?
  • Added any new Tests?
  • Documentation Updates Made?
  • Are there any API Changes? If yes, please describe below.

Are there API Changes?

If yes, what are the expected API Changes? Please link to an API-Comparison workflow with the API Diff.

  • WebApi route /locations
  • CLI option caw locations
  • GSF.CarbonAware API handler ILocationHandler.GetLocationsAsync

Close #175

@codecov-commenter
Copy link

Codecov Report

Merging #239 (349a65e) into dev (67b46c8) will decrease coverage by 0.64%.
The diff coverage is 56.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #239      +/-   ##
==========================================
- Coverage   76.74%   76.09%   -0.65%     
==========================================
  Files          71       73       +2     
  Lines        2283     2334      +51     
  Branches      230      234       +4     
==========================================
+ Hits         1752     1776      +24     
- Misses        468      495      +27     
  Partials       63       63              
Impacted Files Coverage Δ
...e/src/Configuration/ServiceCollectionExtensions.cs 0.00% <0.00%> (ø)
...rc/GSF.CarbonAware/src/Handlers/LocationHandler.cs 0.00% <0.00%> (ø)
src/GSF.CarbonAware/src/Models/Location.cs 0.00% <0.00%> (ø)
...re.WebApi/src/Controllers/CarbonAwareController.cs 95.29% <83.33%> (-0.96%) ⬇️
.../CarbonAware.LocationSources/src/LocationSource.cs 86.25% <100.00%> (+5.92%) ⬆️

Copy link
Contributor

@JenMadiedo JenMadiedo left a comment

Choose a reason for hiding this comment

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

This is a cool solution, thanks for the taking the time to do it all. I had one quick question about how the user will know about the duplicated key situation

@juzuluag juzuluag force-pushed the 229-214/expose_locations branch 2 times, most recently from e24ddc2 to 6aadfc0 Compare January 9, 2023 15:44
@vaughanknight
Copy link
Contributor

This is awesome, let me know when it's ready for us to review. We had been looking at this for a while and it came up in the hackathon to document on the website the locations, but we had decided that a service would be better to get the data live.

For these named locations however, should we also be doing forecast?

@juzuluag juzuluag force-pushed the 229-214/expose_locations branch from 6aadfc0 to 7ffc45e Compare January 10, 2023 16:42
@juzuluag
Copy link
Contributor Author

juzuluag commented Jan 10, 2023

This is awesome, let me know when it's ready for us to review. We had been looking at this for a while and it came up in the hackathon to document on the website the locations, but we had decided that a service would be better to get the data live.

For these named locations however, should we also be doing forecast?

Hi @vaughanknight, thank you for pointing this out. The WebApi route should be /locations. This is something that I'll fix. It would be in sync with the CLI and GSF.CarbonAware.
W/r/t forecast, it will be independent whether is emissions or forecast.

@juzuluag juzuluag force-pushed the 229-214/expose_locations branch from 78f0d1e to 0942c07 Compare January 10, 2023 19:34
@juzuluag juzuluag requested review from JenMadiedo and removed request for vaughanknight January 11, 2023 13:57
Copy link
Contributor

@JenMadiedo JenMadiedo left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for the comment

@juzuluag
Copy link
Contributor Author

@vaughanknight ready for review

@gfmatthews gfmatthews mentioned this pull request Jan 17, 2023
6 tasks
Copy link
Contributor

@vaughanknight vaughanknight left a comment

Choose a reason for hiding this comment

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

Very happy with this one. Thank you very much. We may look a changing the response type maybe but I want to get it into dev as we feel it's best if we get some people using it and get feedback before it goes into main. Thanks again!

@vaughanknight vaughanknight merged commit 512135a into Green-Software-Foundation:dev Jan 24, 2023
@juzuluag juzuluag deleted the 229-214/expose_locations branch January 24, 2023 14:28
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.

[Feature Contribution]: API end point for available locations
4 participants