remind101 / slashdeploy

GitHub Deployments for Slack
https://slashdeploy.io
BSD 2-Clause "Simplified" License
153 stars 20 forks source link

Handle `git reset --hard HEAD^ && git push -f` scenarios #87

Closed ejholmes closed 6 years ago

ejholmes commented 7 years ago

If CD is enabled, this is a problem. Results in:

ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_auto_deployments_on_environment_id_and_sha" DETAIL: Key (environment_id, sha)=(369, 5303547f2ea2db03522c14082209fa27c9a64cbc) already exists
russellballestrini commented 6 years ago
russellbal [5:56 PM]
This is to deal with a commit hash being basically replayed / redeployed? (edited)

ejholmes [6:00 PM]
Yep, exactly.

russellbal [6:00 PM]
What is the ideal way to reconcile this? It seems like a good safety to have

ejholmes [6:01 PM]
I think the commit should probably just be ignored. At least that’s my first thought.