Lock app when creating service bindings#4577
Merged
philippthun merged 1 commit intoOct 6, 2025
Merged
Conversation
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.
7f1b316 to
046be38
Compare
This was referenced Sep 30, 2025
jochenehret
approved these changes
Oct 6, 2025
ari-wg-gitbot
added a commit
to cloudfoundry/capi-release
that referenced
this pull request
Oct 6, 2025
Changes in cloud_controller_ng:
- Ignore extra fields in BbsAppsClient test
PR: cloudfoundry/cloud_controller_ng#4594
Author: Philipp Thun <philipp.thun@sap.com>
- Lock app when creating service bindings
PR: cloudfoundry/cloud_controller_ng#4577
Author: Philipp Thun <philipp.thun@sap.com>
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
FOR UPDATElock 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
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.rbwas not executed (itinsidebefore).Tests in
spec/unit/actions/service_credential_binding_app_create_spec.rbhave been reworked for consistence. Some unneeded (redundant) tests have been removed.I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests