Commit 87742515 authored by Matija Čupić's avatar Matija Čupić

Merge branch 'rename-browser-performance-template-job' into 'master'

Rename Browser Performance template jobs

See merge request gitlab-org/gitlab!62727
parents 024189ac 38677a72
...@@ -3524,12 +3524,13 @@ as artifacts. ...@@ -3524,12 +3524,13 @@ as artifacts.
The collected Metrics report uploads to GitLab as an artifact and displays in merge requests. The collected Metrics report uploads to GitLab as an artifact and displays in merge requests.
##### `artifacts:reports:performance` **(PREMIUM)** ##### `artifacts:reports:browser_performance` **(PREMIUM)**
> - Introduced in GitLab 11.5. > - Introduced in GitLab 11.5.
> - Requires GitLab Runner 11.5 and above. > - Requires GitLab Runner 11.5 and above.
> - [Name changed](https://gitlab.com/gitlab-org/gitlab/-/issues/225914) from `artifacts:reports:performance` in GitLab 14.0.
The `performance` report collects [Browser Performance Testing metrics](../../user/project/merge_requests/browser_performance_testing.md) The `browser_performance` report collects [Browser Performance Testing metrics](../../user/project/merge_requests/browser_performance_testing.md)
as artifacts. as artifacts.
The collected Browser Performance report uploads to GitLab as an artifact and displays in merge requests. The collected Browser Performance report uploads to GitLab as an artifact and displays in merge requests.
......
...@@ -431,7 +431,8 @@ The following table lists variables used to disable jobs. ...@@ -431,7 +431,8 @@ The following table lists variables used to disable jobs.
| `license_scanning` | `LICENSE_MANAGEMENT_DISABLED` | [From GitLab 12.8](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22773) | If the variable is present, the job isn't created. | | `license_scanning` | `LICENSE_MANAGEMENT_DISABLED` | [From GitLab 12.8](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22773) | If the variable is present, the job isn't created. |
| `load_performance` | `LOAD_PERFORMANCE_DISABLED` | From GitLab 13.2 | If the variable is present, the job isn't created. | | `load_performance` | `LOAD_PERFORMANCE_DISABLED` | From GitLab 13.2 | If the variable is present, the job isn't created. |
| `nodejs-scan-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. | | `nodejs-scan-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. |
| `performance` | `PERFORMANCE_DISABLED` | From GitLab 11.0 | Browser performance. If the variable is present, the job isn't created. | | `performance` | `PERFORMANCE_DISABLED` | GitLab 11.0 to GitLab 13.12 | Browser performance. If the variable is present, the job isn't created. Replaced by `browser_peformance`. |
| `browser_performance` | `BROWSER_PERFORMANCE_DISABLED` | From GitLab 14.0 | Browser performance. If the variable is present, the job isn't created. Replaces `performance`. |
| `phpcs-security-audit-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. | | `phpcs-security-audit-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. |
| `pmd-apex-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. | | `pmd-apex-sast` | `SAST_DISABLED` | | If the variable is present, the job isn't created. |
| `retire-js-dependency_scanning` | `DEPENDENCY_SCANNING_DISABLED` | | If the variable is present, the job isn't created. | | `retire-js-dependency_scanning` | `DEPENDENCY_SCANNING_DISABLED` | | If the variable is present, the job isn't created. |
......
...@@ -40,11 +40,11 @@ Consider the following workflow: ...@@ -40,11 +40,11 @@ Consider the following workflow:
## How browser performance testing works ## How browser performance testing works
First, define a job in your `.gitlab-ci.yml` file that generates the First, define a job in your `.gitlab-ci.yml` file that generates the
[Browser Performance report artifact](../../../ci/yaml/README.md#artifactsreportsperformance). [Browser Performance report artifact](../../../ci/yaml/README.md#artifactsreportsbrowser_performance).
GitLab then checks this report, compares key performance metrics for each page GitLab then checks this report, compares key performance metrics for each page
between the source and target branches, and shows the information in the merge request. between the source and target branches, and shows the information in the merge request.
For an example Performance job, see For an example Browser Performance job, see
[Configuring Browser Performance Testing](#configuring-browser-performance-testing). [Configuring Browser Performance Testing](#configuring-browser-performance-testing).
NOTE: NOTE:
...@@ -70,18 +70,17 @@ using Docker-in-Docker. ...@@ -70,18 +70,17 @@ using Docker-in-Docker.
include: include:
template: Verify/Browser-Performance.gitlab-ci.yml template: Verify/Browser-Performance.gitlab-ci.yml
performance: browser_performance:
variables: variables:
URL: https://example.com URL: https://example.com
``` ```
WARNING: WARNING:
In GitLab 14.0 and later, the job [is scheduled to be renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/225914) In GitLab 13.12 and earlier, the job [was named](https://gitlab.com/gitlab-org/gitlab/-/issues/225914) `performance`.
from `performance` to `browser_performance`.
The above example: The above example:
- Creates a `performance` job in your CI/CD pipeline and runs sitespeed.io against the webpage you - Creates a `browser_performance` job in your CI/CD pipeline and runs sitespeed.io against the webpage you
defined in `URL` to gather key metrics. defined in `URL` to gather key metrics.
- Uses a template that doesn't work with Kubernetes clusters. If you are using a Kubernetes cluster, - Uses a template that doesn't work with Kubernetes clusters. If you are using a Kubernetes cluster,
use [`template: Jobs/Browser-Performance-Testing.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Browser-Performance-Testing.gitlab-ci.yml) use [`template: Jobs/Browser-Performance-Testing.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/Browser-Performance-Testing.gitlab-ci.yml)
...@@ -90,7 +89,7 @@ The above example: ...@@ -90,7 +89,7 @@ The above example:
GitLab 12.3 or earlier, you must [add the configuration manually](#gitlab-versions-132-and-earlier). GitLab 12.3 or earlier, you must [add the configuration manually](#gitlab-versions-132-and-earlier).
The template uses the [GitLab plugin for sitespeed.io](https://gitlab.com/gitlab-org/gl-performance), The template uses the [GitLab plugin for sitespeed.io](https://gitlab.com/gitlab-org/gl-performance),
and it saves the full HTML sitespeed.io report as a [Browser Performance report artifact](../../../ci/yaml/README.md#artifactsreportsperformance) and it saves the full HTML sitespeed.io report as a [Browser Performance report artifact](../../../ci/yaml/README.md#artifactsreportsbrowser_performance)
that you can later download and analyze. This implementation always takes the latest that you can later download and analyze. This implementation always takes the latest
Browser Performance artifact available. If [GitLab Pages](../pages/index.md) is enabled, Browser Performance artifact available. If [GitLab Pages](../pages/index.md) is enabled,
you can view the report directly in your browser. you can view the report directly in your browser.
...@@ -108,7 +107,7 @@ makes on the given URL, and change the version: ...@@ -108,7 +107,7 @@ makes on the given URL, and change the version:
include: include:
template: Verify/Browser-Performance.gitlab-ci.yml template: Verify/Browser-Performance.gitlab-ci.yml
performance: browser_performance:
variables: variables:
URL: https://www.sitespeed.io/ URL: https://www.sitespeed.io/
SITESPEED_VERSION: 13.2.0 SITESPEED_VERSION: 13.2.0
...@@ -127,7 +126,7 @@ if the `Total Score` metric degrades by 5 points or more: ...@@ -127,7 +126,7 @@ if the `Total Score` metric degrades by 5 points or more:
include: include:
template: Verify/Browser-Performance.gitlab-ci.yml template: Verify/Browser-Performance.gitlab-ci.yml
performance: browser_performance:
variables: variables:
URL: https://example.com URL: https://example.com
DEGRADATION_THRESHOLD: 5 DEGRADATION_THRESHOLD: 5
...@@ -140,13 +139,13 @@ The `Total Score` metric is based on sitespeed.io's [coach performance score](ht ...@@ -140,13 +139,13 @@ The `Total Score` metric is based on sitespeed.io's [coach performance score](ht
The above CI YAML configuration is great for testing against static environments, and it can The above CI YAML configuration is great for testing against static environments, and it can
be extended for dynamic environments, but a few extra steps are required: be extended for dynamic environments, but a few extra steps are required:
1. The `performance` job should run after the dynamic environment has started. 1. The `browser_performance` job should run after the dynamic environment has started.
1. In the `review` job: 1. In the `review` job:
1. Generate a URL list file with the dynamic URL. 1. Generate a URL list file with the dynamic URL.
1. Save the file as an artifact, for example with `echo $CI_ENVIRONMENT_URL > environment_url.txt` 1. Save the file as an artifact, for example with `echo $CI_ENVIRONMENT_URL > environment_url.txt`
in your job's `script`. in your job's `script`.
1. Pass the list as the URL environment variable (which can be a URL or a file containing URLs) 1. Pass the list as the URL environment variable (which can be a URL or a file containing URLs)
to the `performance` job. to the `browser_performance` job.
1. You can now run the sitespeed.io container against the desired hostname and 1. You can now run the sitespeed.io container against the desired hostname and
paths. paths.
...@@ -176,7 +175,7 @@ review: ...@@ -176,7 +175,7 @@ review:
except: except:
- master - master
performance: browser_performance:
dependencies: dependencies:
- review - review
variables: variables:
......
...@@ -48,13 +48,13 @@ RSpec.describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do ...@@ -48,13 +48,13 @@ RSpec.describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do
shared_examples_for 'browser_performance job on tag or branch' do shared_examples_for 'browser_performance job on tag or branch' do
it 'by default' do it 'by default' do
expect(build_names).to include('performance') expect(build_names).to include('browser_performance')
end end
it 'when PERFORMANCE_DISABLED' do it 'when BROWSER_PERFORMANCE_DISABLED' do
create(:ci_variable, project: project, key: 'PERFORMANCE_DISABLED', value: '1') create(:ci_variable, project: project, key: 'BROWSER_PERFORMANCE_DISABLED', value: '1')
expect(build_names).not_to include('performance') expect(build_names).not_to include('browser_performance')
end end
end end
......
...@@ -43,7 +43,7 @@ RSpec.describe 'Verify/Browser-Performance.gitlab-ci.yml' do ...@@ -43,7 +43,7 @@ RSpec.describe 'Verify/Browser-Performance.gitlab-ci.yml' do
shared_examples_for 'browser_performance job on tag or branch' do shared_examples_for 'browser_performance job on tag or branch' do
it 'by default' do it 'by default' do
expect(build_names).to include('performance') expect(build_names).to include('browser_performance')
end end
end end
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# * test: TEST_DISABLED # * test: TEST_DISABLED
# * code_quality: CODE_QUALITY_DISABLED # * code_quality: CODE_QUALITY_DISABLED
# * license_management: LICENSE_MANAGEMENT_DISABLED # * license_management: LICENSE_MANAGEMENT_DISABLED
# * performance: PERFORMANCE_DISABLED # * browser_performance: PERFORMANCE_DISABLED
# * load_performance: LOAD_PERFORMANCE_DISABLED # * load_performance: LOAD_PERFORMANCE_DISABLED
# * sast: SAST_DISABLED # * sast: SAST_DISABLED
# * secret_detection: SECRET_DETECTION_DISABLED # * secret_detection: SECRET_DETECTION_DISABLED
......
# Read more about the feature here: https://docs.gitlab.com/ee/user/project/merge_requests/browser_performance_testing.html # Read more about the feature here: https://docs.gitlab.com/ee/user/project/merge_requests/browser_performance_testing.html
performance: browser_performance:
stage: performance stage: performance
image: docker:19.03.12 image: docker:19.03.12
allow_failure: true allow_failure: true
...@@ -72,6 +72,6 @@ performance: ...@@ -72,6 +72,6 @@ performance:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$PERFORMANCE_DISABLED' - if: '$BROWSER_PERFORMANCE_DISABLED'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -72,6 +72,6 @@ browser_performance: ...@@ -72,6 +72,6 @@ browser_performance:
rules: rules:
- if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""' - if: '$CI_KUBERNETES_ACTIVE == null || $CI_KUBERNETES_ACTIVE == ""'
when: never when: never
- if: '$PERFORMANCE_DISABLED' - if: '$BROWSER_PERFORMANCE_DISABLED'
when: never when: never
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
...@@ -6,7 +6,7 @@ stages: ...@@ -6,7 +6,7 @@ stages:
- deploy - deploy
- performance - performance
performance: browser_performance:
stage: performance stage: performance
image: docker:git image: docker:git
variables: variables:
......
...@@ -17,7 +17,7 @@ module QA ...@@ -17,7 +17,7 @@ module QA
%w[ %w[
CODE_QUALITY_DISABLED TEST_DISABLED LICENSE_MANAGEMENT_DISABLED CODE_QUALITY_DISABLED TEST_DISABLED LICENSE_MANAGEMENT_DISABLED
SAST_DISABLED DAST_DISABLED DEPENDENCY_SCANNING_DISABLED SAST_DISABLED DAST_DISABLED DEPENDENCY_SCANNING_DISABLED
CONTAINER_SCANNING_DISABLED PERFORMANCE_DISABLED SECRET_DETECTION_DISABLED CONTAINER_SCANNING_DISABLED BROWSER_PERFORMANCE_DISABLED SECRET_DETECTION_DISABLED
].each do |key| ].each do |key|
Resource::CiVariable.fabricate_via_api! do |resource| Resource::CiVariable.fabricate_via_api! do |resource|
resource.project = @project resource.project = @project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment