-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Wrong path when resolving absolute file paths in Azure Pipelines #220
Comments
Thank you for reporting this bug, indeed my current code doesn't handle absolute paths at all. Microsoft should improve their azure pipelines docs, because of this I didn't even know that you can reference local templates via absolute paths. mentions any variations of relative paths, but no single absolute path is shown. Just parsing a template via my code would skip validation of |
I submitted MicrosoftDocs/azure-devops-docs#13674 to update the documentation.
Agreed, though for me the expansion of the template is the interesting part. The Pipeline Preview API could be used to validate the resulting YAML, if needed. Regarding unit testing, the tests in |
I'm only doing integration testing, since more than a year. For example add a line to your test pipeline here: runner.server/.github/workflows/nuget.yml Line 173 in c536d76
and add your test files here: |
Yes the pipeline preview api seem to only expand committed referenced templates. That's really a big limitation. |
…221) * Possible fix for #220 * add relative-and-absolute-paths test --------- Co-authored-by: ChristopherHX <[email protected]>
I have added a test for this bug, thank you for improving this program. |
First off, awesome job adding support for Azure Pipelines!
I am attempting to understand how you're parsing azure-pipelines so that I could potentially write unit tests or validate YAML formatting locally before committing. My team uses templates extensively, so minor malformed files are a huge problem.
I'm not 100% convinced I'm doing something wrong with the
Context
Expected:
/
should be resolved from the root of the repository. (eg/<path>/<to>/<template>.yml
)/
should be resolved relative to the current template. (eg<file>.yml
,../<relative-path>.yml
)Actual:
/
are resolved relative to the current file.Steps to Reproduce:
I have an azure pipeline with the following simplified folder structure:
The pipeline has issues resolving the
variables.yml
file.My code to test loading the pipeline:
The test fails with
System.IO.DirectoryNotFoundException : Could not find a part of the path 'c:\code\myrepo\devops\pipelines\microservices\service1\devops\pipelines\templates\jobs\microservice-ci.yml'
The text was updated successfully, but these errors were encountered: