-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: Fix config file handle closing and run cross platform unit tests #639
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daniel-zelazny
approved these changes
Feb 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, please consider two small suggestions :)
nieomylnieja
added a commit
to nobl9/sloctl
that referenced
this pull request
Feb 5, 2025
## Motivation Currently, whenever modifying the `config.toml` file on Windows using `sloctl config` commands an error arises: > Error: rename C:\Users\mh\.config\nobl9\config.toml3389036250 C:\Users\mh\.config\nobl9\config.toml: The process cannot access the file because it is being used by another process. The issue comes from Nobl9 SDK and is fixed by nobl9/nobl9-go#639. ## Related changes - nobl9/nobl9-go#639 ## Testing Tested on Windows 11 23H2 run inside Virtual Box. ![image](https://github.com/user-attachments/assets/81fa4790-3195-4be9-9925-e517f9bb80e0) ## Release Notes `sloctl config` commands which modify _config.toml_ should now work on Windows.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
The main reason for this PR is to fix config file writing on Windows, because we were not properly closing the file handle before renaming it, this cause an error on Windows, stating that file is already used by another process.
Summary
In order to better support Linux, MacOS and Windows usages we should run the unit tests on each of them.
Release Notes
sdk.FileConfig
operations which attempt to save the config file should now operate on Windows without any issues.