#1413: Support automatic cleanups for NodeSchemas without a sub resource #1419
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.
Summary
#1413
Removes a restriction so that cartography's data model can now automatically clean up NodeSchemas that don't have a tenant relationship.
In these cases, the nodes will not be deleted even if they are considered stale, but their stale relationships will be.
We do it this way because cartography syncs assets one tenant at a time, and stale nodes can only be safely deleted if they are tied to a tenant so that we do not erroneously delete nodes attached to other tenants.
Related issues or links
We discussed this in the above issue but I'll summarize a bit here: in the case of GitHub, GitHubUsers don't have a true "tenant" relationship with their organization because they can exist independent of their organizations. In this case, it makes sense for a GitHubUser to have a node schema that does not have a tenant rel. If we want to list out all of the users in an organization, then we simply query for the organization and its attached users.
Checklist
Provide proof that this works (this makes reviews move faster). Please perform one or more of the following: