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

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

Closed
2 tasks done
mandalorianbob opened this issue Oct 12, 2021 · 1 comment · Fixed by #3601
Closed
2 tasks done
Assignees
Milestone

Comments

@mandalorianbob
Copy link

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

@devlead devlead added this to the v2.0.0 milestone Oct 13, 2021
@devlead devlead self-assigned this Oct 13, 2021
devlead added a commit to devlead/cake that referenced this issue Oct 13, 2021
devlead added a commit to devlead/cake that referenced this issue Oct 14, 2021
devlead added a commit to devlead/cake that referenced this issue Oct 14, 2021
devlead added a commit to devlead/cake that referenced this issue Oct 14, 2021
devlead added a commit that referenced this issue Oct 14, 2021
GH3590: AzurePipelinesBuildInfo Directories File>DirectoryPath
@cake-build-bot
Copy link

🎉 This issue has been resolved in version v2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants