Skip to content

Directories in AzurePipelinesBuildInfo are FilePaths - FilePath.GetDirectory then inconsistent #3590

@mandalorianbob

Description

@mandalorianbob

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake Frosting

Cake version

1.3.0

Operating system

Windows

Operating system architecture

64-Bit

CI Server

Azure DevOps

What are you seeing?

In my Build Contexts, I'm creating Paths based on the BinariesDirectory and ArtifactsStagingDirectory.

For some reason, these are FilePaths in AzurePipelinesBuildInfo.cs.

Obviously, FilePath isn't an appropriate input for combining DirectoryPaths, and so I have to change them to DirectoryPath. My first instinct was to call GetDirectory().

Unfortunately, when the FilePath is actually a directory, and not a file, GetDirectory only recognizes this if the full path ends with a "/". But the Environment Variables being used presumably do not end with /, so instead of returning the directory, it returns the parent directory.

What is expected?

All directories in the Azure Pipelines Provider should be DirectoryPaths, not FilePaths. If they have to be FilePaths, then the FilePaths should have "/" appended to the end so that GetDirectory returns the proper value.

Steps to Reproduce

This is an API definition issue.

Output log

I actually do have output:
Azure Pipeline Binaries Directory (toString): D:/a/_work/1/b
Azure Pipeline Binaries Directory GetDirectory(): D:/a/_work/1
Azure Pipeline Binaries Directory FullPath: D:/a/_work/1/b

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions