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

Better: Prepend .gitconfig with random hash to allow concurrency #9219

Merged

Conversation

ylecuyer
Copy link
Contributor

@ylecuyer ylecuyer commented Mar 5, 2024

Hello,

I followed the advice here https://github.com/dependabot/dependabot-script/blob/main/update-script.rb#L32 and went with looping all dependencies. I also went a bit further and added https://github.com/grosser/parallel with an each in process to speed up the handling of dependencies.

But I faced the issue that all processes try to update the same .gitconfig file at the same time which is locked.

The fix I propose here is to prepend the .gitconfig file name with a random hash to avoid conflicts

@ylecuyer ylecuyer requested a review from a team as a code owner March 5, 2024 22:49
@yeikel
Copy link
Contributor

yeikel commented Mar 14, 2024

This is an interesting change. I implemented a similar change in my internal fork and I faced the same challenge. Interestedly enough, it only seems to apply to some ecosystems. Maven for example, does not have this problem

@yeikel
Copy link
Contributor

yeikel commented Mar 19, 2024

@JamieMagee Can you take a look at this one

@yeikel
Copy link
Contributor

yeikel commented Apr 3, 2024

I can confirm that we have seen this with npm and go. Example error:

error: could not lock config file /home/dependabot/.gitconfig: File exists

@yeikel
Copy link
Contributor

yeikel commented Aug 12, 2024

@abdulapopoola Could you please help us find a reviewer for this change?

@sachin-sandhu
Copy link
Contributor

HI @yeikel , we have started working on the request, ill get back to you in case required. thanks !

@sachin-sandhu
Copy link
Contributor

Hi @ylecuyer , @yeikel , I went through the changes. Thanks a lot for your contribution!

Do you have high confidence w.r.t any unknowns. Alternatively, I am proposing adding changes behind a feature flag and monitor for some time before finally adding to code base. Let me know if you are good with this.

@yeikel
Copy link
Contributor

yeikel commented Jan 28, 2025

Hi @ylecuyer , @yeikel , I went through the changes. Thanks a lot for your contribution!

Do you have high confidence w.r.t any unknowns. Alternatively, I am proposing adding changes behind a feature flag and monitor for some time before finally adding to code base. Let me know if you are good with this.

That would work. I don't have any concerns with that approach

@sachin-sandhu
Copy link
Contributor

Hi @ylecuyer , @yeikel ,
Can you please resolve the conflicts from main , ill add the feature flag functionality; We will test the functionality under feature flag before making it final. thanks !

@ylecuyer
Copy link
Contributor Author

Hi @ylecuyer , @yeikel , Can you please resolve the conflicts from main , ill add the feature flag functionality; We will test the functionality under feature flag before making it final. thanks !

done 👍

@sachin-sandhu
Copy link
Contributor

@ylecuyer , thanks! , ill try to finish it by today.

@sachin-sandhu sachin-sandhu force-pushed the allow-concurrency-gitconfig-yle branch from d3e9399 to 7a2d512 Compare March 6, 2025 03:07
Copy link
Contributor

@sachin-sandhu sachin-sandhu left a comment

Choose a reason for hiding this comment

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

Approving the changes

@sachin-sandhu sachin-sandhu force-pushed the allow-concurrency-gitconfig-yle branch from 7a2d512 to dc28861 Compare March 6, 2025 04:50
@sachin-sandhu sachin-sandhu merged commit f3b78cc into dependabot:main Mar 6, 2025
239 of 248 checks passed
@sachin-sandhu
Copy link
Contributor

sachin-sandhu commented Mar 6, 2025

(I didn't go with feature flag as i think this was not needed) I monitored the release for few hours to see if any exceptions are coming up. Didn't observe any unintended behaviour. We will monitor it for few days to see everything is good. Thanks a lot @ylecuyer for your contributions.

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

Successfully merging this pull request may close these issues.

4 participants