-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Replace entity GRN with infra/grn GRN #74198
Conversation
bash pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh | ||
bash pkg/services/store/entity/generate.sh | ||
bash pkg/infra/grn/generate.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we maybe have a script that find
's all .proto
files and applies protoc
command to them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some nuance to the generate.sh files right now, but we could potentially do something like that if we can resolve the differences that we need currently. That sounds like a separate PR though ;)
int64 TenantID = 1; | ||
|
||
// The kind of resource being identified, for e.g. "dashboard" or "user". | ||
// The caller is responsible for validating the value. | ||
string ResourceKind = 3; | ||
|
||
// ResourceIdentifier is used by the underlying service to identify the | ||
// resource. | ||
string ResourceIdentifier = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a relatively new and unexposed message - why do we use 1, 3 and 4 and skip the 2 for field IDs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to stay consistent with the fields in the entity GRN definition, in theory at least this is wire-compatible even though the field names are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (I also quite appreciate ResourceKind
and ResourceIdentifier
, I find those much clearer)
replace entity GRN with infra/grn GRN
replace entity GRN with infra/grn GRN
This PR replaces the entity definition of GRN with the definition from the infra/grn package, and updates the infra/grn package to use a proto definition so that we can import it into the entity proto definition. This allows us to have a single unified understanding of what a GRN is.
To support this I did have to change infra/grn somewhat, the main changes being to use pointers to the GRN structs so that we aren't copying the internal mutexes used by protobuf, and changing the String function to ToGRNString because proto defines String already.