refactor: Implement interface for source verification provider #47
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.
This is a proof of concept PR as I'm exploring a small refactor around source verification. Please do NOT merge!
Previously, the steps to add new provider is (example platform: Acme)
sourceverification/verification_acme.go
sourceverification/model.go
sourceverification/schema.go
sourceverification/sdk.go
Of all these steps, the SDK logic is the most tedious as it usually takes me some time to locate the right place before adding 2 lines of code. It's a bit scary since if there's a bug in this step, we won't realize it until it's properly tested end-to-end.
I want to reduce the process to just one single step
sourceverification/verification_acme.go
However, I have not been able to achieve this goal yet. The main challenge is the Terraform static types. I haven't been able to figure out a way to do so dynamically just yet. Therefore, this is where we're at with this PR
sourceverification/verification_acme.go
sourceverification/model.go
I do think this is a significant step up from before as it's quite straightforward to update these 2 steps.
To be honest, I'm not 100% happy with where things are at yet. However, given that this is not a huge value add (more internal DX vs actual value for users), I'm not sure if we should continue exploring this effort further. Just want to share this idea and my progress here if you want to explore this idea further!