Skip to content

Displays latest pipeline details on package list page

What does this MR do and why?

Why

In the page that lists the available packages, we show a pipeline if the package was built by one.

The problem is that, the package (name+version) can accept duplicates and so multiple pipelines could have built it. The index page is showing the oldest pipeline. Instead show the newest pipeline.

What

  • Changes the packages list GraphQL query pipelines fragment to request first instead of last
  • Adds feature specs to confirm behaviour

Screenshots or screen recordings

No change in UI

How to set up and validate locally

  1. Open ci editor for project with files - <project-url>-/ci/editor
  2. Copy the following in the editor by replacing <filename> with any file from the project
image: curlimages/curl:latest

stages:
  - upload

upload:
  stage: upload
  script:
    - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file <filename> "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/0.0.1/<filename>"'
  1. Commit changes a few times, this should trigger pipelines & publish files to the package.
  2. Visit the package registry list page at project & group level
  3. Confirm that the sha is from the latest pipeline instead of the oldest for the my_package package. This can be confirmed by checking the package details page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Fixes frontend for #365828 (closed)

Edited by Rahul Chanila

Merge request reports