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 speed to huge mono repo with different target branch #961

Open
yuyuvn opened this issue Dec 5, 2024 · 0 comments
Open

Improve speed to huge mono repo with different target branch #961

yuyuvn opened this issue Dec 5, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yuyuvn
Copy link

yuyuvn commented Dec 5, 2024

Is your feature request related to a problem? Please describe.
We using a huge monorepo with multi argocd application.
Each application has a different git write back branch.
There are case that 1 image change create more than 300 application update. Each update need to wait for each other because we have a mutex for same git repo url.

Describe the solution you'd like
From #177 , we have a mutex when pushing to git. But the key is base on git url. I think we can change mutex key to something like gitUrl:targetBranch

func commitChangesLocked(app *v1alpha1.Application, wbc *WriteBackConfig, state *SyncIterationState, changeList []ChangeEntry) error {
	if wbc.RequiresLocking() {
-		lock := state.GetRepositoryLock(wbc.GitRepo)
+               lock := state.GetRepositoryLock(fmt.Sprintf("%s:%s", wbc.GitRepo, wbc.GitBranch))
		lock.Lock()
		defer lock.Unlock()
	}

	return commitChanges(app, wbc, changeList)
}

Additional context
We don't directly push to master branch because of our company audit policy, which need approve from CODEOWNER to push any change into production.

@yuyuvn yuyuvn added the enhancement New feature or request label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant