diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-23 21:08:40 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-23 21:08:40 +0000 |
commit | 3cfe75e375685871b57ad16c3ae7a0921c1a82a5 (patch) | |
tree | a4f0feef3e160e70405828c34844268454751864 | |
parent | 5e555ebcf6ee2ce13e9956ae599fd811a79b4dbd (diff) | |
download | gitlab-ce-3cfe75e375685871b57ad16c3ae7a0921c1a82a5.tar.gz |
Add latest changes from gitlab-org/gitlab@master
22 files changed, 368 insertions, 142 deletions
diff --git a/app/assets/javascripts/issues/show/components/incidents/incident_tabs.vue b/app/assets/javascripts/issues/show/components/incidents/incident_tabs.vue index cf750176fce..6fdce6045f2 100644 --- a/app/assets/javascripts/issues/show/components/incidents/incident_tabs.vue +++ b/app/assets/javascripts/issues/show/components/incidents/incident_tabs.vue @@ -9,6 +9,7 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import DescriptionComponent from '../description.vue'; import getAlert from './graphql/queries/get_alert.graphql'; import HighlightBar from './highlight_bar.vue'; +import TimelineTab from './timeline_events_tab.vue'; export default { components: { @@ -17,8 +18,7 @@ export default { GlTab, GlTabs, HighlightBar, - TimelineTab: () => - import('ee_component/issues/show/components/incidents/timeline_events_tab.vue'), + TimelineTab, IncidentMetricTab: () => import('ee_component/issues/show/components/incidents/incident_metric_tab.vue'), }, @@ -53,7 +53,7 @@ export default { return this.$apollo.queries.alert.loading; }, incidentTabEnabled() { - return this.glFeatures.incidentTimelineEvents && this.glFeatures.incidentTimeline; + return this.glFeatures.incidentTimeline; }, }, mounted() { @@ -112,7 +112,7 @@ export default { > <alert-details-table :alert="alert" :loading="loading" /> </gl-tab> - <timeline-tab v-if="incidentTabEnabled" data-testid="timeline-events-tab" /> + <timeline-tab v-if="incidentTabEnabled" /> </gl-tabs> </div> </template> diff --git a/app/assets/javascripts/issues/show/components/incidents/timeline_events_tab.vue b/app/assets/javascripts/issues/show/components/incidents/timeline_events_tab.vue new file mode 100644 index 00000000000..ec101fd943f --- /dev/null +++ b/app/assets/javascripts/issues/show/components/incidents/timeline_events_tab.vue @@ -0,0 +1,21 @@ +<script> +import { GlTab, GlButton } from '@gitlab/ui'; + +export default { + components: { + GlTab, + GlButton, + }, +}; +</script> + +<template> + <gl-tab :title="s__('Incident|Timeline')"> + <div class="gl-my-4"> + <p>{{ s__('Incident|No timeline items have been added yet.') }}</p> + </div> + <gl-button class="gl-my-3"> + {{ s__('Incident|Add new timeline event') }} + </gl-button> + </gl-tab> +</template> diff --git a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue index 9f76d4cec50..1f2ef3e2e59 100644 --- a/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue +++ b/app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue @@ -237,7 +237,11 @@ export default { <div class="gl-display-flex gl-downstream-pipeline-job-width gl-flex-direction-column gl-line-height-normal" > - <span class="gl-text-truncate" data-testid="downstream-title"> + <span + class="gl-text-truncate" + data-testid="downstream-title" + data-qa-selector="downstream_title_content" + > {{ downstreamTitle }} </span> <div class="gl-text-truncate"> diff --git a/app/views/profiles/two_factor_auths/show.html.haml b/app/views/profiles/two_factor_auths/show.html.haml index ace644a493b..845baae3bb2 100644 --- a/app/views/profiles/two_factor_auths/show.html.haml +++ b/app/views/profiles/two_factor_auths/show.html.haml @@ -24,8 +24,9 @@ - register_2fa_token = _('We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device.') = register_2fa_token.html_safe .row.gl-mb-3 - .col-md-4.gl-pt-2{ style: 'background: #fff' } - = raw @qr_code + .col-md-4.gl-min-w-fit-content + .gl-p-2.gl-mb-3{ style: 'background: #fff' } + = raw @qr_code .col-md-8 .account-well %p.gl-mt-0.gl-mb-0 diff --git a/data/deprecations/15-1-deprecate-maintainer_note.yml b/data/deprecations/15-1-deprecate-maintainer_note.yml new file mode 100644 index 00000000000..9656e62f3db --- /dev/null +++ b/data/deprecations/15-1-deprecate-maintainer_note.yml @@ -0,0 +1,17 @@ +- name: "REST API Runner maintainer_note" # (required) The name of the feature to be deprecated + announcement_milestone: "15.1" # (required) The milestone when this feature was first announced as deprecated. + announcement_date: "2022-06-22" # (required) The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed + removal_date: "2023-05-22" # (required) The date of the milestone release when this feature is planned to be removed. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + breaking_change: true # (required) If this deprecation is a breaking change, set this value to true + reporter: pedropombeiro # (required) GitLab username of the person reporting the deprecation + stage: Verify # (required) String value of the stage that the feature was created in. e.g., Growth + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/363192 # (required) Link to the deprecation issue in GitLab + body: | # (required) Do not modify this line, instead modify the lines below. + The `maintainer_note` argument in the `POST /runners` REST endpoint was deprecated in GitLab 14.8 and replaced with the `maintenance_note` argument. + The `maintainer_note` argument will be removed in GitLab 16.0. +# The following items are not published on the docs page, but may be used in the future. + tiers: # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate] + documentation_url: https://docs.gitlab.com/ee/api/runners.html#register-a-new-runner # (optional) This is a link to the current documentation page + image_url: # (optional) This is a link to a thumbnail image depicting the feature + video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg diff --git a/db/docs/uploads.yml b/db/docs/uploads.yml index 8cc557280e8..53cfd49839a 100644 --- a/db/docs/uploads.yml +++ b/db/docs/uploads.yml @@ -3,7 +3,13 @@ table_name: uploads classes: - Upload feature_categories: -- backup_restore -description: TODO +- code_review +- design_management +- importers +- portfolio_management +- projects +- snippets +- team_planning +description: For tracking blob metadata. Single table inheritance is used to relate this table to many other tables. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/4c622b71fd284058deee483bf0009f8179b792bc milestone: '9.0' diff --git a/doc/.vale/gitlab/OutdatedVersions.yml b/doc/.vale/gitlab/OutdatedVersions.yml index 15ae0a5814a..c78c045a1fd 100644 --- a/doc/.vale/gitlab/OutdatedVersions.yml +++ b/doc/.vale/gitlab/OutdatedVersions.yml @@ -21,3 +21,4 @@ tokens: - "GitLab (v)?9." - "GitLab (v)?10." - "GitLab (v)?11." + - "GitLab (v)?12." diff --git a/doc/development/documentation/versions.md b/doc/development/documentation/versions.md index fffd5c056c3..b084bd2fec4 100644 --- a/doc/development/documentation/versions.md +++ b/doc/development/documentation/versions.md @@ -179,8 +179,8 @@ This content is removed from the documentation as part of the Technical Writing ## Which versions are removed GitLab supports the current major version and two previous major versions. -For example, if 14.0 is the current major version, all major and minor releases of -GitLab 14.0, 13.0 and 12.0 are supported. +For example, if 15.0 is the current major version, all major and minor releases of +GitLab 15.0, 14.0, and 13.0 are supported. [View the list of supported versions](https://about.gitlab.com/support/statement-of-support.html#version-support). diff --git a/doc/development/workhorse/configuration.md b/doc/development/workhorse/configuration.md index d34e567adda..b8f37c845d8 100644 --- a/doc/development/workhorse/configuration.md +++ b/doc/development/workhorse/configuration.md @@ -21,47 +21,49 @@ Add any new Workhorse configuration options into the configuration file. Options: -apiCiLongPollingDuration duration - Long polling duration for job requesting for runners (default 50ns) + Long polling duration for job requesting for runners (default 50ns) -apiLimit uint - Number of API requests allowed at single time + Number of API requests allowed at single time -apiQueueDuration duration - Maximum queueing duration of requests (default 30s) + Maximum queueing duration of requests (default 30s) -apiQueueLimit uint - Number of API requests allowed to be queued + Number of API requests allowed to be queued -authBackend string - Authentication/authorization backend (default "http://localhost:8080") + Authentication/authorization backend (default "http://localhost:8080") -authSocket string - Optional: Unix domain socket to dial authBackend at + Optional: Unix domain socket to dial authBackend at -cableBackend string - Optional: ActionCable backend (default authBackend) + ActionCable backend -cableSocket string - Optional: Unix domain socket to dial cableBackend at (default authSocket) + Optional: Unix domain socket to dial cableBackend at -config string - TOML file to load config from + TOML file to load config from -developmentMode - Allow the assets to be served from Rails app + Allow the assets to be served from Rails app -documentRoot string - Path to static files content (default "public") + Path to static files content (default "public") -listenAddr string - Listen address for HTTP server (default "localhost:8181") + Listen address for HTTP server (default "localhost:8181") -listenNetwork string - Listen 'network' (tcp, tcp4, tcp6, unix) (default "tcp") + Listen 'network' (tcp, tcp4, tcp6, unix) (default "tcp") -listenUmask int - Umask for Unix socket + Umask for Unix socket -logFile string - Log file location + Log file location -logFormat string - Log format to use defaults to text (text, json, structured, none) (default "text") + Log format to use defaults to text (text, json, structured, none) (default "text") -pprofListenAddr string - pprof listening address, e.g. 'localhost:6060' + pprof listening address, e.g. 'localhost:6060' -prometheusListenAddr string - Prometheus listening address, e.g. 'localhost:9229' + Prometheus listening address, e.g. 'localhost:9229' + -propagateCorrelationID X-Request-ID + Reuse existing Correlation-ID from the incoming request header X-Request-ID if present -proxyHeadersTimeout duration - How long to wait for response headers when proxying the request (default 5m0s) + How long to wait for response headers when proxying the request (default 5m0s) -secretPath string - File with secret key to authenticate with authBackend (default "./.gitlab_workhorse_secret") + File with secret key to authenticate with authBackend (default "./.gitlab_workhorse_secret") -version - Print version and exit + Print version and exit ``` The 'auth backend' refers to the GitLab Rails application. The name is @@ -226,6 +228,53 @@ configuration with the `GITLAB_TRACING` environment variable, like this: GITLAB_TRACING=opentracing://jaeger ./gitlab-workhorse ``` +### Propagate correlation IDs + +When a user makes an HTTP request, such as creating a new project, the +initial request is routed through Workhorse to another service, which +may in turn, make other requests. To help trace the request as it flows +across services, Workhorse generates a random value called a +[correlation ID](../../administration/troubleshooting/tracing_correlation_id.md). +Workhorse sends this correlation ID via the `X-Request-Id` HTTP header. + +Some GitLab services, such as GitLab Shell, generate their own +correlation IDs. In addition, other services, such as Gitaly, make +internal API calls that pass along a correlation ID from the original +request. In either case, the correlation ID is also passed via the +`X-Request-Id` HTTP header. + +By default, Workhorse ignores this header and always generates a new +correlation ID. This makes debugging harder and prevents distributed +tracing from working properly, since the new correlation ID is +completely unrelated to the original one. + +Workhorse can be configured to propagate an incoming correlation ID via +the `-propagateCorrelationID` command-line flag. It is highly +recommended that this option be used with an IP allow list to ensure +arbitrary values cannot be generated by untrusted clients. + +An IP allow list is specified via the `trusted_cidrs_for_propagation` +opton in the Workhorse configuration file. Specify a list of CIDR blocks +that can be trusted. For example: + +```toml +trusted_cidrs_for_propagation = ["10.0.0.0/8", "127.0.0.1/32"] +``` + +NOTE: +The `-propagateCorrelationID` flag must be used for the `trusted_cidrs_for_propagation` option to work. + +### Trusted proxies + +If Workhorse is behind a reverse proxy such as NGINX, the +`trusted_cidrs_for_x_forwarded_for` option is needed to specify which +CIDR blocks can be used to trust to provide the originating IP address +via the `X-Forwarded-For` HTTP header. For example: + +```toml +trusted_cidrs_for_x_forwarded_for = ["10.0.0.0/8", "127.0.0.1/32"] +``` + ## Continuous profiling Workhorse supports continuous profiling through [LabKit](https://gitlab.com/gitlab-org/labkit/) diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index 8dfaeb73c9f..d38d2a62f7a 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -47,6 +47,27 @@ Most of the deprecations are **planned for removal in 15.0**, and many of them a <div class="announcement-milestone"> +## 15.1 + +<div class="deprecation removal-160 breaking-change"> + +### REST API Runner maintainer_note + +WARNING: +This feature will be changed or removed in 16.0 +as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes). +Before updating GitLab, review the details carefully to determine if you need to make any +changes to your code, settings, or workflow. + +The `maintainer_note` argument in the `POST /runners` REST endpoint was deprecated in GitLab 14.8 and replaced with the `maintenance_note` argument. +The `maintainer_note` argument will be removed in GitLab 16.0. + +**Planned removal milestone: <span class="removal-milestone">16.0</span> (2023-05-22)** +</div> +</div> + +<div class="announcement-milestone"> + ## 15.0 <div class="deprecation removal-160 breaking-change"> diff --git a/package.json b/package.json index 7bd51cf429f..de3cf34926f 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "codesandbox-api": "0.0.23", "compression-webpack-plugin": "^5.0.2", "copy-webpack-plugin": "^6.4.1", - "core-js": "^3.22.5", + "core-js": "^3.22.6", "cron-validator": "^1.1.1", "cronstrue": "^1.122.0", "cropper": "^2.3.0", diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb index 3f1cc2f1257..06d154f5178 100644 --- a/qa/qa/page/project/pipeline/show.rb +++ b/qa/qa/page/project/pipeline/show.rb @@ -24,6 +24,7 @@ module QA view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do element :expand_linked_pipeline_button element :linked_pipeline_container + element :downstream_title_content end view 'app/assets/javascripts/reports/components/report_section.vue' do @@ -73,6 +74,18 @@ module QA end end + def linked_pipelines + all_elements(:linked_pipeline_container, minimum: 1) + end + + def find_linked_pipeline_by_title(title) + linked_pipelines.find do |pipeline| + within(pipeline) do + find_element(:downstream_title_content).text.include?(title) + end + end + end + def has_linked_pipeline?(title: nil) # If the pipeline page has loaded linked pipelines should appear, but it can take a little while, # especially on busier environments. @@ -89,21 +102,6 @@ module QA alias_method :has_no_child_pipeline?, :has_no_linked_pipeline? - def click_job(job_name) - # Retry due to transient bug https://gitlab.com/gitlab-org/gitlab/-/issues/347126 - QA::Support::Retrier.retry_on_exception do - click_element(:job_link, Project::Job::Show, text: job_name) - end - end - - def linked_pipelines - all_elements(:linked_pipeline_container, minimum: 1) - end - - def find_linked_pipeline_by_title(title) - linked_pipelines.find { |pipeline| pipeline[:title].include?(title) } - end - def expand_linked_pipeline(title: nil) linked_pipeline = title ? find_linked_pipeline_by_title(title) : linked_pipelines.first @@ -124,6 +122,13 @@ module QA first('.js-pipeline-graph-job-link', wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME).click end + def click_job(job_name) + # Retry due to transient bug https://gitlab.com/gitlab-org/gitlab/-/issues/347126 + QA::Support::Retrier.retry_on_exception do + click_element(:job_link, Project::Job::Show, text: job_name) + end + end + def click_job_action(job_name) wait_for_requests diff --git a/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb b/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb index 2b48945137c..18505e5e948 100644 --- a/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb +++ b/qa/qa/specs/features/api/4_verify/api_variable_inheritance_with_forward_pipeline_variables_spec.rb @@ -14,94 +14,64 @@ module QA before do add_ci_file(downstream1_project, [downstream1_ci_file]) add_ci_file(upstream_project, [upstream_ci_file, upstream_child1_ci_file, upstream_child2_ci_file]) - - start_pipeline_via_api_with_variable - - Support::Waiter.wait_until(max_duration: 180, sleep_interval: 5) do - upstream_pipeline.status == 'success' - end - - Support::Waiter.wait_until(max_duration: 180, sleep_interval: 5) do - downstream1_pipeline.pipeline_variables && child1_pipeline.pipeline_variables - end end it( 'is determined based on forward:pipeline_variables condition', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/360745', - quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361400', type: :investigating } + :transient, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361400', + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/360745' ) do - # Is inheritable when true - expect(child1_pipeline).to have_variable(key: key, value: value), - "Expected to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ - " but got #{child1_pipeline.pipeline_variables}" - - # Is not inheritable when false - expect(child2_pipeline).not_to have_variable(key: key, value: value), - "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ - " but got #{child2_pipeline.pipeline_variables}" - - # Is not inheritable by default - expect(downstream1_pipeline).not_to have_variable(key: key, value: value), - "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ - " but got #{downstream1_pipeline.pipeline_variables}" - end - - def start_pipeline_via_api_with_variable - Resource::Pipeline.fabricate_via_api! do |pipeline| - pipeline.project = upstream_project - pipeline.variables = [{ key: key, value: value, variable_type: 'env_var' }] - end - - Support::Waiter.wait_until { upstream_project.pipelines.size > 1 } - end - - def upstream_pipeline - Resource::Pipeline.fabricate_via_api! do |pipeline| - pipeline.project = upstream_project - pipeline.id = upstream_project.pipelines.first[:id] + # Due to long runtime, using 5 times trials instead of default 10 times + 5.times do |i| + QA::Runtime::Logger.info("API pipeline variable inheritance transient bug test - Trial #{i + 1}") + start_pipeline_via_api_with_variable(i + 1) + wait_for_pipelines + + # Is inheritable when true + expect(child1_pipeline).to have_variable(key: key, value: value), + "Expected to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ + " but got #{child1_pipeline.pipeline_variables}" + + # Is not inheritable when false + expect(child2_pipeline).not_to have_variable(key: key, value: value), + "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ + " but got #{child2_pipeline.pipeline_variables}" + + # Is not inheritable by default + expect(downstream1_pipeline).not_to have_variable(key: key, value: value), + "Did not expect to find `{key: 'TEST_VAR', value: 'This is great!'}`" \ + " but got #{downstream1_pipeline.pipeline_variables}" end end - def child1_pipeline - Resource::Pipeline.fabricate_via_api! do |pipeline| - pipeline.project = upstream_project - pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child1_trigger') + def start_pipeline_via_api_with_variable(expected_size) + # Wait for 1st or previous pipeline to finish + Support::Waiter.wait_until do + upstream_project.pipelines.size == expected_size && upstream_pipeline.status == 'success' end - end - def child2_pipeline Resource::Pipeline.fabricate_via_api! do |pipeline| pipeline.project = upstream_project - pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child2_trigger') + pipeline.variables = [{ key: key, value: value, variable_type: 'env_var' }] end - end - def downstream1_pipeline - Resource::Pipeline.fabricate_via_api! do |pipeline| - pipeline.project = downstream1_project - pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'downstream1_trigger') - end + # Wait for this pipeline to be created + Support::Waiter.wait_until { upstream_project.pipelines.size > expected_size } end def upstream_ci_file { file_path: '.gitlab-ci.yml', content: <<~YAML - stages: - - test - - deploy - child1_trigger: - stage: test trigger: include: .child1-ci.yml forward: pipeline_variables: true child2_trigger: - stage: test trigger: include: .child2-ci.yml forward: @@ -109,7 +79,6 @@ module QA # default behavior downstream1_trigger: - stage: deploy trigger: project: #{downstream1_project.full_path} YAML diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb index bd200e57ff9..07f45595e47 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_inheritable_when_forward_pipeline_variables_true_spec.rb @@ -16,16 +16,13 @@ module QA add_ci_file(upstream_project, [upstream_ci_file, upstream_child1_ci_file]) start_pipeline_with_variable - Page::Project::Pipeline::Show.perform do |show| - Support::Waiter.wait_until { show.passed? } - end + wait_for_pipelines end it( 'is inheritable when forward:pipeline_variables is true', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358197', - quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361338', type: :investigating } + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358197' ) do visit_job_page('child1', 'child1_job') verify_job_log_shows_variable_value @@ -40,19 +37,13 @@ module QA { file_path: '.gitlab-ci.yml', content: <<~YAML - stages: - - test - - deploy - child1_trigger: - stage: test trigger: include: .child1-ci.yml forward: pipeline_variables: true downstream1_trigger: - stage: deploy trigger: project: #{downstream1_project.full_path} forward: diff --git a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb index 2bd0be542fe..efbcc2debf7 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/ci_variable/ui_variable_non_inheritable_when_forward_pipeline_variables_false_spec.rb @@ -17,16 +17,13 @@ module QA add_ci_file(upstream_project, [upstream_ci_file, upstream_child1_ci_file, upstream_child2_ci_file]) start_pipeline_with_variable - Page::Project::Pipeline::Show.perform do |show| - Support::Waiter.wait_until { show.passed? } - end + wait_for_pipelines end it( 'is not inheritable when forward:pipeline_variables is false', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358199', - quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361339', type: :investigating } + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358199' ) do visit_job_page('child1', 'child1_job') verify_job_log_does_not_show_variable_value @@ -40,8 +37,7 @@ module QA it( 'is not inheritable by default', :aggregate_failures, - testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358200', - quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361339', type: :investigating } + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/358200' ) do visit_job_page('child2', 'child2_job') verify_job_log_does_not_show_variable_value @@ -56,12 +52,7 @@ module QA { file_path: '.gitlab-ci.yml', content: <<~YAML - stages: - - test - - deploy - child1_trigger: - stage: test trigger: include: .child1-ci.yml forward: @@ -69,12 +60,10 @@ module QA # default behavior child2_trigger: - stage: test trigger: include: .child2-ci.yml downstream1_trigger: - stage: deploy trigger: project: #{downstream1_project.full_path} forward: @@ -82,7 +71,6 @@ module QA # default behavior downstream2_trigger: - stage: deploy trigger: project: #{downstream2_project.full_path} YAML diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb index d03ebd5aba3..205b4d1168a 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_matrix_spec.rb @@ -31,7 +31,7 @@ module QA project.remove_via_api! end - it 'creates 2 trigger jobs and passes corresponding matrix variables', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348000', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/361346', type: :investigating } do + it 'creates 2 trigger jobs and passes corresponding matrix variables', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348000' do Page::Project::Pipeline::Show.perform do |parent_pipeline| trigger_title1 = 'deploy: [ovh, monitoring]' trigger_title2 = 'deploy: [ovh, app]' diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb index 61a92daf129..124e7743728 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_instance_level_spec.rb @@ -40,7 +40,6 @@ module QA let!(:another_project) do Resource::Project.fabricate_via_api! do |another_project| another_project.name = 'npm-instance-level-install' - another_project.template_name = 'express' another_project.group = project.group end end diff --git a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb index fbe517f51f8..155a6db5975 100644 --- a/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb +++ b/qa/qa/specs/features/shared_contexts/variable_inheritance_shared_context.rb @@ -64,6 +64,12 @@ module QA end end + def wait_for_pipelines + Support::Waiter.wait_until(max_duration: 300, sleep_interval: 10) do + upstream_pipeline.status == 'success' && downstream1_pipeline.status == 'success' + end + end + def add_ci_file(project, files) Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project @@ -93,6 +99,41 @@ module QA end end + def upstream_pipeline + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = upstream_project + pipeline.id = upstream_project.pipelines.first[:id] + end + end + + def child1_pipeline + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = upstream_project + pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child1_trigger') + end + end + + def child2_pipeline + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = upstream_project + pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'child2_trigger') + end + end + + def downstream1_pipeline + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = downstream1_project + pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'downstream1_trigger') + end + end + + def downstream2_pipeline + Resource::Pipeline.fabricate_via_api! do |pipeline| + pipeline.project = downstream2_project + pipeline.id = upstream_pipeline.downstream_pipeline_id(bridge_name: 'downstream2_trigger') + end + end + def upstream_child1_ci_file { file_path: '.child1-ci.yml', diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb index 9e9a85203ee..d6ec7f1c539 100644 --- a/spec/features/issues/incident_issue_spec.rb +++ b/spec/features/issues/incident_issue_spec.rb @@ -26,6 +26,7 @@ RSpec.describe 'Incident Detail', :js do context 'when user displays the incident' do before do + stub_feature_flags(incident_timeline: project) project.add_developer(user) sign_in(user) @@ -100,5 +101,54 @@ RSpec.describe 'Incident Detail', :js do expect(edit_button.count).to eq(0) end end + + context 'when on timeline events tab from incident route' do + before do + visit project_issues_incident_path(project, incident) + wait_for_requests + click_link 'Timeline' + end + + it 'does not show the linked issues and notes/comment components' do + page.within('.issuable-details') do + hidden_items = find_all('.js-issue-widgets') + + # Linked Issues/MRs and comment box are hidden on page + expect(hidden_items.count).to eq(0) + end + end + end + + context 'when on timeline events tab from issue route' do + before do + visit project_issue_path(project, incident) + wait_for_requests + click_link 'Timeline' + end + + it 'does not show the linked issues and notes/comment commponents' do + page.within('.issuable-details') do + hidden_items = find_all('.js-issue-widgets') + + # Linked Issues/MRs and comment box are hidden on page + expect(hidden_items.count).to eq(0) + end + end + end + + context 'when incident_timeline feature flag is disabled' do + before do + stub_feature_flags(incident_timeline: false) + + visit project_issue_path(project, incident) + wait_for_requests + end + + it 'does not show Timeline tab' do + tabs = find('[data-testid="incident-tabs"]') + + expect(tabs).not_to have_content('Timeline') + end + end end end diff --git a/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js b/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js index 35acca60de7..dd51594ea4d 100644 --- a/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js +++ b/spec/frontend/issues/show/components/incidents/incident_tabs_spec.js @@ -5,6 +5,7 @@ import { trackIncidentDetailsViewsOptions } from '~/incidents/constants'; import DescriptionComponent from '~/issues/show/components/description.vue'; import HighlightBar from '~/issues/show/components/incidents/highlight_bar.vue'; import IncidentTabs from '~/issues/show/components/incidents/incident_tabs.vue'; +import TimelineTab from '~/issues/show/components/incidents/timeline_events_tab.vue'; import INVALID_URL from '~/lib/utils/invalid_url'; import Tracking from '~/tracking'; import AlertDetailsTable from '~/vue_shared/components/alert_details_table.vue'; @@ -36,7 +37,7 @@ describe('Incident Tabs component', () => { iid: '', projectId: '', uploadMetricsFeatureAvailable: true, - glFeatures: { incidentTimeline: true, incidentTimelineEvents: true }, + glFeatures: { incidentTimeline: true }, }, data() { return { alert: mockAlert, ...data }; @@ -62,6 +63,7 @@ describe('Incident Tabs component', () => { const findAlertDetailsComponent = () => wrapper.find(AlertDetailsTable); const findDescriptionComponent = () => wrapper.find(DescriptionComponent); const findHighlightBarComponent = () => wrapper.find(HighlightBar); + const findTimelineTab = () => wrapper.findComponent(TimelineTab); describe('empty state', () => { beforeEach(() => { @@ -122,4 +124,20 @@ describe('Incident Tabs component', () => { expect(Tracking.event).toHaveBeenCalledWith(category, action); }); }); + + describe('incident timeline tab', () => { + beforeEach(() => { + mountComponent(); + }); + + it('renders the timeline tab when feature flag is enabled', () => { + expect(findTimelineTab().exists()).toBe(true); + }); + + it('does not render timeline tab when feature flag is disabled', () => { + mountComponent({}, { provide: { glFeatures: { incidentTimeline: false } } }); + + expect(findTimelineTab().exists()).toBe(false); + }); + }); }); diff --git a/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js b/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js new file mode 100644 index 00000000000..d3d07bf4a05 --- /dev/null +++ b/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js @@ -0,0 +1,45 @@ +import { shallowMount } from '@vue/test-utils'; +import { GlButton } from '@gitlab/ui'; +import TimelineEventsTab from '~/issues/show/components/incidents/timeline_events_tab.vue'; + +describe('TimlineEventsTab', () => { + let wrapper; + + const mountComponent = () => { + wrapper = shallowMount(TimelineEventsTab); + }; + + beforeEach(() => { + mountComponent(); + }); + + afterEach(() => { + if (wrapper) { + wrapper.destroy(); + } + }); + + const findTimelineEventTab = () => wrapper.findComponent(TimelineEventsTab); + const findNoEventsLine = () => wrapper.find('p'); + const findAddEventButton = () => wrapper.findComponent(GlButton); + + describe('empty state', () => { + beforeEach(() => { + mountComponent(); + }); + + it('renders the title', () => { + expect(findTimelineEventTab().attributes('title')).toBe('Timeline'); + }); + + it('renders the text', () => { + expect(findNoEventsLine().exists()).toBe(true); + expect(findNoEventsLine().text()).toBe('No timeline items have been added yet.'); + }); + + it('renders the button', () => { + expect(findAddEventButton().exists()).toBe(true); + expect(findAddEventButton().text()).toBe('Add new timeline event'); + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index fb589fa1ed0..0cbcf5f51e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3876,10 +3876,10 @@ core-js-pure@^3.0.0: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.5.tgz#c79e75f5e38dbc85a662d91eea52b8256d53b813" integrity sha512-lacdXOimsiD0QyNf9BC/mxivNJ/ybBGJXQFKzRekp1WTHoVUWsUHEn+2T8GJAzzIhyOuXA+gOxCVN3l+5PLPUA== -core-js@^3.22.5: - version "3.22.5" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.5.tgz#a5f5a58e663d5c0ebb4e680cd7be37536fb2a9cf" - integrity sha512-VP/xYuvJ0MJWRAobcmQ8F2H6Bsn+s7zqAAjFaHGBMc5AQm7zaelhD1LGduFn2EehEcQcU+br6t+fwbpQ5d1ZWA== +core-js@^3.22.6: + version "3.22.6" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.6.tgz#294dd824b4cae2c24725a36baa4a791ed00bb0de" + integrity sha512-2IGcGH00z9I4twgNWU4uGCNEsBFG1s2JudVQrgSCoVhOfwoTwQjxC8aMo9exrpTMOxvobggEpaHnGMmQY4cfBQ== core-js@~2.3.0: version "2.3.0" |