committed via Kallithea into repository

Issue #327 resolved
zwarmapapa created an issue

I made a cronjob that pulls a remote repository every 10 minutes.

Everything works well, but now whenever I check my admin journal, all I see is "committed via Kallithea into repository" lines.

Even when the remote repository didn't change (and so, the cronjob shouldn't have committed anything).

Is there any way to disable this message, or is there a way to fix it so that it only adds this message when something did actually got committed (when something actually changed in the remote repo)?

Comments (7)

  1. Mads Kiilerich

    What version control system are you using?

    What Kallithea version are you using?

    How do you pull - what command is the cron job running?

  2. zwarmapapa reporter


    Kallithea v0.3.99 (last time I pulled was maybe a couple months to half a year ago).

    The cronjob line is:

    */10 * * * * curl -X POST -H 'content-type:text/plain' --data-binary '{"id":1,"api_key":"a5aaaaaaaaaaaaaaaaaaaaaaaaaaa","method":"pull","args":{"repoid":65}}' > /dev/null 2>&1
  3. Thomas De Schampheleire

    I think this is caused by kallithea/lib/, pull_changes, which in case of git calls _handle_push:

    if repo.alias == 'git':
                    # git doesn't really have something like post-fetch action
                    # we fake that now. #TODO: extract fetched revisions somehow
                    # here

    In that function is a call to _handle_rc_scm_extras that does not pass the action of push_remote, and inside that one is a line:

                'action': action or 'push_local',

    where push_local will resolve to the string you mentioned.

  4. Mads Kiilerich

    It also seems a bit wrong to not log the pull attempt ...

    Perhaps, when pulling that often, do it outside Kallithea and then call gearbox update-repoinfo. Or check if there are any incoming changes before invoking the API.

  5. zwarmapapa reporter

    Ah I see, is there any way to disable this that wouldn't break or be reverted when I update kallithea?

    Logging every pull attempt makes the log completely useless, since it's flooded with these messages now. I think it should only log anything when it either actually pulls a change, or when an error occurs. If no error occurs, and no changes have been pulled, I don't think it should log anything, because if it does, the log becomes unusable.


    By the way, you said "kallithea/lib/", but I can't find a in lib, the only I can find is located at "kallithea/model/", is that the correct one?

    I've currently disabled the lines you've listed in that file, and I've also purged the push messages from my log with SQL:

    DELETE FROM user_logs WHERE action = 'push_local:'

    Now the log is usable again, but it's not really a permanent solution, since this change will be undone when pulling a newer kallithea version.

    -Edit 2-

    Oh no it didn't work, my log is full again, was it the wrong file?

    -Edit 3-

    I've looked through the file again, the log message was 'push_local', not 'push_remote', so I started looking for 'push_local'.

    In function commit_change I've found a 'push_local' log call, so I disabled that one now, this is probably the correct one (if not I'll correct it down below, in edit 4).

    -Edit 4-

    Nope it wasn't this one either, I give up.

  6. Thomas De Schampheleire

    I think the following is a bugfix that will make sure that the setting of action to 'push_remote' is respected:

    diff --git a/kallithea/model/ b/kallithea/model/
    --- a/kallithea/model/
    +++ b/kallithea/model/
    @@ -363,7 +363,7 @@ class ScmModel(object):
             :param repo_name: name of repo
             :param revisions: list of revisions that we pushed
    -        self._handle_rc_scm_extras(username, repo_name, repo_alias=repo.alias)
    +        self._handle_rc_scm_extras(username, repo_name, repo_alias=repo.alias, action=action)
             _scm_repo = repo._repo
             # trigger push hook
             if repo.alias == 'hg':

    It will still log all pull attempts, but it will not erroneously log as 'committed via Kallithea' but instead as 'pulled from remote'.

    Question is now whether or not default Kallithea should log pulling if nothing was actually pulled.

  7. Thomas De Schampheleire

    The inaccurate log message is committed as b8deb93894ea. There is still an entry for pull even if no changes are pulled, but this is a semantic discussion whether we are logging the action that someone pulled, or whether something got pulled.

  8. Log in to comment