-
Notifications
You must be signed in to change notification settings - Fork 18
Fix cross repo Go references when not pointing at a tagged version #99
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry I forgot to submit the review yesterday. 🤦🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks OK, but I think we should be explicitly stripping out the build metadata suffix, if present. That's technically a different bug, but a bug nonetheless, and it's very much related to the code you're modifying.
Fixes GRAPH-129
This PR resolves a mismatch with how scip-go would generate the version string when not pointing at a tagged module version string. This mismatch would break cross-repo references.
Background
When indexing a repo who's head commit was not tagged, scip-go sets the version as the first 12 characters of the HEAD commit sha. However, when referencing a module at that same non-tagged commit, scip-go would just set the version to the pseudo-version string.
To fix this, we will consistently use the sha1 when pointing at a non-tagged commit. If you point at a tagged commit (e.g. v1.2.3) then we do not change anything and still just use the proper version string.
Result
Below are the generated version strings when pointing at the latest commit on github.com/sourcegraph/conc
Definition
Reference