Jump to content


Release Stream Import Inheritance

streams import release

  • Please log in to reply
8 replies to this topic

#1 ccostes

ccostes

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 12 March 2018 - 07:25 PM

When I create release streams I copy the parent view to "freeze" the release stream's imports. This was working fine until a new import path was added to the parent, which was inherited to the release. This is obviously not desired behavior, as the newly imported file didn't even exist when the release was created.

Is there any way to prevent this from happening?

Thanks,
Chris

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 518 posts

Posted 12 March 2018 - 08:32 PM

Unfortunately not -- all stream paths get inherited from the parent automatically, so if the parent adds an import, all its children get the import.  An import itself can be locked to a particular depot version, but you can't lock your stream path inheritance the same way (e.g. you can't say "Parent: //stream/main@1000").

There was a notion at one point to do something along these lines as part of broader component-based development support, but I think that development shifted into a set of add-on scripts; you might check those to see if there's something that'll give you that sort of control over imports:  https://swarm.worksh...ce-software-cbd

#3 ccostes

ccostes

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 13 March 2018 - 02:11 PM

Calling it a "Release Stream" seems like a misnomer if you can't lock it down to always represent the code you released. I guess it would work if you don't use imports, but that's the reason I switched to streams in the first place. The merge/copy stuff is nice, but to me imports were the killer feature; unfortunately they seem a little half-baked. :(

#4 ccostes

ccostes

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 13 March 2018 - 03:54 PM

Came up with a (somewhat janky) workaround for this. Once a release stream is created, and the view is fully-defined with all desired imports, change the 'parent' from the actual mainline to an empty mainline. This way there are no imports in the parent to override what's defined in the release.

If you need to merge changes down from the release you can temporarily change the parent back to the real mainline, but otherwise keep it set to the 'null' mainline.

Not very elegant, but I think it will achieve the desired behavior.

#5 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 518 posts

Posted 13 March 2018 - 05:57 PM

View Postccostes, on 13 March 2018 - 03:54 PM, said:

Came up with a (somewhat janky) workaround for this. Once a release stream is created, and the view is fully-defined with all desired imports, change the 'parent' from the actual mainline to an empty mainline. This way there are no imports in the parent to override what's defined in the release.

That was essentially the idea for the native version!  Rather than having imports get inherited automatically as part of the Paths, you'd be able to specify them separately so that they'd be copied at the time the child stream was created rather than inherited dynamically.  That way changes to the parent wouldn't automatically propagate to the child, but when you merged, the imports would get merged (same as the files) so you could still share changes but you could decide when (and in what direction).

I'm sure with fancy trigger scripts you could accomplish something close to that behavior -- your idea of making everything a mainline as a workaround to disable inheritance is clever, I'd never thought of that one.  :D

#6 ccostes

ccostes

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 13 March 2018 - 06:14 PM

That would be so much better! It's always bugged me that import settings are not version controlled. I do that manually by copy/pasting the imports into a file that gets checked in and have a jenkins script to ensure that it matches the stream settings during the build.

View PostSambwise, on 13 March 2018 - 05:57 PM, said:

your idea of making everything a mainline as a workaround to disable inheritance is clever, I'd never thought of that one.  :D

I was actually creating an empty mainline and setting the release stream's parent to point to that, but you're right that you could just change the stream type of the release to mainline and achieve the same effect with less effort.

#7 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 216 posts

Posted 02 April 2018 - 08:50 PM

A better solution to lock the release line from inheriting imports from the mainline is to add import lines in the release stream that mimic the import lines in the parent stream, but specify a changelist.

Note @42208 below on a stream specification:

import file_count/1000_0k/... //fromregular/fromregulardev/file_count/1000_0k/...@42208

This will freeze the imported lines to a particular time.  Then you won't need to make a release line into a mainline.

I've added your name to a request to make release streams not inherit imports.

#8 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 518 posts

Posted 02 April 2018 - 09:39 PM

View Postp4rfong, on 02 April 2018 - 08:50 PM, said:

A better solution to lock the release line from inheriting imports from the mainline is to add import lines in the release stream that mimic the import lines in the parent stream, but specify a changelist.

Note @42208 below on a stream specification:

import file_count/1000_0k/... //fromregular/fromregulardev/file_count/1000_0k/...@42208

This will freeze the imported lines to a particular time.  Then you won't need to make a release line into a mainline.

I've added your name to a request to make release streams not inherit imports.

The problem here is that if an import is added to the mainline, it instantly shows up in the release line -- you can't pre-emptively isolate yourself from new import paths added to the parent (except by not having a parent).

#9 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 216 posts

Posted 10 April 2018 - 01:24 AM

Agreed, you do have to change the release line every time the parent line has an import line added.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users