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

jobs: add button to request execution details #107759

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

adityamaru
Copy link
Contributor

This is the last of the three PRs to add support
for requesting, viewing and downloading execution
details from the job details page.

This change wires up the logic needed to request
the execution details for a given job. The request
is powered by the crdb_internal.request_job_execution_details
builtin that triggers the collection of execution details.

Fixes: #105076
Release note: None

@adityamaru adityamaru requested review from dt, maryliag and a team July 27, 2023 21:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@adityamaru
Copy link
Contributor Author

Loom video: https://www.loom.com/share/57ec04141b1443c2b41a630e1771dd2c?sid=0610ee20-cb72-4952-89ae-8c1a2202e2f2

Fist commit is from #107210 which should be merged soon.

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Discussed offline, but adding here for tracking:

  • Hide the Advanced Debugging tab if the user doesn't have ADMIN or VIEWACTIVITY role
  • Change the request button to keep consistent with other pages, so move it to the right and increase its height, an example that can be follow is the Activate Diagnostics on the Statement Details page

Screenshot 2023-07-28 at 9.53.02 AM.png

Reviewed 12 of 12 files at r1, 2 of 10 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt)

This is the last of the three PRs to add support
for requesting, viewing and downloading execution
details from the job details page.

This change wires up the logic needed to request
the execution details for a given job. The request
is powered by the crdb_internal.request_job_execution_details
builtin that triggers the collection of execution details.

This change also adds logic to hide the Advanced Debugging
tab if the user is not an admin.

Fixes: cockroachdb#105076
Release note: None
@adityamaru
Copy link
Contributor Author

thanks for your help! I changed the appearance of the button and also added logic to only show the tab if we are admin. This may change in the future but for now I think its better to take a conservative approach.

Screenshot 2023-07-28 at 3 22 40 PM

@adityamaru adityamaru force-pushed the request-execution-details branch from f23c468 to 6ea4efb Compare July 28, 2023 19:42
@adityamaru adityamaru requested a review from maryliag July 28, 2023 19:43
Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Nice!
The only thing that I would like to see is now with the permission checks, the page loading for an admin and then how it shows for non-admins, just to confirm everything is working as expected.

:lgtm:

Reviewed 6 of 10 files at r2, 9 of 9 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru and @dt)


pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx line 118 at r2 (raw file):

                onDownloadExecutionFileClicked(req).then(resp => {
                  const type = getContentTypeForFile(executionDetailFile);
                  const executionFileBytes = new Blob([resp.data], {

add resp?.data because when initially load you might not have the resp yet and this can cause a crash

@adityamaru
Copy link
Contributor Author

DBConsole as a non-admin user:

Screenshot 2023-08-02 at 11 58 45 AM

Granted the user admin and refreshed the page:

Screenshot 2023-08-02 at 11 59 08 AM

Copy link
Contributor Author

@adityamaru adityamaru left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt and @maryliag)


pkg/ui/workspaces/cluster-ui/src/jobs/jobDetailsPage/jobProfilerView.tsx line 118 at r2 (raw file):

Previously, maryliag (Marylia Gutierrez) wrote…

add resp?.data because when initially load you might not have the resp yet and this can cause a crash

Done.

@adityamaru
Copy link
Contributor Author

TFTR!

bors r=maryliag

@craig
Copy link
Contributor

craig bot commented Aug 2, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 2, 2023

Build succeeded:

@craig craig bot merged commit 9355e10 into cockroachdb:master Aug 2, 2023
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.

jobsprofiler: add support for a job diagnostic bundle
3 participants