On Thu, Oct 18, 2012 at 10:41:27AM +0100, Sam Thursfield wrote:
On 10/18/2012 10:29 AM, Richard Maw wrote:
>On Wed, Oct 17, 2012 at 01:48:14PM +0100, Sam Thursfield wrote:
>>This change causes 'morph petrify' to avoid petrifying any chunk whose
>>ref matches the current system branch, because it makes no sense to
>>petrify something that is also being edited.
>
>What about a release branch, where part of the release process is to
>brand your component with the release name, and this change doesn't go
>into the main line of development, so it's clear that any builds that
>aren't from a release are development versions.
>
>In this case it would be wasteful to have to create a branch for the
>branding change, then create another branch for releasing with the
>branding.
The best way to solve this would be to have a way of passing a
parameter to the chunk from the system or stratum morphology or some
other mechanism, so it didn't require manual editing on each
release.
Lacking that, the procedure would be this:
morph branch baserock:morphs release/tracy-island master
morph edit base-system-x86_64-generic foundation foo
... edit branding ...
morph petrify
As long as nobody commits on the release/tracy-island branch in foo
then the integrity of the release is preserved.
However, maybe this isn't good enough - do you think we need a
'petrify --full' or some such command?
I think that leaving the release branch around will probably be enough
for the release use-case. A full petrify may be wanted to ensure it
cannot change at all, but some way of making Trove prevent changes to
release branches would also work.
Releases are special enough that it may be worth having another command
for it, to be run after petrifying, which makes signed tags for all the
components.
If we had that, releases would be different enough anyway that we don't
need to care that releases are a little special when it comes to
petrifying.
>>+ else:
>>+ strata[key] = stratum_info['ref']
>>+ stratum_info['ref'] = branch
>> self.save_morphology(root_repo_dir, name, morphology)
>>
>>+ for (repo, morph), ref in strata.iteritems():
>>+ repo_dir = self.edit_stratum(
>>+ branch, branch_path, root_repo, root_repo_dir,
>>+ { 'repo': repo, 'ref': ref, 'morph':
morph})
>
>You could probably use locals() here instead of creating the dict, but
>it's probably better like this.
My other thought was storing the stratum_info dict in 'stata'
instead of just the ref, so we could pass it ... but I was meant to
be writing documentation anyway :)
Yeah. I'm happy with it as it is.
>>+
>>+ stratum = self.load_morphology(repo_dir,
stratum_info['morph'])
>>+
>>+ for chunk_info in stratum['chunks']:
>>+ if chunk_info['ref'] != branch and \
>>+ 'unpetrify-ref' not in chunk_info:
>
>PEP8 says to use parentheses rather than \ to handle line breaks in long
>expressions, but if it turns out to be the only problem I'm happy to fix
>that up in the merge.
Fine by me (I'm pretty sure I've made that mistake in a few other places)
Given that's the only code change needed, I'm going to merge.