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

feat: create ConfigCollection from non-git path #683

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

mikewilli
Copy link
Collaborator

  • Adds a from_local_path function to ConfigCollection
  • bumps version to 2024.11.1

Why? Experimenter wants to use metric-config-parser to parse a partial local copy of metric-hub for outcomes and segments, and the existing from_local_repo required some mock objects in order for the local copy to work as a git repo (Experimenter always wants the latest version, so has no need for the .git dir that is used to get configs from a specific date, and .git is kind of big!).

Related: mozilla/experimenter#11772

Copy link
Contributor

@RJAK11 RJAK11 left a comment

Choose a reason for hiding this comment

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

That looks good to me!

Copy link
Collaborator

@scholtzan scholtzan left a comment

Choose a reason for hiding this comment

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

I guess this should be fine. One thing to consider though is that some class methods, like as_of() won't work as they rely on a repository being present. Maybe we need to add some better error handling for those, but I guess experimenter won't look at the commit history

@mikewilli
Copy link
Collaborator Author

@scholtzan Thanks for raising this valid concern. I updated the PR to create a new sub-class of ConfigCollection that explicitly raises an exception if the class methods that use repos are called, and then moved the from_local_path function into this class.

Of note, I think it sort of makes more sense the other way around, as ConfigCollection adds repos to the LocalConfigCollection, but I implemented it this way to avoid making changes in ConfigCollection (just in case).

@mikewilli mikewilli added this pull request to the merge queue Nov 15, 2024
Merged via the queue into main with commit d0f61f0 Nov 15, 2024
5 of 7 checks passed
@mikewilli mikewilli deleted the from-local-path-config branch November 15, 2024 19:40
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