Skip to content

Filesystem management in RD #4533

Open
Open
@bclothier

Description

@bclothier

There are few tech debts we have surrounding file management in RD.

  1. We had copy'n'pasted method for building the root path to the %APPDATA%\Rubberduck\* folders for various things. With PR Adds Add Predeclared Class Module Command #4225 a IPersistancePathProvider was introduced to abstract the root path and thus make it easy for various subsystems to get their own folder for persisting their data.

  2. We have TEMP_PATH constant scattered around and the files are not controlled in any manner. Ideally, there should be a method that allows a using (var tempFile = MakeSomeTempFile(source)) block to explicitly scope the lifetime of a temporary file, while allowing the calling code to perform its work with the file.

  3. We are not currently using System.IO.Abstractions; some subsystems has a direct dependency on the System.IO, hampering its testability, while other has their handrolled interfaces that wraps the IO operations. We need to make this consistent, as to keep System.IO out of those subsystems.

In the end, we need to ensure that we have an uniform system for accessing files (both permanent and temporary) that do not harm the testability and is predictable (e.g. doesn't write a file to a random location and then forget about it).

Metadata

Metadata

Assignees

Labels

development-issueIssues encountered while developing RD, not in RD itselfdifficulty-02-duckyResolving these involves the internal API, but with relatively easy problems to solve.enhancementFeature requests, or enhancements to existing features. Ideas. Anything within the project's scope.technical-debtThis makes development harder or is leftover from a PullRequest. Needs to be adressed at some point.up-for-grabsUse this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions