Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-11032

Sort pipelines descendingly, or add sort parameter

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incorrectly Filed
    • None
    • API - REST
    • None
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      Currently pipelines endpoint return pipelines in chronological order

       

      curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/ | jq .values[0]
      

      But, it's mainly interesting to get the last one (`jq .values[-1]` will give the last one in the current page, but going to the last page isn't practical)

       

      `sort` querystring is not supported for /pipelines https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-sort, so it would be very useful to implement it, or sort DESC by default if backward compatibility isn't an issue

       

      curl -u $BB_TOKEN https://api.bitbucket.org/2.0/repositories/comp/projname/pipelines/?sort=-completed_on
      {"error": {"message": "Bad request", "data": {"arguments": {}, "key": "rest-service.rest-service.invalid-sort-attribute"}, "detail": "Invalid sort attribute provided 'completed_on'"}}

       

      Gitlab in comparison sort descendingly https://gitlab.com/gitlab-org/gitlab-ce/issues/32466#note_29989146

       

      The goal is to test if some directories changed since last pipeline, it's possible in gitlab-api like this: https://gitlab.com/gitlab-org/gitlab-ce/issues/19813#note_92434137

      Attachments

        Activity

          People

            Unassigned Unassigned
            ca21973e1ce6 caub_
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: