Creating parcels with version string - how?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating parcels with version string - how?

Joachim Geidel
Hi all,

I would like to create parcels from bundles which are already versioned
in Store. And I would like to do this in a way which includes the
version string in the parcel, but without having to publish the
(unchanged) bundle again. I don't want to assign a new version string
just because I am generating a parcel file. "Publish as parcel" creates
parcels without version information.

Is there a way to do this? Or do I have to publish the bundle in Store
and use the "Parcel options" of the publishing dialog at the same time
(and as a side-effect create new versions in Store which are exactly the
same as their parent version)?

Best regards,
Joachim Geidel

Reply | Threaded
Open this post in threaded view
|

RE: Creating parcels with version string - how?

Boris Popov, DeepCove Labs (SNN)
You can create a parcel from any pundle and save it to an arbitrary
location,

pundle
 saveAsParcel: (dir construct: label)
 saveStructure: false
 saveLinks: false
 parcelOptions: ((Dictionary new)
                   at: #parcelSaveSource put: false;
                   yourself)

Is this something you're looking for?

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

> -----Original Message-----
> From: Joachim Geidel [mailto:[hidden email]]
> Sent: Thursday, March 15, 2007 2:06 PM
> To: vwnc-list
> Subject: Creating parcels with version string - how?
>
> Hi all,
>
> I would like to create parcels from bundles which are already
versioned
> in Store. And I would like to do this in a way which includes the
> version string in the parcel, but without having to publish the
> (unchanged) bundle again. I don't want to assign a new version string
> just because I am generating a parcel file. "Publish as parcel"
creates
> parcels without version information.
>
> Is there a way to do this? Or do I have to publish the bundle in Store
> and use the "Parcel options" of the publishing dialog at the same time
> (and as a side-effect create new versions in Store which are exactly
the
> same as their parent version)?
>
> Best regards,
> Joachim Geidel

Reply | Threaded
Open this post in threaded view
|

Re: Creating parcels with version string - how?

Joachim Geidel
In reply to this post by Joachim Geidel
I just found a way to add the version string:

- Load the parcel.
- Open a browser, switch to the parcel view, select the parcel.
- Select the "Properties" tool, go to "Other properties".
- Add a new field named "version" to the "Other properties" dictionary,
  and set the value to the version string.
- Save the parcel again.

But now, the parcel has a property "packageName" in addition to the
"bundleName". When I load it, the bundle structure is not restored, and
everything is loaded in a package with the same name as the original
bundle. That's of course not what I wanted.

> I would like to create parcels from bundles which are already versioned
> in Store. And I would like to do this in a way which includes the
> version string in the parcel, but without having to publish the
> (unchanged) bundle again. I don't want to assign a new version string
> just because I am generating a parcel file. "Publish as parcel" creates
> parcels without version information.
>
> Is there a way to do this? Or do I have to publish the bundle in Store
> and use the "Parcel options" of the publishing dialog at the same time
> (and as a side-effect create new versions in Store which are exactly the
> same as their parent version)?
>
> Best regards,
> Joachim Geidel
>

Reply | Threaded
Open this post in threaded view
|

Re: Creating parcels with version string - how?

Joachim Geidel
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Boris Popov schrieb am 15.03.2007 22:23:

> You can create a parcel from any pundle and save it to an arbitrary
> location,
>
> pundle
>  saveAsParcel: (dir construct: label)
>  saveStructure: false
>  saveLinks: false
>  parcelOptions: ((Dictionary new)
>                    at: #parcelSaveSource put: false;
>                    yourself)
>
> Is this something you're looking for?

Thanks for pointing to this method. It does not add the version string
of the pundle to the properties of the parcel, but I found a method
which can be overridden to add it. CodeComponent>>propertiesForSave
creates the Dictionary which is used as the properties for the parcel.
If it contains the key #version, the corresponding value will be written
to the header of the parcel file (CodeWriter>>storeHeader).

After adding the following method to PundleModel, the parcel had a
version string, and also recreated the bundle structure after load.

propertiesForSave
        | forSave |
        forSave := super propertiesForSave.
        forSave at: #version put: self traceVersionString.
        ^forSave

traceVersionString is not exactly what I wanted, as it has the form
        (version,username)
It's too late now on this side of the Atlantic, I'll look into
retrieving the version string tomorrow.

Best regards,
Joachim Geidel

Reply | Threaded
Open this post in threaded view
|

Re: Creating parcels with version string - how?

Travis Griggs-3
In reply to this post by Joachim Geidel
On Mar 15, 2007, at 14:05, Joachim Geidel wrote:

Hi all,

I would like to create parcels from bundles which are already versioned
in Store. And I would like to do this in a way which includes the
version string in the parcel, but without having to publish the
(unchanged) bundle again. I don't want to assign a new version string
just because I am generating a parcel file. "Publish as parcel" creates
parcels without version information.

Is there a way to do this? Or do I have to publish the bundle in Store
and use the "Parcel options" of the publishing dialog at the same time
(and as a side-effect create new versions in Store which are exactly the
same as their parent version)?

Joachim,

You may take a look at StoreExtensions. It may not do exactly what you want, but is likely a good starting place, and maybe a good place to provide some increased functionality.

It adds (amongst other things) a menu option called "Deploy (w/ prerequisites)". This option will publish your package as a parcel. It does some things that may be nice for you:

