Revert "re-implement git-initializer component using git2go (#1939)"#1950
Merged
krancour merged 1 commit intobrigadecore:mainfrom May 6, 2022
Merged
Conversation
f389822 to
f0bc935
Compare
✅ Deploy Preview for brigade-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for brigade-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
This was referenced May 6, 2022
vdice
approved these changes
May 6, 2022
AnuragThePathak
pushed a commit
to AnuragThePathak/brigade
that referenced
this pull request
May 16, 2022
…ore#1939)" (brigadecore#1950) This reverts commit 340421d. Signed-off-by: Kent Rancourt <kent.rancourt@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Further testing of the new implementation in our dogfood cluster revealed a big gotcha.
repo.LookupCommit(<sha>)only works for commits that have been fetched already. Loose commits aren't offered up by the server during the initial fetch. This means that looking up a commit by sha only works for cases wherein some branch or tag has that commit in its history. (And this is what our integration tests happen to cover when testing checking out by sha.)This is pretty damning limitation because the overwhelming majority of our own events originate from GitHub pull requests and they reference specific commits by sha.
The correct fix for this is to craft a custom refspec for the fetch and that will allow us to retrieve any commit from the remote -- and indeed the old implementation was doing this. The trouble is that only libgit2's very latest version supports fetching using refspecs that contain a sha and git2go does not yet support the latest version of libgit2.
I haven't exhausted all options yet for fixing this, but every single thing that might work is a rabbit hole unto itself. In light of that, I'd like to roll back #1939 to restore the tip of the main branch to good working order sooner rather than later.
cc @emilwangaa