Race condition in rollout
Making a release while the Build and release action is running can cause the rollout to end up using the wrong version.
The problem is:
- We use
oddishto get the right version for the npm package - We build the webapp using this version as part of the CDN_URL
- We use
oddishto get the right version and we publish the npm package.
If between 1 and 3, a version of the npm package is published (ie. because another action finished running), then the versions that oddish computes in step 1 and in step 3 are different. This causes the build to be uploaded to the CDN using a different url than the one it was used to build it. Then it's all 404s.
To fix this we should re-use the version we got in step 1 when we do step 3, instead of using oddish again. If there is a race condition, then what would happen is the step 3 is going to fail because a newer version already exists. Which is the right way to handle the race condition, instead of deploying something broken.