1) It makes the version string of the parcel match that of the package. This is great for in field installs, so you can audit what components your system is currently composed from
2) It will note if your package that you're publishing is "dirty" (i.e. has unpublished changes). In that case, it will place a [dev] at the end of the version name, so you can differentiate deployed parcels without a package version audit trail from those that would.
3) It can do prerequisites as well (sounds like you're doing bundles, so maybe you'll neuter this part?)
4) This is my favorite... it will detect when a parcel of that version is already there. I.e. if you've published Foo 13 as a parcel, and you go to do it again, either directly or through prereq, it will skip it (of course, when it sees the [dev] it won't skip it). This is really nice when you go to publish a whole parcel tree and it's able to determine that 90% of them don't need to be republished. Makes it go much faster.

At the time I wrote this, doing what you want to do was rather tricky. There was no easy way to inject a new property into the new parcel without really ripping the code path apart. So I had to temporarily add the property to the package during the publish. But that was tricky, because it wants to see that as a "change" to the package thus marking it dirty. Anyway, this was eventually made to work, been to long to remember the details. I know the guys at Key use this code in production a lot. Literally 1000's, if not 10,000's of parcels have been published with this mechanism.

--
Travis Griggs
Objologist
"HTTP. It's like a bike pretending to be a bus, a bulldozer, and a cup of coffee at the same time." - Martin Kobetic


Reply | Threaded
Open this post in threaded view
|

Re: Creating parcels with version string - how?

Joachim Geidel
Travis Griggs schrieb am 16.03.2007 02:19:
> You may take a look at StoreExtensions. It may not do exactly what you
> want, but is likely a good starting place, and maybe a good place to
> provide some increased functionality.
>
> It adds (amongst other things) a menu option called "Deploy (w/
> prerequisites)". This option will publish your package as a parcel. It
> does some things that may be nice for you:

...and I had this loaded all the time without ever using it. Sigh...

It's almost what I wanted in the first place (and more). I think I'll
just deploy the parcelized packages, and add an empty "Install" package
with lots of prerequisites as a replacement for the bundles. This won't
recreate the bundles, but if somebody wants the bundles, there is still
the Store repository to load from.

Thanks a lot!

Joachim

Reply | Threaded
Open this post in threaded view
|

AW: Creating parcels with version string - how?

Christian Haider
In reply to this post by Joachim Geidel
Hi Joachim,

I do it by adding an extension to PundleModel

        setVersionSilentlyTo: aString
                "set silently - dont notify anybody"
                properties at: #version put: aString

since the properties are not accessible directly otherwise.

My publishing code then looks like:

        publishAsParcelTo: aDirectory
                | basename options |
                basename := (aDirectory construct: self parcelOutName)
asString.
                options := Dictionary new.
                options at: #parcelSave put: true.
                options at: #databaseLinks put: false.
                options at: #bundleStructure put: false.
                options at: #parcelDirectory put: basename.
                options at: #parcelOverwrite put: true.
                options at: #parcelSaveSource put: self
publishWithSource.
                options at: #parcelPadded put: true.
                self codeComponent setVersionSilentlyTo: self
versionString.
                self codeComponent
                        saveAsParcel: basename asFilename
                        saveStructure: false
                        saveLinks: false
                        parcelOptions: options

(self is my class for Code, and self codeComponent is the PundleModel in
this case).

HTH,
        Christian

> Von: Joachim Geidel [mailto:[hidden email]]
>
> Hi all,
>
> I would like to create parcels from bundles which are already
> versioned
> in Store. And I would like to do this in a way which includes the
> version string in the parcel, but without having to publish the
> (unchanged) bundle again. I don't want to assign a new version string
> just because I am generating a parcel file. "Publish as
> parcel" creates
> parcels without version information.
>
> Is there a way to do this? Or do I have to publish the bundle in Store
> and use the "Parcel options" of the publishing dialog at the same time
> (and as a side-effect create new versions in Store which are
> exactly the
> same as their parent version)?
>
> Best regards,
> Joachim Geidel
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Creating parcels with version string - how?

Travis Griggs-3
In reply to this post by Joachim Geidel
On Mar 16, 2007, at 3:18, Joachim Geidel wrote:

Travis Griggs schrieb am 16.03.2007 02:19:
You may take a look at StoreExtensions. It may not do exactly what you
want, but is likely a good starting place, and maybe a good place to
provide some increased functionality.

It adds (amongst other things) a menu option called "Deploy (w/
prerequisites)". This option will publish your package as a parcel. It
does some things that may be nice for you:

...and I had this loaded all the time without ever using it. Sigh...

It's almost what I wanted in the first place (and more). I think I'll
just deploy the parcelized packages, and add an empty "Install" package
with lots of prerequisites as a replacement for the bundles. This won't
recreate the bundles, but if somebody wants the bundles, there is still
the Store repository to load from.

Glad to be of service. :)

One of the nice things I found about this approach, is it defers the "what to do with these packages" to a different point. It may be that you want to have a worker image which loads them and does some analysis. It may be a worker image that loads them, and then runs all of the tests and emails the results to known targets. It may be to load them, and then start up a UI.

Did you know that there's also a query in there for "dirty packages"? I find/found this useful for "doing a unit of work" and then just hitting "dirty packages" and then "publish".

And if you load the very latest version, there's a silent merge option in there. It's called "Upsync" or something like that.

--
Travis Griggs
Objologist
My Other Machine runs OSX. But then... so does this one.