diff options
author | Nick Thomas <nick@gitlab.com> | 2019-07-20 00:39:26 +0300 |
---|---|---|
committer | Mayra Cabrera <mcabrera@gitlab.com> | 2019-07-20 00:39:26 +0300 |
commit | a5a444906de6372105c41260a9b1c1eb49d4dc9e (patch) | |
tree | 36a27006da6e7da943804400e6c08fd3d87bb76a /changelogs | |
parent | eb3f465e75ee1fc5ef582e9f01f921626d7cf5cc (diff) |
Fix the project auto devops API
If `project_auto_devops.enabled` is nil for a project, when setting any
auto devops values via the API, we try to create a new row in the DB,
instead of re-using the existing one. This leads to the project_id
being set to nil, and the database `NOT NULL` constraint leading to a
500 response.
This commit resolves the issue by correctly detecting the presence of a
ProjectAutoDevops row and re-using it. Persistence is also moved away
from explicit `update!` calls and into relying on `autosave: true` on
the model.
Diffstat (limited to 'changelogs')
-rw-r--r-- | changelogs/unreleased/64731-fix-project-auto-devops-api.yml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/unreleased/64731-fix-project-auto-devops-api.yml b/changelogs/unreleased/64731-fix-project-auto-devops-api.yml new file mode 100644 index 00000000000..7fe2c036773 --- /dev/null +++ b/changelogs/unreleased/64731-fix-project-auto-devops-api.yml @@ -0,0 +1,5 @@ +--- +title: Fix the project auto devops API +merge_request: 30946 +author: +type: fixed |