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

ExtractFiles can overwrite destination folder #11594

Closed
wants to merge 9 commits into from

Conversation

TFleury
Copy link

@TFleury TFleury commented Oct 19, 2019

Fixes #11593

@TFleury TFleury requested a review from jtpetty as a code owner October 19, 2019 13:12
@stephenmichaelf
Copy link
Member

Thanks for taking the time to add a fix! Please see the discussion here. Let's add an environment variable that can be used to disable the feature if need be.

@stephenmichaelf stephenmichaelf self-requested a review October 21, 2019 13:04
@TFleury
Copy link
Author

TFleury commented Oct 21, 2019

@stephenmichaelf Sorry, I didn't see the previous PR.
So, I added an environment variable to opt-out.

@@ -10,6 +10,9 @@ var cleanDestinationFolder: boolean = tl.getBoolInput('cleanDestinationFolder',
var repoRoot: string = tl.getVariable('System.DefaultWorkingDirectory');
tl.debug('repoRoot: ' + repoRoot);

var overwriteDestinationVar: string = tl.getVariable('ExtractFile.OverwriteDestination');
Copy link
Member

Choose a reason for hiding this comment

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

Let's call this something like EXTRACT_FILES_PREVENT_FILE_OVERWRITE. The naming you are using is for another type of variable.

@@ -10,6 +10,9 @@ var cleanDestinationFolder: boolean = tl.getBoolInput('cleanDestinationFolder',
var repoRoot: string = tl.getVariable('System.DefaultWorkingDirectory');
tl.debug('repoRoot: ' + repoRoot);

var overwriteDestinationVar: string = tl.getVariable('ExtractFile.OverwriteDestination');
var overwriteDestination: boolean = overwriteDestinationVar ? overwriteDestinationVar.toLowerCase() === 'true' : true;
Copy link
Member

Choose a reason for hiding this comment

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

Let's make this the opposite, let's default it to overwriting and only if the variable is set then we prevent it. This lets users opt-out if they want to but all other users get the overwriting.

@msftclas
Copy link

msftclas commented Oct 24, 2019

CLA assistant check
All CLA requirements met.

@WilliamAntonRohm
Copy link

@stephenmichaelf -- Stephen, please review these changes, per azure-devops-docs issue 8029. If you'd like, I could then re-create this PR for the current base branch.

@github-actions
Copy link

This PR is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the PR otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Nov 10, 2020
@WilliamAntonRohm
Copy link

@stephenmichaelf -- Stephen, per the GitHub nag message above, please let me know if this PR needs to be recreated, or if your #12902 sufficiently addresses #11593, or if that original issue is no longer relevant. Thanks!

@github-actions github-actions bot removed the stale label Nov 10, 2020
@anatolybolshakov
Copy link
Contributor

Hi @WilliamAntonRohm could you please check if it works for you now? We already added support for overwriting of existing files and changes have been rolled out.
@TFleury thanks for contribution here!

@anatolybolshakov
Copy link
Contributor

Closing this at the moment since we have rolled out fix for original issue.

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.

ExtractFiles should allow overwriting destination
6 participants