Shards: github ambiguous sources

Created on 28 Jan 2021  路  4Comments  路  Source: crystal-lang/shards

I'm getting some ambiguous sources errors when updating shards.
I have solved the problem temporarily by using shard.override however I think there is a better way, at least for github

The issue is that two separate shards are depending on retriable

dependencies:
  retriable:
    github: Sija/retriable.cr

and

dependencies:
  retriable:
    github: sija/retriable.cr

note the difference in case on sija

However github is case insensitive when if comes to URLs so I propose that for github dependencies the URLs are downcased to avoid errors like this:

Error shard name (retriable) has ambiguous sources: 'git: https://github.com/Sija/retriable.cr.git' and 'git: https://github.com/sija/retriable.cr.git'.

which would greatly improve the experience of using shards

enhancement

Most helpful comment

But github/gitlab/bitbucket URLs on git key should get their paths normalized as well.

All 4 comments

Related: spider-gazelle/rethinkdb-orm/issues/14

Sure, this should not be detected as an ambiguous source. It can be handle in Git.normalize_key_source

Would it be enough to normalize when github: is used, or should it also be lowercased when git: https://... is used?

If so, we should not transform user/password to avoid breakinig https://<token>@github.com/owner/repo.git or https://<token>:[email protected]/owner/repo.git private repos.

I wouldn't downcase every http URL. Some providers may use case sensitive paths. So we should only do that when we know the provider treats it insensitive. It's easier to fix a mismatched spelling than not being able to install a dependency because it requires capital letters in the URL.

But github/gitlab/bitbucket URLs on git key should get their paths normalized as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

j8r picture j8r  路  6Comments

vladfaust picture vladfaust  路  5Comments

paulcsmith picture paulcsmith  路  8Comments

anatol picture anatol  路  3Comments

ysbaddaden picture ysbaddaden  路  7Comments