Dep: Gracefully handle abbreviated revisions during import

Created on 10 Aug 2017  路  6Comments  路  Source: golang/dep

dep in general frowns on / doesn't support abbreviated revisions. However during import, and when reading external config on-the-fly, dep shouldn't just give up. Instead we should lookup the full revision for the short revision, and use the full revision in the imported lock, etc.

I'm hoping that we can handle this in SourceMgr.InferConstraint, so that all the importers get this for "free", though we probably need plumbing in gps to do the dirty work.

Notes:

  • We already have SourceMgr.RevisionPresentIn to check if the revision is valid, and for the git implementation the underlying command used actually prints the full revision, but nothing exists right now to bubble that up.
  • Currently InferConstraint doesn't actually hit the repository to figure out if a rev is valid, it just matches a pattern. Since we actually validate tags/branches, it may be time to retire the guesswork, like doing length checks, and just reply on the source manager entirely to check if a string is a valid revision (and get the full revision if it was abbreviated).
help wanted init

Most helpful comment

No problem! I'm sure there's more work out there for me!

All 6 comments

yeah, we'll definitely need some new plumbing.

i think trying to work it in via InferConstraint() is a wise place to start. i'd rather we not have to split it out into its own thing, but if we do, it's not the end of the world.

I've spoken with @carolynvs about this and she says I can give it a try.

I bequeath upon ye the sacride golden star of approval 猸愶笍

馃槦 Hope I didn't cut the line by submitting #1027 to fix this issue. Sorry for not checking in here first!

I think we all realized before much work was done. Since we can't easily assign issues in GH, it's a distributed game of Hungry Hungry Hippos. 馃槤 Sorry @markwest1!

No problem! I'm sure there's more work out there for me!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabulous-gopher picture fabulous-gopher  路  27Comments

bradleyfalzon picture bradleyfalzon  路  52Comments

sdboyer picture sdboyer  路  40Comments

sdboyer picture sdboyer  路  46Comments

mikkeloscar picture mikkeloscar  路  45Comments