Hi folks,
I’m looking into doing some post-processing of the manifest.json, however once I’ve edited the manifest file and run dbt docs serve the manifest.json is reverted to the pre-edit state. Does anyone know what could be causing that and how to prevent it?
Concretely I’m adding hyperlinks to model description based on metadata.
I would expect dbt docs generate to change the manifest.json but that isn’t the case.
Steps to replicate:
Run dbt docs generate to create manifest.json
Manually edit the manifest.json
Run dbt docs serve
Expected result: No modification to the manifest.json and the manual edits piped to the dbt docs UI
Observed result: manifest.json reverted to before step 2 and the edits not appearing in the dbt docs UI. Additionally index.html also seems to have been modified but the catalog.json are unchanged.
I’m using dbt-core and dbt-bigquery both v1.5.0 if that’s matters.
dbt docs serve won’t modify the json files. Something else must be causing the files to be reverted (or not to be saved in the first place).
How are you modifying the file? Is it with a Python script or are you editing it manually? Have you validated that the script has read-write permissions to the file? Once you edit and save the file, can you open it up in a text editor and ensure that the changes have applied correctly?
It might also be worth checking that you’re not serving the docs at the same time as you edit them; it might not let you save changes if another process already has the file open.
To address your questions I am planning to use a Python script eventually but to reduce complexity I’m currently manually editing it in an editor. I’ve confirmed that the save is successful. To validate that further I made a copy of the manifest.json, confirmed that the edit also existed in the duplicate. After running dbt docs serve --port 8000 I notice the manifest.json being reverted back to the pre-edit version but the duplicate remains untouched.
I’d be surprised if there’s anything in a patch release, but the fact that you were using 1.5.0 and Bruno was using 1.5.1 is the only difference I can see. It could be worth making sure you’re up to date on patches to dbt Core (and dbt-bigquery for the sake of completeness, but it shouldn’t have anything to do with writing json files) before filing the issue.