Skip to content

Conversation

@dberenbaum
Copy link
Contributor

Addresses Make auto push work with queue #10137 (comment).

@skshetry Feel free to take it over if you want to refactor in any way.

@dberenbaum dberenbaum requested a review from skshetry March 6, 2024 21:49
@codecov
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 90.66%. Comparing base (9957410) to head (bee615d).

Files Patch % Lines
dvc/repo/experiments/executor/local.py 75.00% 1 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

@skshetry
Copy link
Collaborator

skshetry commented Mar 7, 2024

I guess DVC_EXP_AUTO_PUSH was not working for exp queue before, right?

@dberenbaum
Copy link
Contributor Author

dberenbaum commented Mar 7, 2024

I guess DVC_EXP_AUTO_PUSH was not working for exp queue before, right?

Correct, I doubt it was ever working for exp queue (edit: or exp --temp)

@dberenbaum dberenbaum enabled auto-merge (rebase) March 7, 2024 12:38
@dberenbaum dberenbaum merged commit 1aeb875 into main Mar 7, 2024
@dberenbaum dberenbaum deleted the auto-push-queue branch March 7, 2024 12:39
Comment on lines +149 to +158
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)
Copy link
Collaborator

@skshetry skshetry Mar 7, 2024

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:
	pass

Copy link
Contributor Author

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).

Copy link
Contributor Author

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

Copy link
Collaborator

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.

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.

2 participants