the Browser Performance report widget says 'Failed to load'
The Browser Performance report widget says 'Failed to load' and doesn’t display on the MR page.
I have a fe-review
job in the review.gitlab-ci.yml
file, whose configuration has been extended to store a dynamic URL as an artifact.
fe-review:
# ...
script:
### ...
- echo "Deployed to https://${REVIEW_APP_URL}"
- echo "https://${REVIEW_APP_URL}" > environment_url.txt
artifacts:
paths:
- environment_url.txt
Then in my frontend.gitlab-ci.yml
file, I added configuration according to the documentation
include:
template: Verify/Browser-Performance.gitlab-ci.yml
browser_performance:
needs: ['fe-review']
variables:
URL: environment_url.txt
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
Then I pushed everything to my a.k.a future-target branch, for example: feature/add-performance-reports
, and created MR. Where the browser_performance job was successfully done with artifacts. I could even open those artifacts and check the report's actual HTML files, which is a good sign.
After that, I created a new branch, depending on the existing branch, called feature/experimental-mr
, made some random changes, and pushed. I made MR for that new branch with targeting the existing one and saw that the browser_performance pipeline job went well, but instead of showing the actual widget, I saw this:
What's interesting for both jobs is that if I check the artifacts, the data
folder exists but performance.json
file does not.
If according to the template behind we consider that the ./sitespeed-results/data/performance.json
file should be moved to ./browser-performance.json
it could be visible next to sitespeed-results
in the same folder, but again it isn't there:
What's more interesting for me is that on the MR page, if I check the network tab I see that the actual report that is shown in the HTML files is received here as a JSON file, exactly in the same format as the GitLab plugin should have created, perhaps that's the performance.json
which helps the widget to display the content.
So if the pipeline job is ok, data is here and the target & source branch both meet the conditions required in the documentation, why do I still see Failed to load
instead of an actual content there?