metacello icon indicating copy to clipboard operation
metacello copied to clipboard

Add baseline reference to a changeset file?

Open LinqLover opened this issue 3 years ago • 5 comments

Hi,

not sure whether this is the right place for such a question/feature request, but in my BaselineOfMyWonderfulProject, I'd like to specify the requirement of a package to a changeset file that is available via an HTTP(S) server. Does Metacello support this? Is there any list of the supported repository formats?

Pseudocode would be something like this:

baseline: spec
	<baseline>
	spec for: #common do: [
		spec
			package: 'ShoutAttribute' with: [
				spec repository: 'https://gist.githubusercontent.com/LinqLover/f2a0a189a00aa1484b481c805629e517/raw/e7850041758e02a536a0e32b54bf0b99785bebc3/ShoutAttribute.cs'].
		spec
			package: 'MyWonderfulPackage' with: [
				spec requires: #('ShoutAttribute')]].

Or is this generally impossible because changesets do not provide any necessary metadata?

LinqLover avatar Oct 06 '20 22:10 LinqLover

Can't something like this be done in a postLoad method?

fniephaus avatar Oct 07 '20 11:10 fniephaus

AFAIK this can be done with a specifc subclass in metacello. There are such things for filetree+git, http+monicello, files+monitcello etc; The filetree/cypress variant also works with cuis (https://github.com/CampSmalltalk/cuis-cypress).

There might be too many ways to do that and potentially none of the really feasible 🤪

krono avatar Oct 07 '20 11:10 krono

Can't something like this be done in a postLoad method?

Hypothetically, yes, but 1) I would consider it more convenient if Metacello could handle all the required connection and filein logic, and 2) I would need to check in my postLoad whether the requiring package has actually been loaded. Imagine a third package in the baseline above, spec package: 'MyGreatPackage' which does not require 'ShoutAttribute', so the changeset should also not be installed when only loading 'MyGreatPackage'.

AFAIK this can be done with a specifc subclass in metacello.

But maybe with the difference that git, Monticello, etc. all specify some amount of version information? Just asking, I am not familiar with the source at all. :-)

LinqLover avatar Oct 07 '20 11:10 LinqLover

Le mer. 7 oct. 2020 à 13:28, Christoph Thiede [email protected] a écrit :

Can't something like this be done in a postLoad method?

Hypothetically, yes, but 1) I would consider it more convenient if Metacello could handle all the required connection and filein logic, and 2) I would need to check in my postLoad whether the requiring package has actually been loaded. Imagine a third package in the baseline above, spec package: 'MyGreatPackage' which does not require 'ShoutAttribute', so the changeset should also not be installed when only loading 'MyGreatPackage'.

AFAIK this can be done with a specifc subclass in metacello.

But maybe with the difference that git, Monticello, etc. all specify some amount of version information? Just asking, I am not familiar with the source at all. :-)

The version information only matters if you have multiple change sets to choose from; a solution used by FileTree is to say that everything is version 1 (i.e. no version handling).

One could also add a Monticello repository subclass to designate folders where the changesets are kept (and the change in Metacello to have a changeset url handling). This would also allow integration in the Monticello GUI tools.

ThierryGoubier avatar Oct 07 '20 12:10 ThierryGoubier

FYIO, a naive solution for my original desire exists in https://github.com/LinqLover/TelegramSmalltalkBot/blob/2ea661dd88d23084f40e2865d2379570c72d0140/src/BaselineOfTelegramSmalltalkBot.package/BaselineOfTelegramSmalltalkBot.class/instance/installPreviewDependencies.st (also copied with slight variations to https://github.com/LinqLover/TelegramBot and https://github.com/LinqLover/SimulationStudio), which is based on postLoad scripts.

I'm still not very happy with this (see also https://github.com/LinqLover/TelegramSmalltalkBot/issues/15) because it does not use any meta information at all, but if you need a fast solution, you might want to copy this :)

LinqLover avatar Mar 17 '21 23:03 LinqLover