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

Use deterministic Gerrit ChangeIds #29

Merged
merged 1 commit into from
Nov 18, 2020

Commits on Nov 18, 2020

  1. git: set deterministic change id and add lore link to commits

    Problem:
    Non-deterministic change ids mean we get duplicate changes uploaded to
    Gerrit for the same patch if the Bridge gets restarted.
    
    When issue google#14 is implemented, this will not matter as much, but there's
    still a chance for updates not to be persisted in the DB.
    
    Solution:
    Use a deterministic change id, i.e. "I" + <commit sha of v1>.
    
    If we try and create a Gerrit change for the same patch, I'm assuming
    the collision with the pre-existing change id will prevent us from doing
    so.
    
    Alternative:
    As noted in the file, we could consider using a `applypatch-msg` hook.
    
    But we can do more if we edit the commit directly from Python, since we
    have access to more information, e.g. the lore link.
    Add in a "Lore-Link" footer while we're here to demonstrate this.
    
    This iteration of the code is essentially a direct translation of what I
    had originally prototyped in bash for the hook.
    dlatypov committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    28477f8 View commit details
    Browse the repository at this point in the history