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

Yaml becomes invalid when specific checkout: syntax occurs more than once #582

Open
Snijderman opened this issue Jan 6, 2023 · 1 comment

Comments

@Snijderman
Copy link

Hi,

I've got this strange issue when trying multiple times to get sources from a repo in a yaml pipeline.
This works if I use 'self' or a defined repository, but it doesn't work when using the following syntax:

checkout: git://$(repositoryName)@$(repositoryBranch)

This issue occurs when this syntax is present more than once in the pipeline.
For example, this works:

stages:
   - stage: GetSourcesForStage1
     displayName: 'Get sources for stage 1'
     pool:
        name: $(poolName)
     jobs:
        - job: Stage1GetSources
          workspace:
             clean: all
          steps:
             - checkout: repositorySources

   - stage: GetSourcesForStage2
     displayName: 'Get sources for stage 2'
     dependsOn:
     pool:
        name: $(poolName)
     jobs:
        - job: Stage2GetSources
          workspace:
             clean: all
          steps:
             - checkout: repositorySources

and this also works;

stages:
   - stage: GetSourcesForStage1
     displayName: 'Get sources for stage 1'
     pool:
        name: $(poolName)
     jobs:
        - job: Stage1GetSources
          workspace:
             clean: all
          steps:
             - checkout: git://$(solutionRepository)@$(Build.SourceBranch)

   - stage: GetSourcesForStage2
     displayName: 'Get sources for stage 2'
     dependsOn:
     pool:
        name: $(poolName)
     jobs:
        - job: Stage2GetSources
          workspace:
             clean: all
          steps:
             - checkout: repositorySources

But this doesn't:

stages:
   - stage: GetSourcesForStage1
     displayName: 'Get sources for stage 1'
     pool:
        name: $(poolName)
     jobs:
        - job: Stage1GetSources
          workspace:
             clean: all
          steps:
             - checkout: git://$(solutionRepository)@$(Build.SourceBranch)

   - stage: GetSourcesForStage2
     displayName: 'Get sources for stage 2'
     dependsOn:
     pool:
        name: $(poolName)
     jobs:
        - job: Stage2GetSources
          workspace:
             clean: all
          steps:
             - checkout: git://$(solutionRepository)@$(Build.SourceBranch)

Validation in the online designer doesn't give any response when trying to validate it and when I try to run the pipeline, it gives this error:

image

I also played around with different workspace cleaning and dependsOn settings, but that doesn't change the result.

Looks like an issue or am I doing something wrong?
(btw. we're using our own managed pools, don't know it that makes any difference)

I've attached a simple yaml file that produces the issue, __OwnManagedPool__ and __PathToRepository__ need to be replaced by a valid value.
yaml-checkout-issue.zip

@kirill-ivlev
Copy link

Hi @Snijderman, thanks for reporting! We are working on more prioritized issues at the moment but will get back to this one soon.

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

No branches or pull requests

2 participants