Project files: Trashing project files directories upon deletion #381
+56
−2
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.
#380
Local filesystem
Upon project deletion, the project directory is renamed to
{project_name}.{timestamp}.trash
Since project names cannot contain
.
character, dot-delimination is non ambiguous, using a timestamp (int(time.time()
) allows multiple versions of the same project and restore the snapshot.Sufffixing the projectname with
.trash
makes it easy to filter & delete.Important
This approach ensures 100% backward compatibility with existing projects
S3
S3 does not support "directory" renaming so we need a different approach here:
{project_name}.{timestamp}
as the project root. where the timestamp is the projectcreated_at
, so it's deterministic, can be paired with the current version of the project and the list can be sorted by versions/periodsWarning
This is a breaking change that requires changing the project roots in S3 storages,
but as far as we know, S3 is not used anywhere in production yet.