Getting the Comments for a Store Publish
You would think that getting the version comment for a package or bundle you've published to Store would be simple - there's a method called #versionComment right there in Pundle - but you would be mistaken. No, that's not the comment you type into the text field when you publish.
Why do I care? Well, as part of my build automation work, I'm generating a small report, and part of that report involves pulling out the comment for a published package. That takes more work to get at than you might think:
pkg := (Store.Package withName: 'PkgNameHere' version: 'versionStringHere') first. blessing := (Blessing blessingsForRecordID: pkg primaryKey type: pkg typeStringForBlessing) first. comment := blessing getCommentString.
Just tracing Store code to figure that out was painful; the comparison tool Version Browser doesn't make it obvious. Then there's the whole head scratching nature of "why isn't there a method that does this for me in Pundle?" Anyway, that does the job I wanted, and now I have that bit of my reporting task handled.
Comments
Re: Getting the Comments for a Store Publish
[Alan Knight] January 13, 2011 21:59:59.452
Of course, in a current version
package := StoreLoginFactory currentStoreSession readOneOf: StorePackage where: [:each | each name = 'PkgNameHere' & (each version = 'versionStringHere)].
package blessings first comment.
But there can be more than one comment - one per blessing, so you might really want to collect them all.
Re: Getting the Comments for a Store Publish
[Travis Griggs] January 14, 2011 4:41:27.491
"...the comparison tool doesn't make it obvious." Not sure what you mean here? How would the comparison tool tell you how some code works?
I'll try to make the tools better, if you tell me what you mean. :)
Re: Getting the Comments for a Store Publish
[James Robertson] January 14, 2011 6:30:55.647
Alan - I still say that a convenience method to grab all the comments as one entity would be useful, but yes. Travis - the Comparison tool was a typo - I meant the version browser. The code in there was pretty unobvious when I started trying to trace it.