Commit 860767f6 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch...

Merge branch '191266-remove-the-branch-pipeline-with-build-qa-image-for-merge-requests' into 'master'

Resolve "Remove the branch pipeline with `build-qa-image` for merge requests"

Closes #191266

See merge request gitlab-org/gitlab!22357
parents 346f59c6 2ddc0820
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
.notify:
image: ruby:2.6-alpine
stage: notification
......@@ -11,13 +15,13 @@
variables:
COMMIT_NOTES_URL: "https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}/commit/${CI_COMMIT_SHA}#notes-list"
schedule:package-and-qa:notify-failure:
extends:
- .only:variables_refs-canonical-dot-com-schedules
- .notify
package-and-qa:notify-failure:
extends: .notify
rules:
- <<: *if-canonical-gitlab-schedule
when: manual # TODO: remove notify job if not necessary
script:
- 'export NOTIFICATION_MESSAGE=":skull_and_crossbones: Scheduled QA against master failed! :skull_and_crossbones: See ${CI_PIPELINE_URL}. For downstream pipelines, see ${COMMIT_NOTES_URL}"'
- 'notify_on_job_failure schedule:package-and-qa qa-master "${NOTIFICATION_MESSAGE}" ci_failing'
needs: ["schedule:package-and-qa"]
- 'notify_on_job_failure package-and-qa qa-master "${NOTIFICATION_MESSAGE}" ci_failing'
needs: ["package-and-qa"]
allow_failure: true
when: manual # TODO: remove notify job if not necessary
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request
.if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
# Make sure to update all the similar patterns in other CI config files if you modify these patterns
......@@ -68,19 +72,13 @@ qa:selectors-foss:
package-and-qa:
extends: .package-and-qa-base
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *qa-patterns
when: on_success
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-patterns
when: manual
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
allow_failure: true
schedule:package-and-qa:
extends:
- .package-and-qa-base
- .default-only
- .only:variables_refs-canonical-dot-com-schedules
- <<: *if-canonical-gitlab-schedule
when: on_success
needs: ["build-qa-image", "gitlab:assets:compile pull-cache"]
allow_failure: true
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab: &if-canonical-gitlab
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/'
.if-canonical-gitlab-schedule: &if-canonical-gitlab-schedule
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_PIPELINE_SOURCE == "schedule"'
# Make sure to update all the similar conditions in other CI config files if you modify these conditions
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request
.if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
# Make sure to update all the similar patterns in other CI config files if you modify these patterns
......@@ -44,9 +44,11 @@ build-qa-image:
extends: .review-docker
stage: prepare
rules:
- <<: *if-canonical-gitlab
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: on_success
- <<: *if-canonical-gitlab-schedule
when: on_success
script:
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
- export QA_MASTER_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:master"
......@@ -157,7 +159,7 @@ schedule:review-build-cng:
review-deploy:
extends: .review-deploy-base
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: on_success
......@@ -184,7 +186,7 @@ review-stop-failed-deployment:
extends: .base-review-stop
stage: prepare
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: on_success
script:
......@@ -194,7 +196,7 @@ review-stop:
extends: .base-review-stop
stage: review
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: manual
allow_failure: true
......@@ -235,7 +237,7 @@ review-stop:
review-qa-smoke:
extends: .review-qa-base
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: on_success
script:
......@@ -244,7 +246,7 @@ review-qa-smoke:
review-qa-all:
extends: .review-qa-base
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: manual
parallel: 5
......@@ -276,7 +278,7 @@ review-qa-all:
review-performance:
extends: .review-performance-base
rules:
- <<: *if-canonical-gitlab-and-merge-request
- <<: *if-canonical-gitlab-merge-request
changes: *code-qa-patterns
when: on_success
needs: ["review-deploy"]
......
......@@ -156,7 +156,7 @@ This is similar to the `.only:variables-canonical-dot-com` + `.except:refs-maste
CI definitions:
```yaml
.if-canonical-gitlab-and-merge-request: &if-canonical-gitlab-and-merge-request
.if-canonical-gitlab-merge-request: &if-canonical-gitlab-merge-request
if: '$CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE =~ /^gitlab-org($|\/)/ && $CI_MERGE_REQUEST_IID'
```
......@@ -210,9 +210,7 @@ graph RL;
M[coverage];
N[pages];
O[static-analysis];
P["schedule:package-and-qa<br/>(master schedule only)"];
Q[package-and-qa];
R[package-and-qa-manual];
S["RSpec<br/>(e.g. rspec unit pg9)"]
T[retrieve-tests-metadata];
......@@ -259,10 +257,6 @@ subgraph "`review` stage"
subgraph "`qa` stage"
Q --> |needs| C;
Q --> |needs| F;
R --> |needs| C;
R --> |needs| F;
P --> |needs| C;
P --> |needs| F;
review-qa-smoke -.-> |needs and depends on| G;
review-qa-all -.-> |needs and depends on| G;
review-performance -.-> |needs and depends on| G;
......@@ -271,8 +265,7 @@ subgraph "`qa` stage"
end
subgraph "`notification` stage"
NOTIFICATION1["schedule:package-and-qa:notify-success<br>(on_success)"] -.-> |needs| P;
NOTIFICATION2["schedule:package-and-qa:notify-failure<br>(on_failure)"] -.-> |needs| P;
NOTIFICATION2["package-and-qa:notify-failure<br>(manual)"] -.-> |needs| Q;
end
subgraph "`post-test` stage"
......
......@@ -27,11 +27,11 @@ You can find these nightly pipelines at `https://gitlab.com/gitlab-org/quality/s
### Testing code in merge requests
#### Using the `package-and-qa-manual` job
#### Using the `package-and-qa` job
It is possible to run end-to-end tests for a merge request, eventually being run in
a pipeline in the [`gitlab-qa`](https://gitlab.com/gitlab-org/gitlab-qa/) project,
by triggering the `package-and-qa-manual` manual action in the `test` stage (not
by triggering the `package-and-qa` manual action in the `test` stage (not
available for forks).
**This runs end-to-end tests against a custom Omnibus package built from your
......@@ -53,7 +53,7 @@ graph LR
B2[`Trigger-qa` stage<br>`Trigger:qa-test` job] -.->|2. Triggers a gitlab-qa pipeline and wait for it to be done| A3
subgraph "gitlab-foss/gitlab pipeline"
A1[`test` stage<br>`package-and-qa-manual` job]
A1[`test` stage<br>`package-and-qa` job]
end
subgraph "omnibus-gitlab pipeline"
......@@ -61,7 +61,7 @@ subgraph "omnibus-gitlab pipeline"
end
subgraph "gitlab-qa pipeline"
A3>QA jobs run] -.->|3. Reports back the pipeline result to the `package-and-qa-manual` job<br>and post the result on the original commit tested| A1
A3>QA jobs run] -.->|3. Reports back the pipeline result to the `package-and-qa` job<br>and post the result on the original commit tested| A1
end
```
......
......@@ -40,7 +40,7 @@ the time it would take to build packages and test everything.
That is why when someone changes `t.text_field :login` to
`t.text_field :username` in the _new session_ view we won't know about this
change until our GitLab QA nightly pipeline fails, or until someone triggers
`package-and-qa-manual` action in their merge request.
`package-and-qa` action in their merge request.
Obviously such a change would break all tests. We call this problem a _fragile
tests problem_.
......
......@@ -30,7 +30,7 @@ and corresponding views / partials / selectors in CE / EE.
Whenever `qa:selectors` job fails in your merge request, you are supposed to
fix [page objects](../doc/development/testing_guide/end_to_end/page_objects.md). You should also trigger end-to-end tests
using `package-and-qa-manual` manual action, to test if everything works fine.
using `package-and-qa` manual action, to test if everything works fine.
## How can I use it?
......
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