-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Alright, time to try to turn a monster of a Slack thread into something actionable. Let's do this.
Based on that discussion, this is the list of tools I'm interested in for fighting dependency confusion.
- scopes: a common name grouping a collection of gems. In gem name references, they're prefixed with an
@.- Example: I could have the
@duckinatorscope, and maybe have@duckinator/boopand@duckinator/jim. - PURPOSE: gem names no longer have to be unique across a given server.
- Example: I could have the
- canonical gem URIs: treating the gem server you upload to as the "canonical" host, the canonical URI would be
${CANONICAL_HOST}/${SCOPE}/${GEMNAME}.- Example: If I upload
jimin the@duckinatorscope togem.coop, the canonical gem URI would behttps://gem.coop/@duckinator/jim - PURPOSE: scopes no longer have to be unique across all gem servers.
- Example: If I upload
- views: using alternative URLs to change what collections of gems RubyGems and Bundler can "see".
- Idea: If gem.coop does not populate the unscoped namespace by default, we can use views to populate it.
- Example:
https://some-company.gem.coopcould only allow access to gemssome-companyhas authorized. - Example:
https://rgo.gem.coopcould show only things mirrored fromRubyGems.org. - PURPOSE: Provides a more formal mechanism for private mirrors that override certain gem names.
- gem author verification: I don't know anything about this, I defer to more knowledgeable folks. ❤️
I have a proof of concept adding Bundler support for scopes and canonical gem URIs. GitHub Packages has "namespaces" that are just a GitHub username or organization name, and it works very similar to my idea for scopes. However, since their "namespaces" don't have a leading @, my proof-of-concept has a kludge for the GitHub Packages hosts specifically. This means it can be tested in the real world, against a production-quality server, right now.
I think my rationale is best explained with (this slightly-cleaned-up version of) something I said earlier today:
I think we should be taking this as an opportunity to decentralize, not create a new Pillar Of Truth™️.
I'd rather see a larger number of smaller gem servers, and make our tooling support that idea.
Especially since to my knowledge we have never, at any point, had just one gem server.Gemspecs are inherently lying to you by claiming there's only One Source Of Truth.
Or, to put it another way: We always had multiple gem servers in the wild. Starting gem.coop didn't create new problems, it highlighted ones people have known about for over 20 years. We should use this as an opportunity to address those problems.