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

Misc git hosting fixes #162

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ciaranj
Copy link

@ciaranj ciaranj commented Jun 29, 2012

Some, miscellaneous (hopefully un-contentious) fixes/performance improvements.

The Hosting adapter causes multiple calls to be sent to 'entries' on
the git_adapter(repositories_controller_path#show_with_git_instructions
adds a second (non vanilla chiliproject) call.

As this method is very expensive, this has a performance impact we can
avoid!

It might be better to provide a dedicated method to the patched
git_adapter to determine whether a repository is 'empty' or not
rather than having to fetch the entries, but this will work for now.
There is some logic in update_repositories to avoid 'recursion'
however this does not protect against the case where an
observed change leads to multiple calls to update_repositories
for the same project (or projects.)

An example change that could cause this is is to add a *group*
with commit rights as a project's member.  The update_repositories
method will then get called for both the group's addition and
each subsequent member of that group.  This change avoids those
un-neccessary secondary calls.
@ciaranj
Copy link
Author

ciaranj commented Jul 2, 2012

Hmm , this isn't good to pull yet,1057899 is wrong. The sentiment is right, but the approach I've taken doesn't actually work (well it works once, then never again ;) ) Not really sure how best to fix it whilst remaining 'close' to your version of the project.

The primary difference in my fork was around how I managed the 'update_repositories' call, namely I did:

https://github.com/ciaranj/redmine_git_hosting/commit/6392c2095a125ea44e74d463bb4e2ffb15d1226a 

and

https://github.com/ciaranj/redmine_git_hosting/commit/6aa8ea56329b35d2e1f947b71716ff7da56663fd

To wrap all requests to redmine and do the actual update_repositories call at the end of the request so we didn't repeatedly update the same project. ... I can't see a way around this if Observers are singletons (which they appear to be.)

I also can't understand why I'm the only one who seems to be seeing this issue :(

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.

1 participant