Skip to content

Revert "re-implement git-initializer component using git2go (#1939)"#1950

Merged
krancour merged 1 commit intobrigadecore:mainfrom
krancour:revert-new-git-initializer
May 6, 2022
Merged

Revert "re-implement git-initializer component using git2go (#1939)"#1950
krancour merged 1 commit intobrigadecore:mainfrom
krancour:revert-new-git-initializer

Conversation

@krancour
Copy link
Contributor

@krancour krancour commented May 6, 2022

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

@krancour krancour added the bug Something isn't working label May 6, 2022
@krancour krancour added this to the v2.5.0 milestone May 6, 2022
@krancour krancour requested a review from vdice May 6, 2022 14:16
@krancour krancour self-assigned this May 6, 2022
…ore#1939)"

This reverts commit 340421d.

Signed-off-by: Kent Rancourt <kent.rancourt@microsoft.com>
@krancour krancour force-pushed the revert-new-git-initializer branch from f389822 to f0bc935 Compare May 6, 2022 14:17
@netlify
Copy link

netlify bot commented May 6, 2022

Deploy Preview for brigade-docs ready!

Name Link
🔨 Latest commit f389822
🔍 Latest deploy log https://app.netlify.com/sites/brigade-docs/deploys/62752dabf047630008d56627
😎 Deploy Preview https://deploy-preview-1950--brigade-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented May 6, 2022

Deploy Preview for brigade-docs ready!

Name Link
🔨 Latest commit f0bc935
🔍 Latest deploy log https://app.netlify.com/sites/brigade-docs/deploys/62752ddd6260f100086afe38
😎 Deploy Preview https://deploy-preview-1950--brigade-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@krancour krancour merged commit b7ba275 into brigadecore:main May 6, 2022
@krancour krancour deleted the revert-new-git-initializer branch May 6, 2022 15:49
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants