Open ChristoWolf opened 4 months ago
Hi @ChristoWolf
yes, you are correct, buildParameters
are just for the classic queue-time variables.
But you can use the templateParameters
argument, and it should work as expected 😉
Please let me know if that solves your problem.
Thanks @huserben! Ah yes, now I understand this, had a bit of a tough time understanding the docs for that.
Great to hear it worked.
Well, I was struggling to find how to use it...I did not do a good job of documenting this. It's something that certainly could be improved.
On the other hand it's a bit annoying, as I have to create a "new version" of the extension just to update the documentation...
Anyway if I find some time this weekend I'll at least update what's visible on github so that the change would be included in the next release...
Thanks for reporting this!
@huserben, I am also facing the same issue. Can you please put a screenshot of how you are passing the template parameters to make it work ? Getting this error when using the template parameters:
Hi @madhavagrawal17
sorry for the dealy in the response. Would you mind sharing your configuration to so I can see what might be the issue.
Are you using buildParameters or templateParameters ?
@huserben, I am using the tempalteParameters. Here is the screenshot of my configuration:
Thanks @madhavagrawal17
could you also share the full logs from the failing pipeline (the parts till the error occurs - ideally as text) and the definition of the pipeline you are triggering?
I see you are using the classic view, not yaml. Just to be sure: the triggered pipeline is defined in yaml, right?
@huserben, We are using the classic release pipeline but we are triggering the yaml pipeline, Here is the definition:
Logs attached here: Logs_triggerbuildpipeline.txt
@madhavagrawal17
Thanks for the additional info.
I can see that you are triggering the pipeline from a release definition. Also I can see the following error in the logs:
2024-05-01T22:02:42.0233840Z Error message: Error: The repository Office in project {projectId}could not be retrieved. Verify the name and credentials being used.
I've never tested the combination of a release pipeline triggering a yaml pipeline, so some questions to dig deeper:
Edit: Actually there are certain unsupported things when using a release pipeline, as in the docs it's stating:
When the task is used within a release definition, certain configuration options might not work properly if there is no build artifact linked (e.g. for Use same User that triggered Build and Use same Branch). The task was designed only with build definitions in mind, in case you need it to work in Release Definitions without any builds linked please open a new issue on [issues](https://github.com/huserben/TfsExtensions/issues) and explain your problem to see whether there is a workaround
I can see that you are using "Use same user that triggered the build" and "use same branch". Try to manually specify this instead of using the checkbox. That would also be in line with the error you're getting.
@huserben, Thanks for your response. When I trigger the release pipeline without the template parameters then everything works fine. I see the issue only when I pass the template parameter. I also tried with disabling "Use same user that triggered the build" and "use same branch" and specifying it manually but it gave me the same error.
Hi @madhavagrawal17
ok, thanks for confirming this. What authentication method are you using? The OAuth token from the pipeline or a personal access token?
The error you're getting in the logs seem to indicate some issue with an included/template repository you are including in the yaml: The repository in project could not be retrieved
See also StackOverflow. Could you check this out and see if this might apply to you? While it's odd it's only happening when you are using template parameters, the error does not look like it's related to this...
@huserben, Thanks for providing me the link but I am not using any template reference in my build yaml. So, I think it won't be related to the link you have provided. Not sure why it only fails with the template parameters.
Hi @huserben!
So unless I am doing something wrong, it looks like that your TriggerBuild@4 task does not support runtime parameters when passing
buildParameters
. More precisely, when the pipeline-to-be-triggered takes such parameters, and the triggering pipeline attempts to pass arguments to those via the task'sbuildParameters
, but seemingly fails:If using classic queue-time variables instead, everything works as expected, the arguments are passed correctly.