-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix auto push for queue/tmp experiments #10343
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10343 +/- ##
==========================================
- Coverage 90.66% 90.66% -0.01%
==========================================
Files 500 500
Lines 38650 38670 +20
Branches 5587 5591 +4
==========================================
+ Hits 35042 35059 +17
- Misses 2966 2967 +1
- Partials 642 644 +2 ☔ View full report in Codecov by Sentry. |
|
I guess |
Correct, I doubt it was ever working for |
| local_config = os.path.join(self.scm.root_dir, ".git", "config") | ||
| logger.debug("Writing experiments local Git config '%s'", local_config) | ||
| if os.path.exists(local_config): | ||
| conf_obj = ConfigObj(local_config, list_values=False) | ||
| conf_obj.merge(update) | ||
| else: | ||
| conf_obj = ConfigObj(update, list_values=False) | ||
| if conf_obj: | ||
| with open(local_config, "wb") as fobj: | ||
| conf_obj.write(fobj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably simplify this to just copy file. But this may be useful in the future.
try:
shutil.copyfile(local_git_config, os.path.join(self.scm.root_dir, ".git", "config"))
except FileNotFoundError:
passThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I originally had, but I decided to copy what we do for the dvc config (see the lines directly above), although I agree it's probably overkill. Not sure if there's any case when we actually need to keep the default git config that gets generated (there is a default config file generated, so this does hit the merge condition).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion if you want to change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay for now. I'm not sure if configobj can parse all git configs, but we can fix if it becomes a problem.
Addresses
Make auto push work with queue#10137 (comment).@skshetry Feel free to take it over if you want to refactor in any way.