Commit cf40b64
authored
Lock app when creating service bindings (#4577)
A "FOR UPDATE" lock on the app instance together with checks implemented
in Ruby ensure the same behavior as two unique constraints on database
level, which need to be removed to support multiple bindings between an
app and a service instance.
The two checks are:
- the number of bindings from an app to a service instance is below the
configured limit
- no other binding (to another service instance) for this app has the
same name
The validate_app_guid_name_uniqueness! method has been moved after the
validation of already existing bindings - this simplifies its
implementation.
Method incomplete_deletion! raises a different (more precise) error when
multiple bindings are active.
Some unused methods have been removed.
A test in spec/request/service_credential_bindings_spec.rb was not
executed ('it' inside 'before').
Tests in spec/unit/actions/service_credential_binding_app_create_spec.rb
have been reworked for consistence. Some unneeded (redundant) tests have
been removed.1 parent 8ecd426 commit cf40b64
File tree
4 files changed
+167
-231
lines changed- app/actions
- spec
- request
- unit/actions
4 files changed
+167
-231
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
| 79 | + | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
| 92 | + | |
95 | 93 | | |
96 | | - | |
97 | | - | |
| 94 | + | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
| |||
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 124 | | |
132 | 125 | | |
133 | 126 | | |
| |||
154 | 147 | | |
155 | 148 | | |
156 | 149 | | |
157 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
158 | 153 | | |
159 | 154 | | |
160 | 155 | | |
| |||
165 | 160 | | |
166 | 161 | | |
167 | 162 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | 163 | | |
173 | 164 | | |
174 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 95 | | |
100 | 96 | | |
101 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1275 | 1275 | | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
| 1278 | + | |
1282 | 1279 | | |
1283 | | - | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1284 | 1283 | | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | 1294 | | |
| |||
0 commit comments