So I've run into two questions that I can't seem to find the answer to after doing some googling, and I'm a bit surprised the docs don't cover them at all.
First is, in the branches portion of the pipelines file, how do I reference branches that are in folders/nested? For example the branch testing/johnQA? I tried exactly that format but the pipeline is only running default for that branch so evidently it's not parsing it correctly.
Second question is: how does it work if bitbucket-pipelines.yml is different across branches? Note that I'm talking about an instance where this file already defines seperate actions for each branch, so I'm curious how a conflict would be handled, particularly between the file checked into master and a different file checked into a branch running a pipeline. Would master always take precedence? Or would the branch first use the file in itself for the pipeline?
Thanks!
Hi @lshermparr ,
Welcome to our community, I see you are new here =]
how do I reference branches that are in folders/nested? For example the branch testing/johnQA?
That is not possible at the moment due to a bug affecting the background API for pipelines #15358 - REST API 2.0 to get raw content of an individual file on fails in case of slash in the branch name.
It also blocks you to create a schedule trigger for such branch as you can see in this question: Solved: Unable to schedule bitbucket pipeline.
We are sorry about that, but until it is fixed the only workaround is to avoid branch names with special characters on it.
how does it work if bitbucket-pipelines.yml is different across branches?
(...) Would master always take precedence? Or would the branch first use the file in itself for the pipeline?
I got your point. The behavior here is that pipelines will always consider the YML file present in the branch who receives a commit or a merge (the branch to be built).
I hope that answers your questions.
Hey thanks for the update!
So in regards to the issue with slashes in the branch name, is their an ETA (even just a rough one) on a fix for that issue? Looks like it was reported and acknowledged over a year ago - so just curious if a fix will be coming soon
FYI for yourself/others reading this - it appears at least part of this issue has a workaround - I was able to at least get pipelines running by wrapping the branch names in the pipeline definitions part of bitbucket-pipelines.yml with single-quotes like so:
pipelines:
branches:
master:
- step: *lint
'testing/primaryQA':
- step: *build
- step: *deploy
Haven't tested whether this works in the browser for scheduling pipelines and I suspect it still won't work for the REST API like you said, as that's a seperate parser that's probably still going to be unhappy even wrapped in single quotes
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for sharing your findings here. That will be useful for other users.
Regarding your question on a fix, I'm working on it internally so we can bring more attention to this case. I still don't have an ETA. Please keep your eyes on #15358 - REST API 2.0 to get raw content of an individual file on fails in case of slash in the branch name for more updates.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.