-
Notifications
You must be signed in to change notification settings - Fork 7
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
backports changes back to feature-rebac #1003
backports changes back to feature-rebac #1003
Conversation
Signed-off-by: Mina Ashraf <[email protected]>
Signed-off-by: Mina Ashraf <[email protected]>
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 but @ale8k should also take a look before merging
if err != nil { | ||
return apiparams.CrossModelQueryResponse{}, errors.E(op, errors.Code("failed to get models for user")) | ||
} | ||
models := make([]dbmodel.Model, len(usersModels)) |
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.
What is this intermediate slice for? Why can't we just use userModels
? I assume userModels
holds more than what we want?
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.
We want only the model segment, not the wrapping struct, so literally m.Model_
return nil, err | ||
} | ||
func (f *formatterParamsRetriever) GetParams(ctx context.Context, model dbmodel.Model) (*status.NewStatusFormatterParams, error) { | ||
f.model = &model |
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.
It's a bit surprising that we're setting this equal to the address of the model struct considering we pass in the model as a value and not by reference, I assume the other methods on formatterParamsRetriever
expect a pointer and not the struct itself. Just thought I'd point it out.
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 think I rushed these changes, as the retriever is pointer it doesn't need to be but it's pretty harmless tbh
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
Description
a Backport was done earlier from the featuer-rebac branch to the main branch. Then, some changes were done on the backport that was not mapped back to the feature-rebac branch. This brings back the changes to feature-rebac
Fixes CSS-4779
Engineering checklist
Check only items that apply