Preserve Assessment GUIDs on Import #3974
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗣 Description
If an assessment already exists with the same GUID (i.e. you are re-importing an assessment you just exported), then the assessment will be cloned with a new GUID value. However, if no assessment already exists with the same GUID, the GUID linked to the exported assessment should carry over when imported. The overwrite functionality is a specific use case for CRRM, where imports will create/update assessments instead of always creating new assessments like in CSET. If CSET ever wanted to have some sort of option to toggle on and off overwriting import overwriting, that is always be an option now.
💭 Motivation and context
This change is important for the functionality of CRRM, where assessment importing acts as an update/overwrite mechanism instead of cloning. Preserving the GUIDS on import is the only way we can determine if an import should create a brand new upload record or overwrite an existing one.
🧪 Testing
Tested locally and the existing import behavior of CSET should remain unchanged.
✅ Pre-approval checklist
in code comments.
to reflect the changes in this PR.
✅ Pre-merge checklist
✅ Post-merge checklist