Skip to content

feat: construct tree and violations#1653

Open
megha-narayanan wants to merge 6 commits into
aws:feat/cdk-explorerfrom
megha-narayanan:feat/explorer-web-tree-violations-v2
Open

feat: construct tree and violations#1653
megha-narayanan wants to merge 6 commits into
aws:feat/cdk-explorerfrom
megha-narayanan:feat/explorer-web-tree-violations-v2

Conversation

@megha-narayanan

Copy link
Copy Markdown

Adds two read-only views to the cdk explore web UI.

  • Construct tree (GET /api/tree): the synthesized construct hierarchy. Each
    node is flagged with the highest severity of any policy violation on it, so
    problem areas are visible at a glance.
  • Policy-validation panel (GET /api/policy-validation): violations grouped
    by rule, sorted by severity, labeled with the originating plugin.

The server reads the cloud assembly in cdk.out and returns a wire-stable,
app-relative view. The backend owns the full transform from core construct node
to displayed node, including default-child collapse and the per-node
highest-severity join, so the frontend renders without re-deriving any of it.

Out of scope

  • Navigation between a construct, its synthesized template, and its source. The
    wire model already carries templateFile and sourceLocation, but no
    navigation UI yet.
  • Frontend tests (adds deps, so future PR)

frontend (from my monitor, so text looks small):
Screenshot 2026-06-19 at 12 50 53 PM

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed
    • Release notes for the new version:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

On top of the cloudscape frontend scaffold (aws#1606):

- GET /api/tree + /api/policy-validation (toWebNode, normalizeViolations); assemblyDir plumbing; no-store on the unversioned bundle

- collapseDefaultChildren folds the synthetic Resource/Default leaf into its parent (display only; violations join on the full tree)

- ConstructTree: collapsible, spill-proof rows, friendly type labels, double-click rename with localStorage + revert

- ViolationsPanel: severity-sorted, colored [SEVERITY] prefix, scrollable

- App: uniform Cloudscape Containers, horizontally resizable construct tree
Backend owns the core-node to displayed-node transform: default-child collapse and per-node highest-severity join. The Cloudscape frontend renders without re-deriving it, and severity rules are shared between server and SPA. Read-only; three-way navigation and frontend tests are deferred to follow-ups.
severityRank, severityHexColor, normalize and severityStyle only ever receive a resolved label: displaySeverity always returns a string and the tree guards before calling. The string | undefined params and the ?? fallback were dead, so narrow to string.
@megha-narayanan megha-narayanan marked this pull request as ready for review June 19, 2026 19:15
…nsError

The cdk-lsp merge into the base folds a failed validation-report load into AssemblyData.warnings and removes the violationsError field. Drop the web reportError plumbing (route body, ViolationsResponse type, ViolationsPanel banner, and its route test) to match the new contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant