Skip to content

Conversation

@gmcgibbon
Copy link
Member

@gmcgibbon gmcgibbon commented Dec 8, 2023

Support autoredirection on remote profile views. Previously, the remote speedscope viewer would log a line like Profile available at /app_profiler/<profile-id> if a profile was initiated (eg. my.host/some/url?profile=wall). When autoredirection is enabled via the query param, header, or configuration (eg. my.host/some/url?profile=wall&autoredirect=1), a redirect is added to just redirect to /app_profiler/<profile-id> instead of having to copy-paste the log into the browser.

Should we just make this the new default behaviour? It is much better DX.

@gmcgibbon gmcgibbon force-pushed the autoredirect_after_remote_profile branch from d741463 to 30ae916 Compare December 8, 2023 06:15
Instead of logging profile viewing URLs, we can just redirect to them
when the developer wants to see them. Saves copy-pasting the path.
@gmcgibbon gmcgibbon force-pushed the autoredirect_after_remote_profile branch from 30ae916 to 84e9d86 Compare December 8, 2023 06:21
Copy link
Contributor

@bmansoob bmansoob left a comment

Choose a reason for hiding this comment

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

I am with you on making autoredirect the default behaviour.

@gmcgibbon
Copy link
Member Author

I added a commit to make the behaviour default instead of opting into it with autoredirect. If we agree, I'll squash it and merge.

end

def view
def view(response: nil, autoredirect: nil, async: false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if we need autoredirect: nil, async: false here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because we're passing in the parameters from the view action (from the middleware), we can expect these to be provided. If we don't mention them, Ruby will raise an ArgumentError and our public API will be broken if we don't provide defaults.

@gmcgibbon gmcgibbon merged commit 147be34 into main Dec 13, 2023
@gmcgibbon gmcgibbon deleted the autoredirect_after_remote_profile branch December 13, 2023 20:11
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.

2 participants