Skip to content
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

Merged
merged 4 commits into from
Jul 19, 2023
Merged

backports changes back to feature-rebac #1003

merged 4 commits into from
Jul 19, 2023

Conversation

mina1460
Copy link
Contributor

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

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@mina1460 mina1460 requested a review from ale8k July 17, 2023 14:33
@mina1460 mina1460 requested review from babakks and kian99 July 18, 2023 13:30
Copy link
Contributor

@kian99 kian99 left a 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))
Copy link
Contributor

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?

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

@ale8k ale8k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mina1460 mina1460 merged commit 19d3e80 into canonical:feature-rebac Jul 19, 2023
kian99 added a commit that referenced this pull request Aug 23, 2023
* Switch to use OpenFGA access list

* Fix tests

* Rename Fetch to Get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants