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

allow sending reports to external users with magic tokens #5778

Merged
merged 23 commits into from
Oct 27, 2024

Conversation

pjain1
Copy link
Member

@pjain1 pjain1 commented Sep 25, 2024

Fixes #5273

  • UI changes needs to be done to handle the new external urls for opening and exporting report containing magic token as path param. Urls for existing users will work as it is.

Clean up of unused magic tokens for reports directly created in code (not through UI) needs to be done. Its a bit tricky, may be some background job is required that queries report_tokens table and for each report_name queries the runtime and then does clean up.

admin/server/reports.go Outdated Show resolved Hide resolved
admin/server/reports.go Show resolved Hide resolved
runtime/drivers/admin.go Outdated Show resolved Hide resolved
runtime/drivers/admin.go Outdated Show resolved Hide resolved
admin/database/postgres/migrations/0049.sql Outdated Show resolved Hide resolved
admin/server/projects.go Outdated Show resolved Hide resolved
admin/server/reports.go Outdated Show resolved Hide resolved
admin/server/reports.go Outdated Show resolved Hide resolved
proto/rill/admin/v1/api.proto Outdated Show resolved Hide resolved
proto/rill/runtime/v1/queries.proto Outdated Show resolved Hide resolved
proto/rill/runtime/v1/queries.proto Outdated Show resolved Hide resolved
runtime/queries/proto.go Outdated Show resolved Hide resolved
runtime/server/downloads.go Outdated Show resolved Hide resolved
runtime/server/downloads.go Outdated Show resolved Hide resolved
admin/database/database.go Outdated Show resolved Hide resolved
admin/server/projects.go Outdated Show resolved Hide resolved
admin/server/reports.go Outdated Show resolved Hide resolved
admin/urls.go Outdated Show resolved Hide resolved
proto/rill/admin/v1/api.proto Outdated Show resolved Hide resolved
proto/rill/admin/v1/api.proto Outdated Show resolved Hide resolved
proto/rill/admin/v1/api.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

LGTM!

@pjain1 pjain1 self-assigned this Oct 21, 2024
admin/urls.go Outdated Show resolved Hide resolved
proto/rill/admin/v1/api.proto Outdated Show resolved Hide resolved
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

Also note the merge conflict

admin/database/postgres/migrations/0049.sql Outdated Show resolved Hide resolved
@pjain1
Copy link
Member Author

pjain1 commented Oct 22, 2024

@AdityaHegde @ericpgreen2 does the UI changes need review or are we good to merge ?

@ericpgreen2
Copy link
Contributor

@AdityaHegde @ericpgreen2 does the UI changes need review or are we good to merge ?

I took a quick look & looks pretty good, but I'll do a final review tomorrow.

@ericpgreen2
Copy link
Contributor

UXQA:

  • For a specific report, my report is blank...
    (Expected) When I click on the email's "Open in browser", I see this data:
    image
    (Expected) When I export this data from the dashboard directly, I see:
    image
    (Unexpected) When I click on the email's "Download CSV file", I see:
    image

  • For a project member, I clicked the "Open in browser" link, and I hit this type error. I haven't been able to consistently reproduce this, but it did happen once.
    image

  • We're missing the bottom border underneath the top bar:
    image
    image

@pjain1
Copy link
Member Author

pjain1 commented Oct 23, 2024

@ericpgreen2 for the empty download whats the url ? is it missing the execution_time query param, I cannot reproduce that on my setup.

@ericpgreen2
Copy link
Contributor

ericpgreen2 commented Oct 23, 2024

@ericpgreen2 for the empty download whats the url ? is it missing the execution_time query param, I cannot reproduce that on my setup.

Download URL: http://localhost:3000/ericpgreen2/rill-test-covid/-/reports/test-external-recipient-asian-vaccinations-63894747/export?execution_time=2024-10-23T14%3A30%3A00Z&format=EXPORT_FORMAT_CSV

In case it helps to repro, here's my project: https://github.com/ericpgreen2/rill-test-covid

@pjain1
Copy link
Member Author

pjain1 commented Oct 23, 2024

@ericpgreen2 I think its because the watermark used to run this report is trigger time and that is used in time filter so there won't be any data. I confirmed this was the behaviour is past as well. I think if we configure watermark_inherit to true then it should use the actual data to figure out watermark but I don't think its configurable through UI.

@ericpgreen2
Copy link
Contributor

@ericpgreen2 I think its because the watermark used to run this report is trigger time and that is used in time filter so there won't be any data. I confirmed this was the behaviour is past as well. I think if we configure watermark_inherit to true then it should use the actual data to figure out watermark but I don't think its configurable through UI.

Ah! Makes sense!

@pjain1
Copy link
Member Author

pjain1 commented Oct 25, 2024

Once @ericpgreen2 is ok with the frontend changes, I will resolve the conflicts and merge the PR.

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

LGTM

@pjain1 pjain1 merged commit ded1389 into main Oct 27, 2024
10 checks passed
@pjain1 pjain1 deleted the external_user_report branch October 27, 2024 17:36
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.

Feat: Sending reports to non-users
4 participants