Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-35768

Developer can filter the activity list to a specific branch

    • frank, iapetus, 1.0

      A user should be able to filter the list of branches on an activity screen

      In Scope:

      • Popover/filter as per attached visual and behavior design (assuming JDL popover will help, but may not) - see graphic and gif video
      • Fetching a complete list of available branches to populate the choice (this may need to be optimised to pre-fill with current pages worth of branch names, while it fetches more)
      • Selecting of a branch should result in a fetch of a pages worth of data (as described by Vivek in comments) and then updating of the activity listing
      • URI should be updated to reflect the filtered status
      • URI should filter params should be honoured (so page can be linked to, required elsewhere)
      • Sorting should be master first, followed by alpha sorted list

      Out of scope:

      • Recently used searches
      • Adding to JDL (this stays in dashboard)

      How it works:
      We only have a pages worth of data on the activity screen initially, but a drop down will need to fetch a list of available branches (perhaps vivek can advice how). When a list for a filter is shown, it can show a pages worth of data just for that branch.

          [JENKINS-35768] Developer can filter the activity list to a specific branch

          Vivek Pandey added a comment -

          From API perspective, no additional work is needed.

          To get 10 branches using pagination, use start and limit query parameters.

          /rest/organizations/jenkins/pipelines/:id/branches/?start=0&limit=10 will give 10 recent run branches.

          Vivek Pandey added a comment - From API perspective, no additional work is needed. To get 10 branches using pagination, use start and limit query parameters. /rest/organizations/jenkins/pipelines/:id/branches/?start=0&limit=10 will give 10 recent run branches.

          James Dumay added a comment -

          That's great thanks mate

          James Dumay added a comment - That's great thanks mate

          Michael Neale added a comment -

          NOTE: once the design is finalised we will need a follow on ticket to implement both the filtering itself (which can be used in many ways) and the UI for selecting the filtering branch

          Michael Neale added a comment - NOTE: once the design is finalised we will need a follow on ticket to implement both the filtering itself (which can be used in many ways) and the UI for selecting the filtering branch

          Brody Maclean added a comment -

          Zeplin Link https://zpl.io/Z1U8Iw2

          Flow Mockup

          Filter Icon https://design.google.com/icons/#ic_filter_list

          Dropdown List Order: master, then alpha order.

          Brody Maclean added a comment - Zeplin Link https://zpl.io/Z1U8Iw2 Flow Mockup Filter Icon https://design.google.com/icons/#ic_filter_list Dropdown List Order: master, then alpha order.

          Brody Maclean added a comment -

          Brody Maclean added a comment -

          Michael Neale added a comment -

          That last gif is missing the unselected filter icon from the image

          Michael Neale added a comment - That last gif is missing the unselected filter icon from the image

          Brody Maclean added a comment -

          Updated ✅

          Brody Maclean added a comment - Updated ✅

          Michael Neale added a comment -

          vivek do we have an api for showing what branches are available in a multibranch job (really just what jobs are in a MB folder) - or does there need to be another ticket to track that?

          Michael Neale added a comment - vivek do we have an api for showing what branches are available in a multibranch job (really just what jobs are in a MB folder) - or does there need to be another ticket to track that?

          Vivek Pandey added a comment -

          michaelneale yes we already have such API. On a multibranch pipeline response /organizations/jenkins/pipelines/mbp1/ has an element 'branchNames' that gives list of available branches (pipeline jobs essentially).

          Vivek Pandey added a comment - michaelneale yes we already have such API. On a multibranch pipeline response /organizations/jenkins/pipelines/mbp1/ has an element 'branchNames' that gives list of available branches (pipeline jobs essentially).

          Cliff Meyers added a comment -

          michaelneale so to clarify from vivek's remark, I should already have the full list of branch names available from the multi-branch pipeline itself. Remind me how we are designating the default branch to avoid hard-coding of "master" or is that what we're going with for now?

          Cliff Meyers added a comment - michaelneale so to clarify from vivek 's remark, I should already have the full list of branch names available from the multi-branch pipeline itself. Remind me how we are designating the default branch to avoid hard-coding of "master" or is that what we're going with for now?

          Michael Neale added a comment - - edited

          cliffmeyers there is no official "real" way to get the default branch yet (default branch is only a concept in github and bitbucket, not general SCM. I am not even sure if SCM api has that concept). So we have to assume "master" for now (I am not sure if we codified that service side or just client side convention). Maybe jamesdumay has feelings on what we should do here? My opinion is that it will improve over time but surfacing default branches all the way through the apis is probably out of reach for now**.

            • on top of that, the first user I talked to about it didn't even use the default branch config in github in their case, so even that isn't enough. I suspect jenkins will need to have some config to know what branch is default anyway.

          Michael Neale added a comment - - edited cliffmeyers there is no official "real" way to get the default branch yet (default branch is only a concept in github and bitbucket, not general SCM. I am not even sure if SCM api has that concept). So we have to assume "master" for now (I am not sure if we codified that service side or just client side convention). Maybe jamesdumay has feelings on what we should do here? My opinion is that it will improve over time but surfacing default branches all the way through the apis is probably out of reach for now**. on top of that, the first user I talked to about it didn't even use the default branch config in github in their case, so even that isn't enough. I suspect jenkins will need to have some config to know what branch is default anyway.

          James Dumay added a comment - - edited

          cliffmeyers michaelneale vivek if there is no concept of a default branch for a Pipeline in the REST response for a Pipeline, can we add one vivek? When the branch source exposes that info we can just update what we consider to be the default (I had asked stephenconnolly months back about passing that info down from Github but I think it may have been lost...)

          EDIT: actually I may have misattributed this to Stephen. The issue to provide this data via branch source is JENKINS-38601.

          James Dumay added a comment - - edited cliffmeyers michaelneale vivek if there is no concept of a default branch for a Pipeline in the REST response for a Pipeline, can we add one vivek ? When the branch source exposes that info we can just update what we consider to be the default (I had asked stephenconnolly months back about passing that info down from Github but I think it may have been lost...) EDIT: actually I may have misattributed this to Stephen. The issue to provide this data via branch source is JENKINS-38601 .

          Vivek Pandey added a comment -

          jamesdumay There is no defaultBranch property for multi-branch pipeline REST API, can add one, for now will keep as 'master', later when we have this info available from branch source we can return that value.

          Vivek Pandey added a comment - jamesdumay There is no defaultBranch property for multi-branch pipeline REST API, can add one, for now will keep as 'master', later when we have this info available from branch source we can return that value.

          Cliff Meyers added a comment -

          That sounds good to me.

          Cliff Meyers added a comment - That sounds good to me.

          jamesdumay So what I think we will do is add a new category for the branches and then the default head(s) will be in the "uncategorized" category... NOTE: for some SCM systems there may be more than one default head

          Stephen Connolly added a comment - jamesdumay So what I think we will do is add a new category for the branches and then the default head(s) will be in the "uncategorized" category... NOTE: for some SCM systems there may be more than one default head

          Michael Neale added a comment -

          Also some people want different default branches in Jenkins than they have in github . Or multiple yes. Its not a simple thing sadly.

          Michael Neale added a comment - Also some people want different default branches in Jenkins than they have in github . Or multiple yes. Its not a simple thing sadly.

          James Dumay added a comment -

          stephenconnolly most hosting services like Github and Bitbucket have a single default head defined in their repository settings (which is what I am specifically interested in).

          We can have a fallback to pick one of the multiple heads if that case arises.

          James Dumay added a comment - stephenconnolly most hosting services like Github and Bitbucket have a single default head defined in their repository settings (which is what I am specifically interested in). We can have a fallback to pick one of the multiple heads if that case arises.

          James Dumay added a comment -

          Unless this one is almost done lets put it on hold for now.

          James Dumay added a comment - Unless this one is almost done lets put it on hold for now.

          Cliff Meyers added a comment -

          I had only just started building a UI component for it, so on hold is appropriate.

          Cliff Meyers added a comment - I had only just started building a UI component for it, so on hold is appropriate.

          James Dumay added a comment -

          Thanks Cliff!

          James Dumay added a comment - Thanks Cliff!

          Cliff Meyers added a comment -

          If anyone else grabs this, please ping me first. I have a WIP branch laying around where I started to refactor Dropdown so it can share code with the new Filter component we need for this.

          Cliff Meyers added a comment - If anyone else grabs this, please ping me first. I have a WIP branch laying around where I started to refactor Dropdown so it can share code with the new Filter component we need for this.

          James Dumay added a comment -

          BTW cliffmeyers this one will be one of the first cabs off the rank after we ship

          James Dumay added a comment - BTW cliffmeyers this one will be one of the first cabs off the rank after we ship

          Oleg Korsak added a comment - - edited

          Emmm... this kinda may take more user actions than just clicking a "History" tab in particular branch/build view. Are there any plans to get something similar to pipeline view in classic UI? When user is able to see all build progresses for particular branch at once. (just asking)

          Oleg Korsak added a comment - - edited Emmm... this kinda may take more user actions than just clicking a "History" tab in particular branch/build view. Are there any plans to get something similar to pipeline view in classic UI? When user is able to see all build progresses for particular branch at once. (just asking)

          Michael Neale added a comment -

          kamikaze yes, I believe there is another ticket covering that specifically (needs this one first though).

          Michael Neale added a comment - kamikaze yes, I believe there is another ticket covering that specifically (needs this one first though).

          James Dumay added a comment -

          kamikaze just to clarify, we won't be providing a view where you can see all the pipeline visualizations for multiple runs in one case. At this time we unable to make the design scale well to work with our visualization. Pipeline Stage View. However, you will be able to use the filter to see all the active runs for a particular branch with the completion of this ticket. We will have other links that can jump you to the activity tab filtered to a specific branch.

          James Dumay added a comment - kamikaze just to clarify, we won't be providing a view where you can see all the pipeline visualizations for multiple runs in one case. At this time we unable to make the design scale well to work with our visualization. Pipeline Stage View. However, you will be able to use the filter to see all the active runs for a particular branch with the completion of this ticket. We will have other links that can jump you to the activity tab filtered to a specific branch.

          Keith Zantow added a comment -

          Yes, linking to branches is covered in other tickets (JENKINS-38752, JENKINS-37245). This is implemented with routes, so just .../activity/<encoded-branch-name> works.

          Keith Zantow added a comment - Yes, linking to branches is covered in other tickets ( JENKINS-38752 , JENKINS-37245 ). This is implemented with routes, so just .../activity/<encoded-branch-name> works.

            kzantow Keith Zantow
            jamesdumay James Dumay
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: