Change original_build_info to return the most recent pipeline
What does this MR do and why?
This MR changes the Packages::Package#original_build_info
to return the last build info, instead of the first one.
In order to make it a bit simpler the method renaming will be done in the separate issue #410352 (closed)
Screenshots or screen recordings
No.
How to set up and validate locally
-
Create a new package and
3
linked pipelinesdef fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end package = FactoryBot.create(:npm_package, project: Project.first) FactoryBot.create_list(:package_build_info, 3, :with_pipeline, package: package)
Note down project id, package id and pipelines id they will be required at the later step.
-
Send an API request with curl docs
curl --header "PRIVATE-TOKEN: <your_PAT>" "http://<gdk_host>/api/v4/projects/<project_id>/packages/<package_id>"
The response should contain the first (original) pipeline.
-
Enable the feature flag to get the actual MR changes
Feature.enable(:packages_display_last_pipeline, Project.find(<project_id>))
-
Send an API request with curl docs
curl --header "PRIVATE-TOKEN: <your_PAT>" "http://<gdk_host>/api/v4/projects/<project_id>/packages/<package_id>"
The response should contain the most recent pipeline.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #365828 (closed)