Skip to content

Don't rename unless file is in same dir#603

Merged
rdimitrov merged 4 commits intotheupdateframework:masterfrom
jonnystoten:fix-cross-device-rename
Feb 12, 2024
Merged

Don't rename unless file is in same dir#603
rdimitrov merged 4 commits intotheupdateframework:masterfrom
jonnystoten:fix-cross-device-rename

Conversation

@jonnystoten
Copy link
Copy Markdown
Contributor

This was originally done for windows only, but renaming can cause issues regardless of OS if the target dir is on another device.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 6, 2024

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (0859947) 70.18% compared to head (0569daf) 70.54%.

Files Patch % Lines
metadata/updater/updater.go 42.85% 10 Missing and 6 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #603      +/-   ##
==========================================
+ Coverage   70.18%   70.54%   +0.36%     
==========================================
  Files          10       10              
  Lines        2123     2122       -1     
==========================================
+ Hits         1490     1497       +7     
+ Misses        517      504      -13     
- Partials      116      121       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@kipz kipz left a comment

Choose a reason for hiding this comment

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

Hard to test this one on GHA. Works for me at least.

rdimitrov
rdimitrov previously approved these changes Feb 6, 2024
Copy link
Copy Markdown
Contributor

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this! 🚀

@rdimitrov
Copy link
Copy Markdown
Contributor

rdimitrov commented Feb 6, 2024

Hard to test this one on GHA. Works for me at least.

@kipz - Thank you for testing this! 💯

My assumption is the examples that we run now both on windows and linux should be enough to catch potential errors of this, i.e. a temp file failed to be renamed. On that note, I'll go ahead and enable the macos environment too 👍

@rdimitrov
Copy link
Copy Markdown
Contributor

rdimitrov commented Feb 6, 2024

Here's the PR enabling the runner environments - #604. My assumption was we enabled the windows one for all, but it was just for the unit tests. Now it's going to run the examples too 👍

@jonnystoten - Now that I enabled the runners in the PR I see some of the examples for windows do fail. I don't have a windows machine in hand, do you think you can take a look while you're at this topic? I can give it a go using the CI later today or tomorrow too.

@rdimitrov rdimitrov self-requested a review February 6, 2024 15:34
@rdimitrov rdimitrov dismissed their stale review February 6, 2024 15:49

Let's wait until the CI for windows is green.

This was originally done for windows only, but renaming can cause issues
regardless of OS if the target dir is on another device.

Signed-off-by: Jonny Stoten <[email protected]>
@rdimitrov rdimitrov force-pushed the fix-cross-device-rename branch from 6d2722f to aea0415 Compare February 7, 2024 00:13
Copy link
Copy Markdown
Contributor

@rdimitrov rdimitrov left a comment

Choose a reason for hiding this comment

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

When we enabled the windows runner it manifested some errors which is not surprising since we haven't tested go-tuf-metadata at all on Windows. I've opened an issue about it if someone is interested in addressing this - #605.

I'm okay to accept this PR since it doesn't seem related to the issue I mention 👍

@jonnystoten
Copy link
Copy Markdown
Contributor Author

Hey thanks @rdimitrov ! I actually don't have a windows machine either but I could have a look using the CI to test, the failure I can see looks pretty straightforward.

@rdimitrov rdimitrov merged commit 171b2e4 into theupdateframework:master Feb 12, 2024
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.

4 participants