chrismason / DocFxExtension

VSTS Extension to invoke the DocFx tool for generating documentation during a build
4 stars 2 forks source link

Task may not pick correct docfx version #3

Open TimThrelkeld opened 5 years ago

TimThrelkeld commented 5 years ago
  1. Install 0.1.19 version of this task on TFS 2018.2
  2. Run over a period of time where the docfx tool revs in version.

Expected: Task uses the latest version of docfx Actual: Task uses the earliest version of docfx (though that may not always be the case)

Build output:

2019-05-01T22:49:52.3822000Z Package "docfx.console.2.42.0" is already installed.
2019-05-01T22:49:52.3829284Z C:\build\tfs\_work\23\s
2019-05-01T22:49:52.3869480Z [command]C:\build\tfs\_work\_tasks\DocFxTask_e0923c33-09f9-43a0-a8af-86b7d0d76b03\0.1.19\tools\docfx.console.2.38.1\tools\docfx.exe 

It appears that this function simply looks for the first directory in the tools dir returned by fs.readdirSync() that begins with 'docfx.console' and uses it. fs.readdirSync() does not define any type of ordering so it is possible that this might work sometimes. Maybe it should pay attention to version number.

Work around right now is to manually clean-up the tools directory. There might be a nuget command to clean-up old packages.

prasadu-microsoft commented 5 years ago

I see the same behavior with inconsistent tools versions being used. Any chance we can get a fix for this?

tbolon commented 3 years ago

I agree with that. I just discovered that this extension is using the first version found.

As a quick workaround I has to delete the other directories to only keep the latest.

I will remove this extension as it seems it's not maintained anymore and rely on manual choco install and run.