-
Notifications
You must be signed in to change notification settings - Fork 125
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
token based report #6216
base: main
Are you sure you want to change the base?
token based report #6216
Conversation
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.
Also, do we have a job that clears expired magic auth tokens periodically? If not, can you add one?
proto/rill/admin/v1/api.proto
Outdated
string edit_url = 3; | ||
string unsubscribe_url = 3; |
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.
How will the report owner/admin open the report if they want to edit it? (E.g. change the frequency or the title)
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.
They will need to visit the reports page on UI.
We would need to detect if user is a project or org admin or creator of the report and add edit link. Currently we just add edit link for all Rill users but it has an issue if the user is not part of project (or not admin) otherwise it will be broken experience for them. For this reason I just removed the edit link and thought admin can visit the reports page, let me know if we want to add these checks.
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.
Though not great, this is alright. But would it be possible to keep the edit link for at least the owner user (I'm wondering if that would just require a simple check against the owner user ID)?
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.
Added edit link for owner, also added unsubscribe as a separate link since owner can be removed from project or org but should have option to unsubscribe.
There is already a |
@@ -283,7 +265,23 @@ func (s *Server) UnsubscribeReport(ctx context.Context, req *adminv1.Unsubscribe | |||
return nil, status.Errorf(codes.InvalidArgument, "failed to find report token: %s", err.Error()) | |||
} | |||
|
|||
userEmail = reportTkn.RecipientEmail | |||
if reportTkn.RecipientEmail == "" { |
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 a user is added as both slack and email recipient using same email then unsubscribing from any one unsubscribes from both places, what behaviour we want here ?
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.
Is it easy to break it out by notifier type? If not, I think it's fine to unsubscribe both places because this will probably never happen in practice.
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.
done
@pjain1 I responded to the two open questions on this PR. Can you let me know when you address them (or if you decide they are not worth it) and fix the merge conflict? |
Changes:
UI changes needed:
email
orslack_user
query param from the url and call the unsubscribe API with this param.Important Note: This does not support locking time ranges as of now (locking dimension filter works), as they would be evaluated during each report run at runtime. The queries that are sent by explore have a separate time range apart from the filter, magic token only supports row filter. If mgc token has time range then it will need to be reconciled with the actual time range sent.
Contributes to https://github.com/orgs/rilldata/projects/38/views/8?pane=issue&itemId=85181742&issue=rilldata%7Crill-private-issues%7C855