RTC + Jenkins: Why is a new snapshot always created?
I made some experiences using RTC and Jenkins to understand how and when snapshots are created. These were the scenarios:
Supposing I have a snapshot on a Stream, and several changeset on top of it. If I request a build from that Stream, no snapshot is created, but what is getting actually built in this scenario? Finally, in the item 1 above, a new snapshot is created even if there are no changesets to be accepted. Is there any other reason to create snapshots in this case? |
Accepted answer
Hi Rafael,
> Therefore, I'm assuming that snapshots are created only when an Accept is performed. Is this right?
Yes.
> Supposing I have a snapshot on a Stream, and several changeset on top of it.
It will build the latest in the stream, ignoring any past snapshots. Note that if you're building directly against the stream, there's no isolation from ongoing deliveries to the stream while the build is running, so what gets loaded may not be consistent.
> a new snapshot is created even if there are no changesets to be accepted. Is there any other reason to create snapshots in this case?
Not particularly, but this way each build gets its own snapshot, so if others get deleted there's no downstream impact. The snapshot also gets a label that's consistent with the build's. This could be optimized out, but snapshots are actually pretty lightweight (it will point to previously created baselines). An extra compare between last snapshot and latest build workspace state would be needed too.
Rafael Rezende selected this answer as the correct answer
Comments
Rafael Rezende
commented Jul 28 '14, 5:42 a.m.
Hi Nick,
Interesting scenario. Since 5.0, we have the snapshotPublisher Ant task that allows the snapshot contribution for the build to be updated. This was added to support the use case where the build itself delivers changes back to the stream, and you want to include those in the (new) snapshot for the build.
Although we don't currently support building directly against a snapshot (see Allow building against existing snapshot (90272)), this can be scripted using the SCM CLI to populate the build workspace from a referenced snapshot. So it should be possible to model your arrangement.
Rafael Rezende
commented Jul 29 '14, 9:32 a.m.
If I create a new Repository Workspace from a Snapshot via RTC client, and run a personal build against it, the resulting Build Result will not have a link to the Snapshot that generated the Repository Workspace first place.
1
Yes, that's correct. It's also possible to do some of these things using scripting, e.g. see https://jazz.net/wiki/bin/view/Main/GroovyScripting
This has the advantage of working against earlier versions of RTC, as long as you limit yourself to the APIs available then.
If you'd like to explore this, i.e. replacing the snapshot contribution, I'd be happy to help.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.