pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 355 forks source link

Allow package installation from git repositories hosted anywhere #14000

Open khinsen opened 1 year ago

khinsen commented 1 year ago

Describe the request

Metacello supports loading packages from GitHub (documented) plus a few more undocumented sources (gitlab, gitlocal, ...). It should permit loading packages from any git repository hosted anywhere: other forges, and private git servers.Whatever git can clone from should be OK for Metacello as well.

Expected behavior

Metacello new
    baseline: 'MyPackage';
    gitRepository: 'git@myserver.net:mypackage.git';
    load.

should be acceptable (or some variant).

Expected development cost

I don't know. I don't even understand why this doesn't work. I'd expect it to be easier to just pass on a repository reference to git, rather than take the information in a more restricted format and then construct the reference from that. I suspect there are good reasons, related to how Metacello and/or Iceberg work, but I have no idea what those reasons are and what it would take to work around them.

khinsen commented 1 year ago

Two motivations for this request:

  1. It should be possible to host public Pharo packages somewhere else than on GitHub, and yet retain short and clear installation instructions. The day GitHub follows the lead of Twitter and Reddit, what will happen to Pharo if it has no other place to go?
  2. It should be possible to host private Pharo packages privately, on a personal git server, without spending two hours searching for how to do this and finding only complicated solutions.
astares commented 1 year ago

It should be possible to host private Pharo packages privately, on a personal git server

I tried a few options in the past:

All were working fine. I think Gitea and other will work too.

Gogs: A painless self-hosted Git service
Gogs is a painless self-hosted Git service.
The DevSecOps Platform
From planning to production, bring teams together in one application. Ship secure code more efficiently to deliver value faster.
Bitbucket
Bitbucket | Git solution for teams using Jira
Bitbucket Cloud is a Git-based code and CI/CD tool optimized for teams using Jira.
khinsen commented 1 year ago

Thanks for the comment @astares, that sounds good. But... what's the Metacello incantation to load packages from all these sites?

astares commented 1 year ago

I tried with Iceberg only, just to store and retrieve a simple project.

I guess you want wider support for Metacello loading with all dependencies for all available git hosting tools. It is my understanding that unfortunately can not have a generic mechanism for Monticello/Metacello (see class comment in MCGitRemoteRepository):

WARNING: This repository is meant to be used with iceberg and it will not work with plain Monticello/Metacello (because there is no way to know how to download a zip)

So additional tools and schemes would require an own subclass of MCPrivateHostableRepository, ...

Ducasse commented 1 year ago

May be the documentation here is helping https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md

I agree with you that it would be better if we can. Now I would like to remove Metacello :).

GitHub
pharo-wiki/General/Baselines.md at master · pharo-open-documentation/pharo-wiki
Wiki related to the Pharo programming language and environment. - pharo-wiki/General/Baselines.md at master · pharo-open-documentation/pharo-wiki
khinsen commented 1 year ago

All I see in that documentation (or any other I found so far) is GitHub, GitLab, Bitbucket. Let's assume I want to use the forge that my employer (French CNRS) provides: https://src.koda.cnrs.fr. That's a GitLab instance, but it's not gitlab.com. As far as I can see, there is no straightforward way to load a package from that forge.

The comment on MCGitRemoveRepository looks surprising. If I load a package from GitHub, this does create a local checkout of the git repository via Iceberg. So why does Metacello require a way to download a zip archive? Also, Metacello does allow gitlocal, although it is badly documented. So... no zip archive either!

I also found this package, which clearly is a workaround for this issue.It uses Iceberg to make a local clone and then feeds it to Metacello via 'gitlocal'. Could something like this be integrated into Pharo by default? Or is that approach too hacky/unstable/whatever?

GitLab
Sign in · GitLab
Koda : Forge des laboratoires
jecisc commented 1 year ago

IIRC I was able to load depend on a project that was hosted on a self hosted gitlab that even had a non default SSH port (I remember I had to add the support for this). But I don’t remember the pattern I used to do that :/

JanBliznicenko commented 4 weeks ago

I believe it is possible, this works for me:

Note that Metacello cannot handle subgroups.

Or you can just use Git Repositories Browser (Iceberg).