Skip to content

Handle deletion of namespaces during dj push#2148

Merged
shangyian merged 2 commits into
DataJunction:mainfrom
shangyian:deployment-del-ns
May 19, 2026
Merged

Handle deletion of namespaces during dj push#2148
shangyian merged 2 commits into
DataJunction:mainfrom
shangyian:deployment-del-ns

Conversation

@shangyian
Copy link
Copy Markdown
Collaborator

@shangyian shangyian commented May 18, 2026

Summary

dj push ./nodes --namespace <ns> was supposed to sync the server-side namespace with the contents of the folder, but child namespaces were never pruned. If you deleted a sub-folder locally, the nodes inside it got removed but the empty namespace lingered on the server, breaking the "this folder is the source of truth" mental model during deployments.

This PR adds server-side namespace pruning in the deployment orchestrator. During plan creation, we diff the existing child namespaces under the deployment root against the desired set (built from local nodes' rendered names). Anything in the diff gets removed after node deletion, deepest-first. These changes are dry-run aware, so that calls to POST /deployments/impact also surface upcoming namespace deletions in its results.

This also adds a new result type: DeploymentResult.Type.NAMESPACE so that namespace operations show up distinctly in the deployment report alongside node / link / tag.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit 6ceae9c
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a0bae4cbdd0630008075112

@shangyian shangyian changed the title Handle deletion of namespaces during sync Handle deletion of namespaces during dj push May 18, 2026
@shangyian shangyian marked this pull request as ready for review May 19, 2026 02:08
@shangyian shangyian merged commit ae8ae47 into DataJunction:main May 19, 2026
21 checks passed
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.

1 participant