[doc/feature] Improve cache invalidation to detect changes to repositories

Issue #248 open
Charles Murphy created an issue

Kallithea should detect and use changes to the repositories done outside of it without requiring to drop caches manually.

Original report:

I've recently set up a Kallithea sever for evaluation locally, based on the documentation. It seems that the server isn't displaying the pushed changesets in the log/graph, unless I restart the server. This is a recent install/config on windows with the most recent version 0.3.2 using mercurial.

Comments (12)

  1. Thomas De Schampheleire

    To which path/url are you pushing? If you do not push via the Kallithea url, Kallithea does not see the new commits until its cache is invalidated. That can be done manually via the Settings of that repo (Advanced), or scripted via an API call.

    The normal way though is to push to the Kallithea url so you don't have to care about caches...

  2. Charles Murphy reporter

    Correct; I was pushing directly through the filesystem for my demo configuration which would never happen in practical use. I apologize for submitting a non-issue. Thanks for the prompt and helpful response.

  3. domruf

    FYI I have experimented with celerybeat to allow cron like tasks.

    Maybe we simply add a tasks that checks for changes once an hour?

  4. Thomas De Schampheleire

    Once an hour is still too slow for many use cases. When something is pushed to the repo, it may be expected to be immediately visible in Kallithea UI.

    For example, we use a 'push' wrapper that also creates a review request; between the push and creation of the review request, Kallithea cache needs to be invalidated first. If Kallithea would detect the change 'immediately' then it would be easier.

  5. Mads Kiilerich

    I don't like polling. Unexpected magic can make it harder to figure out what is going on.

    If repositories are modified outside Kalliteha, they should call the push hook directly. For Mercurial it can be configured in .hg/hgrc manually. I guess the hooks are installed for Git but might require some tweaking. I don't know what the 'real' solution (if any) should be, but I think the short term solution is to document this workaround (after figuring out exactly what works).

  6. Log in to comment