devsecopsmaturitymodel / DevSecOps-MaturityModel

GNU General Public License v3.0
459 stars 267 forks source link

Download of edited YAML file downloads mounted state instead of edited state from heatmap #286

Open towameister opened 2 months ago

towameister commented 2 months ago

I noticed that downloading an edited YAML file sometimes does not reflect new changes made, but instead yields the version which was mounted upon container start. Upon closer examination, I discovered that console logs print two versions of the ALL_CARD_DATA object when refreshing the page (cache disabled), one which contains the mounted state, and one which contains the edited state. For some reason, the corresponding YAML object is not updated properly to represent the state in localStorage when refreshing the page inbetween the edit and download steps.

Steps to reproduce:

  1. Launch via docker, mounting a .yaml file as described in documentation
  2. edit heatmap
  3. refresh page
  4. Download edited YAML file (this YAML file does not reflect changes in UI)
Nitwix commented 2 months ago

Not sure if it helps, but apparently the documentation to mount a custom .yaml is wrong. The path of the file in the container is wrong.

For me, the following worked: docker run -p 8080:8080 -v /path/to/local/file.yaml:/srv/assets/YAML/generated/generated.yaml wurstbrot/dsomm:latest

wurstbrot commented 2 months ago

@Nitwix Are you able to create a PR with the needed changes? Will be happy to merge.

Nitwix commented 2 months ago

@Nitwix Are you able to create a PR with the needed changes? Will be happy to merge.

Done! https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel/pull/298

However, I don't think this completely solve this issue: the generated .yaml file which can be downloaded does indeed not always reflect the modified state of the heatmap, as indicated by @towameister

(My current workaround is to work directly in generated.yaml and re-run the image to see the changes in the heatmap, which works)

wurstbrot commented 2 months ago

ah, I see, by moving from apache to Caddy the folder has changed. Thank you for the PR.