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

Wrong blobId computed on git-lfs files #519

Open
amartani opened this issue Feb 1, 2024 · 0 comments
Open

Wrong blobId computed on git-lfs files #519

amartani opened this issue Feb 1, 2024 · 0 comments

Comments

@amartani
Copy link

amartani commented Feb 1, 2024

In our CI pipeline, some tests are run in an environment that has a git client, while others are not (integration tests that are run inside docker containers, which we don't copy the git client in). At the end, we merge coverage from both sources using cc-test-reporter sum-coverage.

When we added one large autogenerated source file to git-lfs, we started seeing a BlobID mismatch error on sum-coverage. Upon investigation, this seems to be ultimately caused by the fact that, when using git-lfs, the resulting blob id will be different depending on the presence of the git client - from my cursory read of the code, it will depend on whether fallbackGlob is used:

func fallbackBlob(path string) (string, error) {

This is due to the fact that git-lfs rewrites files, so the hash obtained from git is not the hash of the final file.

We have worked around this by noting that code files should not be added to git-lfs, but it would be great if this was properly fixed, since it is an issue that is quite difficult to track. I suggest that the tool checks for any git smudge filters that may be set on a file, and use the fallbackGlob implementation when that happens, as this would accommodate any usage of git smudge filters (more general solution than git-lfs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant