Revert Policy.id back to UUID struct#81
Merged
Merged
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 4f36291 | Docs | Datadog PR Page | Give us feedback! |
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.
#74 changed
Policy.idfrom aUUIDstruct ({hi:ulong, lo:ulong}) to astring, so RC-delivered policies could carry a real rule UUID instead of an always absent field. This looked backwards-compatible on the read side (FlatBuffers absent-field guarantee covers old binaries being read by new code), but breaks on the compile side:dd-compile-policy's JSON parser has the schema hardcoded in, and there's no current way to remotely update the compiler binary. It's vendored intodatadog-agentvia a version pin here, not delivered via Remote Config.I tested against the currently released
dd-compile-policybinary (v0.1.13):"id": "<uuid-string>"fails:Failed to parse JSON: ... expecting: { instead got: string constant.rule_id) also fails:Failed to parse JSON: ... unknown field: ....Both failure modes mean any host running an already-deployed
dd-compile-policywould start failing to compile policies the moment RC starts emitting the new content in the JSON payload, with no way to force those hosts to upgrade first.Reverting to the
UUIDstruct avoids this: the field shape is unchanged from what's already deployed everywhere, so instead of a string, the real rule UUID gets encoded intohi/lo.Hardcoded/built-in policies are identified as hardcoded because they simply omit
id.