Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLVS-1434 Extend JsonFileHandler #5661

Merged

Conversation

gabriela-trutan-sonarsource
Copy link
Contributor

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource commented Sep 2, 2024

SLVS-1434

This PR targets this PR as both are preparation for the server connection repository

@terraform-techuser terraform-techuser changed the title SLVS-1434 Extend JsonFileHandler SLVS-1434 Extend JsonFileHandler Sep 2, 2024
bool TryWriteToFile<T>(string filePath, T model) where T : class;
}

[Export(typeof(IJsonFileHandler))]
[PartCreationPolicy(CreationPolicy.Shared)]
[PartCreationPolicy(CreationPolicy.NonShared)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you removed the lock it doesn't actually matter if it's shared or not 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I don't think there is a good reason for it to be a singleton. In fact, it might be dangerous if in some point any state is being added to the class.

/// <typeparam name="T">The type of the model that will be serialized</typeparam>
/// <param name="filePath">The path to the file</param>
/// <param name="content">The content of the file deserialized to the provided type</param>
/// <returns>True if the file could be read and the model could be serialized successfully. False otherwise</returns>
bool TryReadFile<T>(string filePath, out T content) where T : class;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method going to be used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I think not. I could remove it.

Base automatically changed from gt/add-credentials-uri to feature/new-connected-mode September 3, 2024 09:08
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource marked this pull request as ready for review September 3, 2024 09:21
Copy link

sonarqubecloud bot commented Sep 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 85%)

See analysis details on SonarCloud

@gabriela-trutan-sonarsource gabriela-trutan-sonarsource merged commit 6dc2527 into feature/new-connected-mode Sep 3, 2024
1 of 2 checks passed
@gabriela-trutan-sonarsource gabriela-trutan-sonarsource deleted the gt/extend-file-handler branch September 3, 2024 09:27
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.

2 participants