-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: #2802 - let SnapshotSource reuse self-generated snapshot #2803
Conversation
I do not understand why #2802 is considered a bug. When you set the setting "ForceRegenerateSnapshots" to true, it will re-generate the snapshots, no matter what. This is the documented behaviour of this option:
This PR does not look like a fix, but a behavioural change. The "ForceRegenerateSnapshot" used to always regenerate the snapshot, now it will only renegerate it if it was not created by us. That's a breaking change that we should not make in a non-major version. Why don't you just set ForceRegenerateSnapshot to |
Design discussion will be continued on issue #2802. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is overall an improvement now. From what I've read this is what we're going with, so I'll pull it
I will also deprecate the setting for good measure, because it seems as though right now it does not do anything. In fact, setting it to false while there is no snapshot will just produce no snapshot now :) |
@@ -96,7 +98,9 @@ private async Tasks.Task<Resource> ensureSnapshot(Resource res) | |||
{ | |||
if (res is StructureDefinition sd) | |||
{ | |||
if (!sd.HasSnapshot || Generator.Settings.ForceRegenerateSnapshots || !sd.Snapshot.IsCreatedBySnapshotGenerator()) | |||
#pragma warning disable CS0618 // Type or member is obsolete | |||
if (!sd.HasSnapshot || (Generator.Settings.ForceRegenerateSnapshots && !sd.Snapshot.IsCreatedBySnapshotGenerator())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Ewout says in #2802 this will surely result in regressions. We shouldn't change this.
This still needs to be done:
|
…t' into fix/snapshotsource-reuse-snapshot
Description
If SnapshotSource detects a snapshot generated by our own SnapshotGenerator, it does not re-generate it.
Related issues
Fixes #2802.
Testing
See 2 new unit tests in the PR.
FirelyTeam Checklist