detect-previous-failed-tests failed when running on fork pipelines
detect-previous-failed-tests
failed when running on fork pipelines, because it cannot find the pipeline.
This blocks the pipeline on forks and potentially other projects.
Example: https://gitlab.com/edith007/gitlab/-/jobs/1718891023
$ retrieve_previous_failed_tests ${PREVIOUS_FAILED_TESTS_DIR} "${RSPEC_PG_REGEX}" "${RSPEC_EE_PG_REGEX}"
Attempting to build pipeline test report...
/usr/local/lib/ruby/2.7.0/net/http/response.rb:124:in `error!': 404 "Not Found" (Net::HTTPServerException)
from /usr/local/lib/ruby/2.7.0/net/http/response.rb:133:in `value'
from scripts/pipeline_test_report_builder.rb:117:in `block (2 levels) in fetch'
from /usr/local/lib/ruby/2.7.0/net/http.rb:1537:in `block in transport_request'
from /usr/local/lib/ruby/2.7.0/net/http/response.rb:167:in `reading_body'
from /usr/local/lib/ruby/2.7.0/net/http.rb:1536:in `transport_request'
from /usr/local/lib/ruby/2.7.0/net/http.rb:1492:in `request'
from scripts/pipeline_test_report_builder.rb:112:in `block in fetch'
from /usr/local/lib/ruby/2.7.0/net/http.rb:933:in `start'
from /usr/local/lib/ruby/2.7.0/net/http.rb:606:in `start'
from scripts/pipeline_test_report_builder.rb:111:in `fetch'
from scripts/pipeline_test_report_builder.rb:66:in `failed_builds_for_pipeline'
from scripts/pipeline_test_report_builder.rb:85:in `build_test_report_json_for_pipeline'
from scripts/pipeline_test_report_builder.rb:30:in `test_report_for_latest_pipeline'
from scripts/pipeline_test_report_builder.rb:39:in `block in execute'
from scripts/pipeline_test_report_builder.rb:38:in `open'
from scripts/pipeline_test_report_builder.rb:38:in `execute'
from scripts/pipeline_test_report_builder.rb:152:in `<main>'
URL: https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab/merge_requests/70902/pipelines
Discovered last failed pipeline (393599271) for MR!70902
URL: https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab/pipelines/393599271/jobs?scope=failed&per_page=100
URL: https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab/merge_requests/70902/pipelines
Discovered last failed pipeline (393599271) for MR!70902
URL: https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab/pipelines/393599271/jobs?scope=failed&per_page=100
The Merge Request pipeline URL is correct, but the pipeline jobs URL is not correct.
Edited by Albert