Branch deletion

The Retention Policies application only allows for the configuration of retention policies on transactions, but the underlying infrastructure also supports deletion of entire dataset branches and their corresponding JobSpecs. However, the details of branch deletion behavior are not currently configurable. The current default branch deletion behavior is that branches that satisfy all of the following criteria will be deleted:

  • There is no branch with the same name in the corresponding code repository. The corresponding code repository is determined by inspecting the JobSpec on the branch, confirming that it is a transforms JobSpec, and extracting the repository RID from the sourceProvenance field of the JobSpec. In the case where no JobSpec exists on the branch (for example, if the branch was created directly via API), this criterion cannot be satisfied, so the branch will not be deleted.

  • If the branch exists in Catalog (the backend service that manages datasets and transactions), the branch does not have a committed or open transaction in the last seven days.

  • If the branch exists in Catalog, the branch was not created in the last seven days.

  • If the branch does not exist in Catalog (this is typical for datasets that have never been built on the branch), the dataset's JobSpec was not created in the last seven days.

The fact that a dataset branch can exist within the Foundry filesystem but not within Catalog is an implementation detail that users do not generally need to consider; we reference this fact in the above explanation in the interest of completeness and to aid debugging in the event that a branch is not being deleted as expected.

Branch deletion behavior may not be enabled in some Palantir environments created before 2021. If you observe that branches that satisfy all of the above criteria are not being deleted, contact Palantir Support to confirm whether the foundry-retention service is configured with a branch-deletion policy for your environment.