Refresh rate for activity log?

32 views
Skip to first unread message

Andreas Rehn

unread,
Apr 29, 2013, 4:31:51 AM4/29/13
to scmma...@googlegroups.com
Hi, i have a git repo setup in scm-manager but it is also accessible directly through an apache. I notice that the commits that are done directly through apache shows up after a while in scm-manager but i'm wondering how this works. Is there a fixed time interval where the activity log is refreshed? Can this be configured or can the refresh be triggered manually?

best regards

Andreas

Sebastian Sdorra

unread,
Apr 29, 2013, 4:41:37 AM4/29/13
to scmma...@googlegroups.com
Hi,
Do you allow pushes from the apache directly to git repository? A setup like this does not work with scm-manager, because scm-manager caches a lot of data from the repositories and the cache is cleared after a push. If you do a push directly to the fs, scm-manager does not recognise the change and can not clear the caches. In this case you see old data (e.g. in commits view, activity plugin and so on).

As a workaround you could forward the request to scm-manager.

Sebastian


2013/4/29 Andreas Rehn <and...@diabol.se>
Hi, i have a git repo setup in scm-manager but it is also accessible directly through an apache. I notice that the commits that are done directly through apache shows up after a while in scm-manager but i'm wondering how this works. Is there a fixed time interval where the activity log is refreshed? Can this be configured or can the refresh be triggered manually?

best regards

Andreas

--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andreas Rehn

unread,
Apr 29, 2013, 4:58:55 AM4/29/13
to scmma...@googlegroups.com
Hi Sebastian and tnx for the quick response.

Yes, I know it's a bit awkward, we set it upp like this as a workaround for the permissions problem I described in an earlier post, and through apache we can do some more tricks around authorization. I'm setting up build/delivery pipelines which includes alot of tools that needs to be integrated and I wanted to try to use SCM Manager purely as a repo browser and to show commit details in a nice way that I can punch in to directly from other tools. I quickly browsed trough the plugin api and it looks like it would be possible to write a plugin that clears the cache on trigger or on a timer, maybe that would be a way for us?

best regards 

Andreas

Sebastian Sdorra

unread,
Apr 30, 2013, 2:46:16 AM4/30/13
to scmma...@googlegroups.com
Hi,
Yes that would be possible, you could use the "scm-script-plugin" which contains an "clear cache" example. But i recommend to serve the repositories directly with scm-manager. What are the problems with the permissions or what is missing? I thought the problem from the earlier post was fixed?

Sebastian

Jakub Hettler

unread,
Mar 26, 2014, 6:16:37 AM3/26/14
to scmma...@googlegroups.com
Hi Sebastian,

I modified the clear cache script to delete caches from all repositories, it works fine for me, but even if I run this script the Activity tab is not refreshed. Is there something wrong, is it possible to do it like this?


import sonia.scm.*;
import sonia.scm.cache.*;
import sonia.scm.repository.*;
import sonia.scm.repository.api.*;

// identify your repository
//def type = "git";
//def name = "PPCR_TC.git";

def repositoryManager = injector.getInstance(RepositoryManager.class);
//def repository = repositoryManager.get(type, name);
def AllRepositories = repositoryManager.getAll().toArray().name;

for (def repository : AllRepositories) {

//println "clear caches for " + repository.name;

println "Clear cache for repository " + repository;

def cacheManager = injector.getInstance(CacheManager.class);
def caches = [
  cacheManager.getCache(BlameCommandBuilder.CacheKey.class, BlameResult.class, BlameCommandBuilder.CACHE_NAME),
  cacheManager.getCache(BrowseCommandBuilder.CacheKey.class, BrowserResult.class, BrowseCommandBuilder.CACHE_NAME),
  cacheManager.getCache(LogCommandBuilder.CacheKey.class, ChangesetPagingResult.class, LogCommandBuilder.CACHE_NAME),
  cacheManager.getCache(TagsCommandBuilder.CacheKey.class, Tags.class, TagsCommandBuilder.CACHE_NAME),
  cacheManager.getCache(BranchesCommandBuilder.CacheKey.class, Branches.class, BranchesCommandBuilder.CACHE_NAME)
];

def filter = new RepositoryFilter(repository);
for (def cache : caches){
  cache.removeAll(filter);
}

}
  
Thanks & regards

Jakub

Dne úterý, 30. dubna 2013 8:46:16 UTC+2 Sebastian Sdorra napsal(a):

Sebastian Sdorra

unread,
Mar 26, 2014, 6:43:01 AM3/26/14
to scmma...@googlegroups.com
Hi,
Why you want clear the cache manually? The cache should be automatically cleared for each repository which has changed. The activity plugin use its own caches. Here is an simplified version of the script which clears the repository caches and the caches of the activity plugin:

import sonia.scm.*;
import sonia.scm.cache.*;
import sonia.scm.repository.*;
import sonia.scm.repository.api.*;
import sonia.scm.activity.ActivityManager;
import sonia.scm.activity.ActivitySet;
import sonia.scm.activity.Activities;

def cacheManager = injector.getInstance(CacheManager.class);
def caches = [
  cacheManager.getCache(BlameCommandBuilder.CacheKey.class, BlameResult.class, BlameCommandBuilder.CACHE_NAME),
  cacheManager.getCache(BrowseCommandBuilder.CacheKey.class, BrowserResult.class, BrowseCommandBuilder.CACHE_NAME),
  cacheManager.getCache(LogCommandBuilder.CacheKey.class, ChangesetPagingResult.class, LogCommandBuilder.CACHE_NAME),
  cacheManager.getCache(TagsCommandBuilder.CacheKey.class, Tags.class, TagsCommandBuilder.CACHE_NAME),
  cacheManager.getCache(BranchesCommandBuilder.CacheKey.class, Branches.class, BranchesCommandBuilder.CACHE_NAME),
  cacheManager.getCache(String.class, ActivitySet.class, ActivityManager.CACHE_REPOSITORY),
  cacheManager.getCache(String.class, Activities.class, ActivityManager.CACHE_USER)
];

for (def cache : caches){
  cache.clear();
}

Note the script above works only for activity plugin 1.10 or newer.

Sebastian



For more options, visit https://groups.google.com/d/optout.

Jakub Hettler

unread,
Mar 26, 2014, 7:26:39 AM3/26/14
to scmma...@googlegroups.com
Hi Sebastian,

because I can run only SSH protocol externally from my organization (company rules), that is why I use gitolite and git for pull/push operation and I use SCM manager just for controlling/statistical purposes.

And when I push changes via gitolite I need to refresh Activity log manually.

Thanks for fast reply, script works properly.

Regards

Jakub




--
You received this message because you are subscribed to a topic in the Google Groups "scmmanager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scmmanager/tvfhJWDlTO8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scmmanager+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages