feat(servicebinding): ensure External Name ADR compliance for ServiceBinding#508
feat(servicebinding): ensure External Name ADR compliance for ServiceBinding#508gergely-szabo-sap wants to merge 4 commits intomainfrom
Conversation
1de1449 to
a213aa8
Compare
|
@gergely-szabo-sap did you test that logic with both observe-only and regular resources? I mean I am not totally against changing the external-name format, but we would need extensive testing (probably upgrade testing) for making sure existing resources stay the same and I wouldn't be too happy to now introduce this new "," notation if we do not do the same in all cases that have compound keys. I had a similar discussion with @jn-av the other day regarding serviceinstances. (Sorry we didn't include you here. I missed that you are facing the same problem in bindings as well) And at least there my assumption was that its not required to change the external-name. Upjet has some weird specific logic to call an explicit Import command in case of observe only resources (I mean this). Unfortunately due to the way how the btp tf provider is implemented the lookup is totally different there and that is why this confusing error message came up. However now looking at the binding code I see that there we already do not pass that management policies, so I am wondering about all of that ;) So is the import not working right now? |
8ad3f84 to
196f0a8
Compare
@sdischer-sap, it was a transient commit, I did not mean to review it yet. Importing of ServiceBinding did not work in my tests back then. It was due to buggy tests. I managed to fix my test environment, and the importing is working as expected. I added an import test to prove this. I removed most of the extra code. It become much simpler now. |
…ternalName Introduce EncodedExternalName to store subaccountID and serviceInstanceID in the external name format "subaccountID,serviceInstanceID". This enables proper resource identification and backward compatibility with existing resources. - Add externalname package with parsing and encoding utilities - Update client to generate encoded external name on create - Parse encoded external name in Connect to resolve resource identity - Add comprehensive tests for new functionality
196f0a8 to
73aea56
Compare
There was a problem hiding this comment.
Looks great, thank you.
Also thank you for fixing some small things in the import_test_utils I missed when introducing it :)
One thing though: did you check the Observe/Delete/Create Logic against the ADR? E.g. 404 in delete is not handled as error etc.
Another question: what about rotation of serviceBindings, does it work with servicebinding roation?
Description
This issue tracks the implementation work needed to ensure the Directory resource fully complies with the External Name Handling ADR. The goal is to verify and implement proper external name handling across all CRUD operations according to the established guidelines.
Tasks
1. Implement Proper External Name Handling
Acceptance Criteria:
Observe() Method Implementation
Create() Method Implementation
Update() Method Implementation
Delete() Method Implementation
Review Migration Logic:
2. Unit Test Coverage for External Name Handling
The code is is using upjetted resource with upjet-specific importing mechanism. I haven't touched the test codebase.
Acceptance Criteria:
Observe() Tests:
resourceExists: falseCreate() Tests:
Update() Tests:
Delete() Tests:
3. E2E Import Test Coverage
Acceptance Criteria:
test/e2e/import_utils.go, already used intest/e2e/subaccount_test.go.4. Upgrade Test Coverage for External Name Behavior
This PR adds only tests and documentation. No need for upgrade testing.
If this part is blocked by adding the upgrade tests to btp-provider, move this to a follow up issue.
Acceptance Criteria:
External Name Format Migration Test:
Backward Compatibility Validation:
Implementation Notes
ADR Compliance: Ensure all implementation follows the patterns and requirements defined in the External Name Handling ADR.
GUID Validation: Implement proper validation for external-name format checking (GUID format expected).
Error Handling: Ensure API errors are properly wrapped and provide clear messages to users about external-name related issues.
Backward Compatibility: Evaluate existing migration logic and determine appropriate approach for maintaining or updating compatibility. This includes the already existing migration logic introduced in v1.4.0.
Related Resources