Skip to content

Fix clobbering old files in release download - #6694

Merged
mislav merged 2 commits into
trunkfrom
clobber-fix
Dec 13, 2022
Merged

mislav merged 2 commits into
trunkfrom
clobber-fix

Conversation

@mislav

@mislav mislav commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

Ensures that the old file to be clobbered is first truncated before writing.

Fixes #6693

Ensures that the old file to be clobbered is first truncated before writing.
@mislav
mislav requested a review from a team as a code owner December 7, 2022 15:07
@mislav
mislav requested review from samcoe and removed request for a team December 7, 2022 15:07

@samcoe samcoe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great. I like that you were able to add tests for this functionality.

}

func Test_downloadRun_cloberAndSkip(t *testing.T) {
oldAssetContents := "older copy to be clobbered"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Might possibly be worth making it clear in the test that this 'old' contents needs to be larger than the new download for the test to be valid. Incase someone modifies 'somedata' in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Good thought.

@Aann102030

This comment was marked as spam.

@mislav
mislav enabled auto-merge (squash) December 13, 2022 18:33
@mislav
mislav merged commit dd8c5c9 into trunk Dec 13, 2022
@mislav
mislav deleted the clobber-fix branch December 13, 2022 18:39
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.

gh package download --clobber does not truncate previous output file

5 participants