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

BuildMaster.addChange drops data for fields who were renamed.. #3191

bdbaddog opened this Issue May 15, 2017 · 0 comments


None yet
1 participant

bdbaddog commented May 15, 2017

See: (From:

        def handle_deprec(oldname, newname):
            if oldname not in kwargs:
            old = kwargs.pop(oldname)
            if old is not None:
                if kwargs.get(newname) is None:
                    log.msg("WARNING: change source is using deprecated "
                            "addChange parameter '%s'" % oldname)
                    return old
                raise TypeError("Cannot provide '%s' and '%s' to addChange"
                                % (oldname, newname))
            return kwargs.get(newname)

        kwargs['author'] = handle_deprec("who", "author")
        kwargs['when_timestamp'] = handle_deprec("when", "when_timestamp")

If addChange is called with when_timestamp and not when, then kwargs['when_timestamp'] = handle_deprec("when", "when_timestamp") will set it to None, and then the data in the db will just be the time the change was processed.

The fix is:

            if oldname not in kwargs:
                return kwargs[newname]

Test need to be updated for this. Don't have time at the moment to do so, but want to make sure this is not lost.

Note this affects most (if not all) webhooks. (But not github poller's it seems)

@seankelly seankelly closed this in e1a0ea5 May 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment