corral icon indicating copy to clipboard operation
corral copied to clipboard

Misleading warning messages when `.git` is missing from locator

Open Theodus opened this issue 5 years ago • 2 comments
trafficstars

corral.json:

{
  "deps": [
    {
      "locator": "github.com/ponylang/peg",
      "version": "0.1.0"
    }
  ],
  "info": {}
}
$ corral update
update: updating from /home/theodus/src/wip/changelog-tool
update: will load dep: github.com/ponylang/peg @ 0.1.0
Error loading dep bundle: github_com_ponylang_peg

The repo is never fetched, despite the message being identical to the warning printed on success, see #99.

Theodus avatar May 06 '20 15:05 Theodus

Another variation I got:

I did an add with an incorrect locator and got:

{ "deps": [ { "locator": "github.com/ponylang/peg", "version": "0.1.0" } ], "info": {} }

when I run corral fetch I get:

fetch: fetching from /home/sean/code/ponylang/changelog-tool
fetch: fetching dep: github.com/ponylang/peg @ 0.1.0
No dep bundle for: github.com/ponylang/peg

Which is horribly misleading given that the locator doesn't exist at all.

I propose this is addressed in two parts. Fix the bug of it not indicating the error on fetch. Enhance to validate a locator on addition.

And reported in #118 which I am going to close.

SeanTAllen avatar May 18 '20 01:05 SeanTAllen

So the issue is that as the code currently is written, it figures out the VCS to use based on the suffix.

Without a suffix, it resorts to using the NoneVCS which is what you would want for using local dependencies that aren't VCS controlled but otherwise is problematic.

I'm giving serious consideration to saying you have to be explicit about the VCS if on adding, it can't be deduced from the locator. This would also allow for the possibility of validating additions (see #118).

@Theodus as you opened this issue, any thoughts adding another field to a dep for explicitly setting the VCS? It would usually be set automatically when adding.

That would mean that you could edit corral.json by hand and change it to "hg" from "git" without changing the locator which would probably be bad. but, once someone starts editing the file by hand, I think everything is out the window.

SeanTAllen avatar May 24 '20 21:05 SeanTAllen