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

Improve location files handler when dealing with duplicated keys. #214

Open
6 tasks done
gfmatthews opened this issue Dec 8, 2022 · 3 comments
Open
6 tasks done

Comments

@gfmatthews
Copy link
Member

gfmatthews commented Dec 8, 2022

Description

As a Carbon Aware application developer, I want that location source keys don't collide

Acceptance Criteria

  • Avoid missing location definitions to be missed as part of loading the application
  • Avoid location key collisions when loading location definitions from different locations-source json files
  • Unit Tests are completed and code passes tests

Dependencies

Task List

  • Load all the locations definitions from all the json files
  • Generate new key if there is key name collision.
  • Add unit test to verify key name renaming.
@gfmatthews
Copy link
Member Author

@juzuluag - Can you provide a bit more detail in this issue on what your plan is? We talked about it planning but it's good to keep it here for the record

@juzuluag
Copy link

juzuluag commented Dec 13, 2022

@gfmatthews , this is what this is about:

  • Background: Current Location files handler (CarbonAware.LocationSources project) discovers all the location json files located at location-sources\json that contains NamedGeoposition instances.
  • Issue: NamedGeoposition instances are stored in a dictionary. If there are multiple instances that generates the same key, it will override the previous ones stored (a.k.a: name collision). Creating missing instances and potentially confusing the user that relies on some of those instances. Currently there isn't any feedback (i.e. log warning) to the user.
  • Proposal: The location handler should warn the user of name collision. If there is collision , we could generate new keys. This is not the ideal, since what is missing, is another feature/story , that listing locations should be available to the end user (expose this new functionality using the API)

@juzuluag
Copy link

juzuluag commented Jan 5, 2023

PR: Green-Software-Foundation#239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants