Repository navigation
Add workload forms and failed-run Troubleshoot to DAK - #591
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
**What this does** DAK lists and runs Managed Spark workloads. But to create a workload or run local code, a developer must use the Cloud console or workloads.py. Also, a failed run shows its errors, and the user must find the cause alone. This CL adds the Create workload, Start ad-hoc run and Update workload forms (CUJs 1 to 3, b/591845594). It also adds a Troubleshoot button for a failed run that hands the failure to the coding agent of the IDE (CUJ 9, b/591846409). **What changed** - `dataproc/shared/workloads_forms.ts`, `pages/workloads/workload_form.*`: one form page with three modes, a consent banner and a conflict banner. Leaf update mask with etag. Consent link check. - `dataproc/exthost/workloads_staging.ts`: content-hashed object names, MD5 duplicate skip, `ifGenerationMatch=0`, resumable upload above 5 MiB, and only a regional bucket in the region of the run. - `dataproc/exthost/workloads_form_actions.ts`, `workloads_rest_client.ts`: the form RPCs, and CreateWorkload, CreateRun and UpdateWorkload. - `dataproc/exthost/workloads_troubleshoot.ts`, `pages/workloads/run_details.*`: the Troubleshoot prompt, the handoff to the agent panel, chat or clipboard, and the button for a failed run. - Tree, table, workload page, `package.json`: commands and buttons. The flag `DatacloudSpark__enable_workloads` gates each new command and menu. **How it was tested** - `blaze test` of `dataproc/exthost:unit_tests`, `dataproc/shared:unit_tests`, `run_details_unit_tests`, `workload_form_unit_tests`, `workload_details_unit_tests`, `workloads_list_unit_tests`, `workloads_webview_service_tests`, `:vsix_content_test`, `:tsconfig`, the two `package.json` checker tests, `agents/exthost:unit_tests`, `services_registry_test` and the DAK skill tests: 109 targets pass (http://sponge2/74f07306-c209-4cc9-87a4-3ba66b290f2d). - The staging tests run the resumable upload with gaxios 6 and gaxios 7 response headers, and check the multipart body byte for byte. - `jj piper lint`: 3 advisory findings (component harnesses), as in the other workload page tests. `hamburger --dry-run`: 0 files to change. - No live test. No create, run, upload or Troubleshoot click ran against a real project or in a real IDE. **Where to look** This CL merges two best-of-2 candidates for each bug. Claude: cl/1032868163 (forms) and cl/1032855007 (Troubleshoot). Jetski: cl/1032888849 (forms) and cl/1032855993 (Troubleshoot). Forms: the code comes from the Claude candidate. It has one form component with three modes. The Jetski forms copy about 1,300 lines between two forms. From the Jetski candidate came the rule "only a regional bucket in the region" (`checkBucket`). Multi-region buckets can be on another continent, and design section 3.2 keeps the code in the region. Fixes that neither candidate had: - `workloads_staging.ts`, `normalizeHeaders` and `buildMultipartBody`: the VSIX runs gaxios 7, but the code compiles against the gaxios 6 typings. gaxios 7 gives response headers as a `Headers` object and reads multipart part headers with `Headers.get`. Both candidates failed here at runtime. Rejected: the googleapis `storage_v1` client, because it has no chunked upload that resumes after a failed chunk. - `workloads_forms.ts`, `getEucConsentUrl`: both server wordings, the OAuth path and the Managed Spark redirect URI, as in `common/shared/sql_query/error_parse_context.ts`. Rejected: an import of that file, because it pulls SQL editor code into the webview bundle. - Update form: no placement is Serverless, a cluster workload keeps its cluster, and unchanged arguments stay as they are. Troubleshoot: the structure comes from the Claude candidate. The page sends only the run name, the extension host loads the run again, and a registered command gives metrics and the flag check. Rejected: the Jetski request that carries the full run from the page, because a page can then put any text in the prompt. From the Jetski candidate came, in `buildRunTroubleshootPrompt`: - No values of Spark properties, parameters or arguments, only their names, as in Table 3.2 of the Spark troubleshooting agent design. - An `<untrusted_error_log>` block for the error messages. - A cap of about 12,000 characters, which cuts only the error messages. - A log time window, the duration and the Cloud console link. Design choice: outside Antigravity, DAK copies the prompt to the clipboard before it opens the VS Code chat. VS Code opens its chat view also with no chat extension, and then drops the prompt. **Related** Design doc Tab 2, sections 2, 3.1 and 3.2. Open Decision 1 (UI staffing) is still open. PiperOrigin-RevId: 1033011518
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add workload forms and failed-run Troubleshoot to DAK
What this does
DAK lists and runs Managed Spark workloads. But to create a workload or run
local code, a developer must use the Cloud console or workloads.py. Also, a
failed run shows its errors, and the user must find the cause alone. This CL
adds the Create workload, Start ad-hoc run and Update workload forms (CUJs 1
to 3, b/591845594). It also adds a Troubleshoot button for a failed run that
hands the failure to the coding agent of the IDE (CUJ 9, b/591846409).
What changed
dataproc/shared/workloads_forms.ts,pages/workloads/workload_form.*:one form page with three modes, a consent banner and a conflict banner.
Leaf update mask with etag. Consent link check.
dataproc/exthost/workloads_staging.ts: content-hashed object names, MD5duplicate skip,
ifGenerationMatch=0, resumable upload above 5 MiB, andonly a regional bucket in the region of the run.
dataproc/exthost/workloads_form_actions.ts,workloads_rest_client.ts:the form RPCs, and CreateWorkload, CreateRun and UpdateWorkload.
dataproc/exthost/workloads_troubleshoot.ts,pages/workloads/run_details.*:the Troubleshoot prompt, the handoff to the agent panel, chat or clipboard,
and the button for a failed run.
package.json: commands and buttons. The flagDatacloudSpark__enable_workloadsgates each new command and menu.How it was tested
blaze testofdataproc/exthost:unit_tests,dataproc/shared:unit_tests,run_details_unit_tests,workload_form_unit_tests,workload_details_unit_tests,workloads_list_unit_tests,workloads_webview_service_tests,:vsix_content_test,:tsconfig, thetwo
package.jsonchecker tests,agents/exthost:unit_tests,services_registry_testand the DAK skill tests: 109 targets pass(http://sponge2/74f07306-c209-4cc9-87a4-3ba66b290f2d).
response headers, and check the multipart body byte for byte.
jj piper lint: 3 advisory findings (component harnesses), as in the otherworkload page tests.
hamburger --dry-run: 0 files to change.real project or in a real IDE.
Where to look
This CL merges two best-of-2 candidates for each bug. Claude: cl/1032868163
(forms) and cl/1032855007 (Troubleshoot). Jetski: cl/1032888849 (forms) and
cl/1032855993 (Troubleshoot).
Forms: the code comes from the Claude candidate. It has one form component
with three modes. The Jetski forms copy about 1,300 lines between two forms.
From the Jetski candidate came the rule "only a regional bucket in the
region" (
checkBucket). Multi-region buckets can be on another continent,and design section 3.2 keeps the code in the region. Fixes that neither
candidate had:
workloads_staging.ts,normalizeHeadersandbuildMultipartBody: theVSIX runs gaxios 7, but the code compiles against the gaxios 6 typings.
gaxios 7 gives response headers as a
Headersobject and reads multipartpart headers with
Headers.get. Both candidates failed here at runtime.Rejected: the googleapis
storage_v1client, because it has no chunkedupload that resumes after a failed chunk.
workloads_forms.ts,getEucConsentUrl: both server wordings, the OAuthpath and the Managed Spark redirect URI, as in
common/shared/sql_query/error_parse_context.ts. Rejected: an import ofthat file, because it pulls SQL editor code into the webview bundle.
cluster, and unchanged arguments stay as they are.
Troubleshoot: the structure comes from the Claude candidate. The page sends
only the run name, the extension host loads the run again, and a registered
command gives metrics and the flag check. Rejected: the Jetski request that
carries the full run from the page, because a page can then put any text in
the prompt. From the Jetski candidate came, in
buildRunTroubleshootPrompt:as in Table 3.2 of the Spark troubleshooting agent design.
<untrusted_error_log>block for the error messages.Design choice: outside Antigravity, DAK copies the prompt to the clipboard
before it opens the VS Code chat. VS Code opens its chat view also with no
chat extension, and then drops the prompt.
Related
Design doc Tab 2, sections 2, 3.1 and 3.2. Open Decision 1 (UI staffing) is
still open.