Add EvidenceStore for tracking activity evidence (#496)#501
Add EvidenceStore for tracking activity evidence (#496)#501sawankshrma wants to merge 3 commits intodevsecopsmaturitymodel:mainfrom
Conversation
vbakke
left a comment
There was a problem hiding this comment.
At first glance this looks good. But how do you execute the code? I didn't see how to initialize anything? Do you read the yaml file, or from localStorage?
| return now.toISOString().substring(0, 10); | ||
| } | ||
|
|
||
| // to be used when creating new evidence entries to ensure they have a stable UUID |
There was a problem hiding this comment.
Ah. I was not clear in my example.
The UUID on top level under the root node evidence: I was thinking would be the activity-uuid.
So unless we want to create an UUID as an ID for the evidence entry itself, I don't think this will be needed.
There was a problem hiding this comment.
No. I did understand in the issue example that the top level UUID was the activity-uuid.
It was my mistake that I did not point this extra design choice of the data-structure in the PR description.
Let me calrify this here.
-
Since we are not going to tie evidence with progress (as specifically mentioned in the issue's comments). For the same team and the same activity we could have more than one EvidenceEntry (say entries for starting and partly implementing but not fully implementing, 2 here).
-
For this I went for a unique id for each EvidenceEntry to identify them separately.
-
I have updated the Format in the original PR description which showcases this. I just copy-pasted the Format form the issue earlier. my bad.!
If this design choice seems unnecessary, please suggest another way to uniquely identify multiple EvidenceEntry entries for the same team and activity.
- We could also consider linking them to the Progress name instead, this way each progress would have at-most one EvidenceEntry. Again, I leave this decision for maintainers.
There was a problem hiding this comment.
Okay. So the top-level uuid is an activityId, and the id property is an evidenceId.
That makes sense. And the second ID is important to handle evidence from yaml and localStorage. Thumbs up.
[] However, maybe we should create a type ActivityId = Uuid as well as type EvidenceId = Uuid to more easily distinguish them. (The Uuid type has only one purpose today.)
6f09967 to
4bf1a80
Compare
Earlier, I was trying to mimic the structure of the
I don't know if this is the approach/merge-strategy we should go for. So I would genuinly like your opinion here @wurstbrot , @vbakke.
2026-02-26-08-45-49_BglElByh.mp4 |
|
😊 I struggled with that, too, @sawankshrma :) Made an obese solution, with timestamp for what was stored when etc. Ended up scrapping it. Kept it simple. I'd say normal workflow would be:
In other words, I think that:
If we want to go overboard with new functionality, we can somehow display what is newer in the localStorage vs server side yaml. Do say what should be exported, and saved to the server. But I think that is a separate issue, which is better solved after the evidence issue has been implemented. |
4bf1a80 to
a1e07b1
Compare
Here's a quick summary of what this PR does end to end:
I believe this is ready to merge. Once merged, I'll start on the UI layer implementation. Plz let me know :) |
vbakke
left a comment
There was a problem hiding this comment.
Looks good. Just some smaller comments. Feel free to continue with the UI :)
| meta.activityFiles = meta.activityFiles.map(file => | ||
| this.yamlService.makeFullPath(file, this.META_FILE) | ||
| ); | ||
| if (!meta.teamProgressFile) { |
There was a problem hiding this comment.
| if (!meta.teamProgressFile) { | |
| if (!meta.teamEvidenceFile) { |
| return now.toISOString().substring(0, 10); | ||
| } | ||
|
|
||
| // to be used when creating new evidence entries to ensure they have a stable UUID |
There was a problem hiding this comment.
Okay. So the top-level uuid is an activityId, and the id property is an evidenceId.
That makes sense. And the second ID is important to handle evidence from yaml and localStorage. Thumbs up.
[] However, maybe we should create a type ActivityId = Uuid as well as type EvidenceId = Uuid to more easily distinguish them. (The Uuid type has only one purpose today.)
| this.dataStore.addProgressData(browserProgress?.progress); | ||
| } | ||
|
|
||
| // Load evidence data |
There was a problem hiding this comment.
The current setup will prioritize YAML fil over loaclStorage.
I think locally changed evidence should take priority over server side evidence. Otherwise you will not be able to see your own changes if you reload the page.
Description
Adds an
EvidenceStore.tsto let users record that activities have been completed. Evidence is stored separately from progress in localStorage.Format:
What's New?
evidence-store.ts— new store with add, update, delete (by id), merge, rename team, import/export functions.team-evidence.yaml— empty placeholder for YAML-based evidence.EvidenceStoreinto the existingDataStore.progress-store.ts.Resolves (Partially) : #496