[Glass] Bootstrap package update warning with ConfigurationOfGLASS1

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Thu Feb 12 11:45:03 PST 2015


Mariano,

This email went into the google spam folder, so I didn't know it had 
been sent until you replied ... sorry about that...

You mention that there are two separate packages named "Bootstrap" and 
that is definitely the source of the Warning and could cause additional 
problems if not taken care of.

The way the Monticello works is that there are going to be two separate 
packages defined:
   - Bootstrap
   - Bootstrap-Core

If you happen load a new version of the Bootstrap package, then more 
than likely the entire contents of the Bootstrap-Core package will be 
removed from the system ... You didn't mentioned this particular issue 
yet (the last update to the Bootstrap package was in Jaunuary 16, 2015), 
but in the future if a new version is created, you can expect this to 
happen.

When you load a new version of Bootstrap-Core nothing in Bootstrap 
should be removed from the system, but the system will think that all of 
the Bootstrap-Core code "belongs" to the Boostrap package. I can easily 
imagine  that at a minimum the Bootstrap package could get marked as 
dirty when the Bootstrap-Core is loaded ... immediately after a load, 
the package is marked clean because it is marked as durty during the 
load and the Bootstrap package would not be cleaned up in this way.

I don't have the bandwidth right now to go fiddling around with GLASS1 
package names, so for the near term I would suggest that
   1. you ask Torsten to rename his packages ...
   2. copy the Bootstrap-Core package to your IAM repository and then 
rename the package yourself.

Unfortunately I think it is cleaner to rename a Monticello package by 
creating a new package and then "moving" the definitions into that new 
package and then saving it ... You lose all of the history this way, but 
when you save a package by just renaming it in the save prompt, you are 
not changing the underlying package name, and you will have even nastier 
problems ... I think ... If you want to be able to merge upstream 
changes, you can try doing an `adopt` on the old package and that might 
work, but I've never tried it ...

If you are using a git repository for your IAM project, then things 
aren't nearly as bad. Git doesn't need the monticello history to manage 
the rename and the process you'd use is:
   1. create a branch for the rename work
   2. copy the Bootstrap-Core package into the git repo.
   3. commit
   4. do the package rename as mentioned above (i.e., create a new 
package and "move" definitions)
   5. save the new package to your repo
   6. `git rm -rf` the old package directory
   7. commit
   8. merge this branch into you master branch

At this point git will have recognized that you've done a rename of all 
of the definitions in the package. To merge in a new version of the 
origin Bootstrap-Core package:
   1. checkout a new branch branch at the commit from step 3, above
   2. copy the new version of Bootstrap-Core into the repository
   3. commit
   4. checkout your master branch
   5. merge the new branch into the master (git merge --no-ff --no-commit)

At this point you should have all of the changes in your master branch 
and unless you've made changes to the contents of Bootstrap-Core three 
should be no conflicts, either.

Make sure that you've installed GitFileTree-MergeDriver[1] before doing 
the merge ... everyone using git and monticello should use this project 
... it automatically merges the monticello meta data (version file, and 
methodProperties files) for you ...

Also, be aware of the fact that on a merge into a renamed package that 
class categories and method protocol names need to be manually edited. 
The latest version of FileTree has a consistency check for this[2].

So that's pretty much "my thoughts" on this:)

Dale

[1] https://github.com/ThierryGoubier/GitFileTree-MergeDriver
[2] https://github.com/dalehenrich/filetree/issues/136
On 02/11/2015 10:21 AM, Mariano Martinez Peck via Glass wrote:
> Hi Dale,
>
> Every in a while (i cannot yet understand exactly when), I try to 
> update the code of my app via the webinterface (we have a button for 
> that) and I get an exception saying:
>
> "
>
>
>     Warning: You are about to load new versions of the following
>     packages that have unsaved changes in the image. If you continue,
>     you will lose these changes. Bootstrap
>
> "
>
> The code I use to update my app is:
>
>
> [ [ [
>
> Metacello image
> configuration: 'IAM';
> version: '1.5';
> onLock: [:ex | ex honor];
> load: #('Core' 'DPOFX').
>
> ]
>    on: MetacelloAllowConflictingProjectUpgrade
>    do: [ :ex | ex defaultAction ] ]
>    on: MetacelloAllowLockedProjectChange
>    do: [ :ex | ex disallow ] ]
>    on: MetacelloNameNotDefinedError
>    do: [ :ex | ex resume ].
>
>
>
> As far as I know, I have already migrated to latest GLASS, Seaside, 
> Metacello and Magritte some months ago.
>
> Any idea what could be going on? I also attach the full stack in case 
> this helps.
>
> In addition, let me tell you something even stranger. My app 
> (ConfigurationOfIAM) loads a package called Bootstrap-Core (which is 
> Twitter Framework) this way:
>
> spec package: 'Bootstrap-Core' with: [
> spec
> requires: #('Seaside');
> repository: 
> 'http://smalltalkhub.com/mc/TorstenBergmann/Bootstrap/main/' ].
> (note I am referencing directly the package rather than a project 
> ref..but that's another discussion).
>
> I have also noted that sometimes, if I click proceed in the above 
> warning, the twitter bootstrap package (Bootstrap-Core) is a bit 
> corrupted...classes no longer exists and the extension methods (over 
> WAHtmlCanvas etc...) disappear as well...
>
> Considering all the Monticello thingies of packages and subpackages 
> and the fact that Bootrstrap-Core is a substring of Bootstrap, that 
> make me doubt.
>
> Any thoughts?
>
> Thanks in advance,
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150212/1b3c9182/attachment.html>


More information about the Glass mailing list