Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: check ecobalyse-data sync for PR (#915)
## 🔧 Problem We have 2 repos `ecobalyse-data` and `ecobalyse` so we have out of sync issues. I experienced them and it's quite annoying. We agreed upon a workflow with the following rules : - `ecobalyse-data` PR should be merged first - Only then can a corresponding syncing`ecobalyse` PR can be merged With this workflow, `ecobalyse-data/main` should always be sync with `ecobalyse/branch_a` when doing a PR on `ecobalyse`: ## 🍰 Solution In every `ecobalyse` PR add a check that verifies if `ecobalyse-data` and `ecobalyse` are in sync for the generated `ecobalyse-data` files : - "public/data/food/ingredients.json" - "public/data/food/processes.json" - "public/data/textile/materials.json" - "public/data/textile/processes.json" - "public/data/object/processes.json" ## 🚨 Points to watch/comments - As `ecobalyse/master` might be temporarily behind `ecobalyse-data/main`, this check should not apply in the CI on `ecobalyse/master`. Only on PR to `ecobalyse/master` - If someone merge a json-changing PR in `ecobalyse-data` and he doesn't merge the corresponding PR on `ecobalyse`, then this check is going to block all `ecobalyse` PR because they will all be out of sync. But that's kind of the point, it forces us to always sync `ecobalyse-data` and `ecobalyse` - I didn't add `public/data/textile/processes_impacts.json` to the check as it was more complicated with the encryption. Any modification to `processes_impacts.json` should normally modify `processes.json` so it's not that important - Unit testing check-ecobalyse-data-sync.sh would be nice ## 🏝️ How to test ### Success - running `./check-ecobalyse-data-sync.sh ` should succeed (if this is sync to `ecobalyse-data`) ### Failure - add a difference in one of the generated json (listed above) - running `./check-ecobalyse-data-sync.sh ` should fail and display the diff
- Loading branch information