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

Fix incorrect "thin pack" reference handling #110

Merged
merged 2 commits into from
Mar 21, 2022
Merged

Fix incorrect "thin pack" reference handling #110

merged 2 commits into from
Mar 21, 2022

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Mar 21, 2022

The v5.4.2 version of the github.com/go-git/go-git module dependency used by this project to work with the Git repositories of the libraries was not able to correctly handle specific types of references in Git "thin packs" (go-git/go-git#190), which caused a spurious failure of the sync process for the affected libraries (#109):

2022/03/21 06:22:28 Scraping https://github.com/RAKWireless/RAK14012-LED-Matrix.git
2022/03/21 06:22:28 Error fetching repository: reference delta not found
2022/03/21 06:22:28 Removing clone and trying again
2022/03/21 06:22:28 Error fetching repository: reference delta not found
2022/03/21 06:22:28 Leaving...

(currently visible at http://downloads.arduino.cc/libraries/logs/github.com/RAKWireless/RAK14012-LED-Matrix/)

2022/03/21 06:22:28 Scraping https://github.com/RAKWireless/RAK12021-TCS37725.git
2022/03/21 06:22:29 Error fetching repository: reference delta not found
2022/03/21 06:22:29 Removing clone and trying again
2022/03/21 06:22:29 Error fetching repository: reference delta not found
2022/03/21 06:22:29 Leaving...

(currently visible at http://downloads.arduino.cc/libraries/logs/github.com/RAKWireless/RAK12021-TCS37725/)

The issue has already been fixed (go-git/go-git#392). Unfortunately, there has not been a release of github.com/go-git/go-git since that time, and the release cycle appears to be fairly long. For this reason, it is necessary to temporarily use a non-release version of the module in order to get access to the fix immediately. This project will resume using release versions as soon as the next one is made.


I added an integration test which is intended to check whether the project is able to correctly handle these libraries. I have simply used the two libraries from the report as test data. I am not confident they will continue to serve as effective test data indefinitely, but also don't know how to do the generation of test data that would serve as a reliable replacement for them, and noticed that those working on the github.com/go-git/go-git bug also did not find an easy way to do it.


Fixes #109

The `github.com/go-git/go-git/[email protected]` dependency used by this project to work with the Git repositories of the
libraries is not able to correctly handle specific types of references in Git "thin packs", causing a spurious failure
of the sync process for the affected libraries:

Error fetching repository: reference delta not found

This test is intended to check whether the project is able to correctly handle these libraries. I have simply used the
two libraries from the report as test data. I am not confident they will continue to serve as effective test data
indefinitely, but also don't know how to do the generation of test data that would serve as a reliable replacement for
them, and noticed that those working on the `github.com/go-git/go-git` bug also did not find an easy way to do it.
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Mar 21, 2022
@per1234 per1234 requested review from cmaglie and umbynos March 21, 2022 07:08
@per1234 per1234 self-assigned this Mar 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2022

Codecov Report

Merging #110 (dfccc33) into main (4999750) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   41.58%   41.58%           
=======================================
  Files          26       26           
  Lines        1450     1450           
=======================================
  Hits          603      603           
  Misses        790      790           
  Partials       57       57           
Flag Coverage Δ
unit 41.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4999750...dfccc33. Read the comment docs.

…handling

The v5.4.2 version of the `github.com/go-git/go-git` module dependency used by this project to work with the Git
repositories of the libraries was not able to correctly handle specific types of references in Git "thin packs", causing
a spurious failure of the sync process for the affected libraries:

Error fetching repository: reference delta not found

The issue has been fixed already (go-git/go-git#392). Unfortunately, there has not been a release of
`github.com/go-git/go-git` since that time, and the release cycle appears to be fairly long. For this reason, it is
necessary to use a non-release version of the module in order to get access to the fix immediately. This project will
resume using release versions of the dependency as soon as the next one is made.
Copy link

@umbynos umbynos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I can't find an easy way to test it either, so LGTM

@per1234 per1234 merged commit 472d9c3 into arduino:main Mar 21, 2022
@per1234 per1234 deleted the handle-delta-references branch March 21, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Library repository fetch fails with "reference delta not found" error
3 participants