microsoft / windows-dev-center-vsts-extension

Visual Studio Team Services (VSTS) extension for performing continuous delivery to the Windows Dev Center store from your automated CI builds
Other
42 stars 17 forks source link

Publish task checks for Metadata directory even when 'No update' is selected #45

Closed ian-craig closed 6 years ago

ian-craig commented 7 years ago
  1. Create a Windows Store - Publish task
  2. Set Metadata update method to Text Metadata
  3. Enter Metadata root folder
  4. Save
  5. In a release for this task, go to Environments -> YourTask
  6. On the right hand side, where you can modify the task before deploying change Metadata update method to "No update"
  7. Ensure the metadata folder doesn't exist (e.g. if you have a build version in the path and you haven't created metadata for that build version)
  8. Deploy the publish task

Result: Deployment fails because metadata directory doesn't exist

Expected: Don't check if the directory exists because it's not relevant. Also, this path is hidden in my task editor UI so it's very confusing where the task is getting this path from.

Logs:

2017-11-07T16:55:56.8654258Z ##[debug]metadataUpdateMethod=NoUpdate
...
2017-11-07T16:55:56.8654258Z ##[debug]metadataPath=\\ocentral\teams\XXXXXXX\Windows\releases\BUILDVERSION\Metadata\
2017-11-07T16:55:56.8654258Z ##[debug]check path : \\ocentral\teams\XXXXXXX\Windows\releases\BUILDVERSION\Metadata\
2017-11-07T16:55:57.0529498Z ##[error]Error: Not found metadataPath: \\ocentral\teams\XXXXXXX\Windows\releases\BUILDVERSION\Metadata\
2017-11-07T16:55:57.0685395Z ##[debug]Processed: ##vso[task.issue type=error;]Error: Not found metadataPath: \\ocentral\teams\XXXXXXX\Windows\releases\BUILDVERSION\Metadata\
2017-11-07T16:55:57.0685395Z     at checkPath (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\node_modules\vsts-task-lib\task.js:645:15)
2017-11-07T16:55:57.0685395Z     at Object.getPathInput (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\node_modules\vsts-task-lib\task.js:438:13)
2017-11-07T16:55:57.0685395Z     at gatherParams (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:69:63)
2017-11-07T16:55:57.0685395Z     at E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:95:30
2017-11-07T16:55:57.0685395Z     at next (native)
2017-11-07T16:55:57.0685395Z     at E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:10:65
2017-11-07T16:55:57.0685395Z     at __awaiter (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:6:12)
2017-11-07T16:55:57.0685395Z     at main (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:93:12)
2017-11-07T16:55:57.0685395Z     at Object.<anonymous> (E:\_work\_tasks\store-publish_8e70da9d-532d-4416-a07f-5ec10f84339f\0.10.16\local\publishUi.js:108:1)
2017-11-07T16:55:57.0685395Z     at Module._compile (module.js:570:32)

It looks like if before changing the metadata option to "No update" I clear the metadata path, this problem doesn't happen. I'm guessing the bug is you have

if (!string.IsNullOrWhitespace(metadataPath))
{
    // Check path exists
}

but should have

if (metadataMethod != NoUpdate && !string.IsNullOrWhitespace(metadataPath))
{
    // Check path exists
}

Either that, or the editor should remove the content of the Metadata root folder field when it hides the field.

I haven't tested saving the task directly in the main editor, it may have the same issue.

zurdev commented 7 years ago

Ian, thanks for reporting this issue. Your assumption was correct, we check whether path exists if the value is not null, ignoring the selected metadata option. For now, please clear the metadata path when you're not intending to update metadata.

elendil326 commented 6 years ago

This has been resolved with pull request #49