2

In the baseline of ConfigurationOfMyProject i require project Something:

spec project: 'Something' with: [
   spec
      className: 'ConfigurationOfSomething';
      repository: 'http://smalltalkhub.com/mc/SomeOne/Something/main';
      versionString: '1.0' ].

The maintainer of ConfigurationOfSomething committed a new version of ConfigurationOfSomething that contains a bug. So my ConfigurationOfMyProject does not load anymore.

Can i require a specific version of ConfigurationOfSomething like:

spec project: 'Something' with: [
   spec
      className: 'ConfigurationOfSomething';
      repository: 'http://smalltalkhub.com/mc/SomeOne/Something/main';
      monticelloVersion: 'ConfigurationOfSomething-SomeOne.125'
      versionString: '1.0' ].
MartinW
  • 4,966
  • 2
  • 24
  • 60

2 Answers2

2

Yes, you can use the #file: message to force loading a specific version.

spec project: 'Something' with: [
   spec
      className: 'ConfigurationOfSomething';
      file: 'ConfigurationOfSomething-SomeOne.125'; 
      repository: 'http://smalltalkhub.com/mc/SomeOne/Something/main';
      versionString: '1.0' ].

See the Metacello API for an overview.

Johan B
  • 2,461
  • 14
  • 16
  • That’s what i was looking for. But as @Stephan-Eggermont said, it is not a good solution for my problem. What is the intended usecase for `file:`? – MartinW Jan 29 '14 at 12:34
  • 1
    Sometimes you don't know (yet) how to avoid referring to a static version, or maintainers are moving in a direction you don't like. Here you *know* what version you get. – Stephan Eggermont Jan 30 '14 at 16:50
  • 1
    Something like that. I would say it as follows: when you work on a project you want to decide when to pull in changes to the libraries/projects you are using. It is just awfully painful that your project starts to fail building and/or executing a day before the deadline and that just because someone broke the configuration or updated the #stable version to something that is not stable at all. – Johan B Jan 30 '14 at 16:57
1

You could, but probably don't want to. The consequence of doing what you suggested above, is that you are creating a snapshot that can no longer be patched. [Snapshot versions should not be in a configuration. They are a separate concept, needing their own class]. With about the same amount of effort, you can take a look at the changes that were made in version 126, and make sure you get those.

If you open the repository with the monticello browser, you select version 126 and then history. Select version 125 in the history, and view changes in the context menu. There you see that default was changed (and a new baseline was added). If you now make default (or stable) dependent on your needs, you can save a new version of the configuration. Just make sure you make the change in the latest version.

spec for: #'common' version: '2.1'.
spec for: #'pharo1.3.x' version: '2.2'.
spec for: #'pharo1.4.x' version: '2.4'.
spec for: #'pharo2.x' version: '2.5'.
spec for: #'pharo3.x' version: '2.6-snapshot'.

[edit] If the issue is closed with WontFix, that often means not enough time to do all the work to fix it. You can get better results by showing that the fix works for your needs, and preferably also the latest image using this code. So just make this change in a local package (in a clean image) and try it. If you can report that it works, I'll make the change :)

Stephan Eggermont
  • 15,847
  • 1
  • 38
  • 65
  • So what you are suggesting is, that i rather make **my own** version of `ConfigurationOfSomething` in my own repository, so i can control it? – MartinW Jan 27 '14 at 11:48
  • No, just fix it for all – Stephan Eggermont Jan 27 '14 at 12:03
  • Haha, ok. So we are talking about Glamour here and i was a bit discouraged as they closed the related error with „WontFix“ and said they do no longer support Pharo 2.0. Also i doubt that i have the knowledge to fix it without breaking something else. – MartinW Jan 27 '14 at 12:08
  • Just try locally first. We do have continuous integration, break and fix sometimes is easier :) – Stephan Eggermont Jan 27 '14 at 12:24
  • Ok. So for the Stackoverflow question above i take as answer, that specifying a concrete file is possible, but not a good sulution for my problem. – MartinW Jan 29 '14 at 12:32
  • 1
    It is a quick solution that solves your direct problem, but forces you to do work to keep up with changes. Avoid future work wherever possible ;) – Stephan Eggermont Jan 30 '14 at 16:54