Search code examples
google-cloud-platformgoogle-cloud-buildgoogle-cloud-repository

Why the history in gcb is not able to sort by branchname?


I'm able to sort by source but, unable to sort by branch, it shows only few branches for all sources.

I used it like Source:[source_name] OR Branch:[branch_name] in the history tab.

Console

can anyone tell me how to sort based on the branch?


Solution

  • I think that is normal, I have the same thing on my side.

    My history: enter image description here

    2 branches: Master and Open-source. However when I filter on the branch, even master I have nothing:

    enter image description here

    Why?? Because I have any trigger on the master or open-source branch. My trigger is on any branch.

    enter image description here

    Thus the build branch param is not set and thus you can search/filter on it. On others project, when I have a filter per branch, the history is correct and I can filter on the branch name.

    An alternative is to use the gcloud command and the filter param like this

    gcloud builds list --filter="substitutions.BRANCH_NAME=<YourBranchName>"
    

    More detail on the filter capabilities and expression