Skip to content

refactor(inspection): remove task graph plan metadata and link new inspection dialog to task graph debugger - #1054

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qqurzzxpnnzu
Sep 29, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-qqurzzxpnnzu

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Background & Problem

KHI previously generated a raw Graphviz DOT string (TaskSet.DumpGraphviz()) during inspection dry-run and execution, storing it in InspectionPlanMetadata (plan) and transmitting it through DryRunInspectionResponse and GetInspectionMetadataResponse. In the New Inspection dialog (Step 3) and the Inspection Metadata dialog, this DOT string was rendered as plain text inside a <pre> block.

Since the interactive Task Graph Diagnostics page (/debug/task-graph) was introduced, inspecting raw Graphviz DOT source text in the dialog has become redundant and hard to read for large task graphs. Maintaining two separate task graph representations also added unnecessary serialization and metadata overhead across the backend, protobuf API, and frontend.

Solution Approach

  1. Remove Obsolete Task Graph Plan Metadata:

    • Remove TaskSet.DumpGraphviz(), InspectionPlanMetadata, InspectionPlanMetadataKey, and the MetadataPlanComponent UI panel across backend and frontend.
    • Remove InspectionPlan and the plan fields from DryRunInspectionResponse and GetInspectionMetadataResponse in proto/api/v1/inspection.proto, renumbering subsequent fields sequentially.
  2. Deep-Link New Inspection Dialog to Task Graph Diagnostics:

    • Extend TaskGraphDebugSmartComponent (/debug/task-graph) to read tab, inspectionType, and features query parameters on initialization, automatically selecting the target tab, inspection type, and feature override states before resolving the task graph.
    • Replace the raw DOT text card in the New Inspection dialog (Step 3 right pane) with an Open Task Graph Diagnostics link button (taskGraphDebugUrl computed signal) that opens /debug/task-graph?tab=DAG_VIEWER&inspectionType=<id>&features=<id1,id2,...> in a new browser tab.

Impact & Compatibility

  • Protobuf / Connect API (api.v1.InspectionService): DryRunInspectionResponse.plan and GetInspectionMetadataResponse.plan are removed in proto/api/v1/inspection.proto and generated backend/frontend clients are updated in lockstep.
  • .khi File Format: Unaffected. .khi files do not persist InspectionPlanMetadata.

Remaining Issues & Future Work

None.

@kyasbal kyasbal added area:backend-core Core backend frameworks, DAG task runner, and server API area:frontend Web frontend application and UI components labels Sep 28, 2026
@kyasbal
kyasbal requested a review from K53 as a code owner September 28, 2026 09:02
@kyasbal kyasbal added the type:refactor Code refactoring without behavioral change label Sep 28, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request removes the legacy task graph execution plan visualization (InspectionPlan) from the inspection metadata dialogs, dry-run responses, and protobuf definitions. Instead, it introduces a link in the new inspection dialog to open the dedicated Task Graph Diagnostics page, pre-configured with the current inspection type and enabled features via URL query parameters. The review feedback correctly points out that using ApiPathUtil.getServerBasePath() to construct a frontend route URL is incorrect and will result in a 404 error, recommending a root-relative path instead, along with cleaning up the now-unused import.

Comment thread proto/api/v1/inspection.proto Resolved
Comment thread proto/api/v1/inspection.proto Resolved
@kyasbal
kyasbal added this pull request to the merge queue Sep 29, 2026
Merged via the queue into GoogleCloudPlatform:main with commit c707ef3 Sep 29, 2026
17 checks passed
@kyasbal
kyasbal deleted the push-qqurzzxpnnzu branch September 29, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-core Core backend frameworks, DAG task runner, and server API area:frontend Web frontend application and UI components type:refactor Code refactoring without behavioral change

1 participant