Remove proto dep external->interservice #4278
Merged
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.
π© Description: What code changed, and why?
Our compiled golang protos are not usable outside of automate because all of automate is one golang module with broken dependencies (dex won't install for some reason related to go modules). Fixing the dependency would still leave a situation where external consumers of the API would need to install all of Automate's deps just to get some structs. Making the external API a separate module will result in much better behavior.
In order for this approach to deliver the desired benefit, the external API must have no dependencies on the rest of Automate. You can run
git grep -h -o 'chef/automate\S\+' | grep -v chef/automate/api | sort | uniq
from the api/external directory to find the golang imports we need to fix. Prior to this PR, we get the following:In this PR, I moved some message definitions from the inter service data lifecycle proto to the external API proto. This is a breaking change at the generated code level. In the go code for example, the structs are now in a different package. That said, the code as it is prior to this PR is "pre-broken" as it uses code with no compatibility guarantees (api/interservice protos) inside code that is supposed to have compatibility guarantees (api/external). Compatibility should be maintained at the protobuf wire level and the protobuf-as-JSON level, which, combined with the current brokenness of using our compiled golang protos, makes it unlikely we will break any customers.
βοΈ Related Resources
#4273 #4277
π Definition of Done
Code should work the same, except for the compatibility caveat described above. If you run
it grep -h -o 'chef/automate\S\+' -- api/external | grep -v chef/automate/api/external | sort | uniq
from the repo root, you no longer see the data lifecycle interservice protos in the output.π How to Build and Test the Change
β Checklist
π· Screenshots, if applicable