Fix Issue #14: Return success information from SubmitConfig.Run() #35
+154
−36
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.
Issue Reference
Fixes: #14 - Investigate whether Provisioning API Client Return Code on Success
Problem Description
The original
SubmitConfig.Run()method only returned anerror, providing no success information to callers when CoRIM submission succeeded. This made it impossible for applications to display meaningful success messages or status information to users.Solution
Changed the API signature to return both success information and errors:
Before:
After:
Benefits
Files Changed
provisioning/provisioning.go- UpdatedRun()andpollForSubmissionCompletion()methodsprovisioning/doc.go- Updated package documentationprovisioning/provisioning_test.go- Updated all tests + added success info demonstration testsTesting
New Tests Added:
TestSubmitConfig_Run_success_info_returned- Demonstrates synchronous success info accessTestSubmitConfig_Run_async_success_info_returned- Demonstrates asynchronous success info accessTest Results:
Usage Example
Breaking Change Notice
This is a breaking API change, but it directly addresses the core issue #14.
Migration Path: