diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 03:07:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 03:07:36 +0300 |
commit | 81377eafe174ecc408597fbb3578ea127952190e (patch) | |
tree | 4eb5bc0ca980159057539f46edac9d3b2af547bc | |
parent | 13aa07d3396762695fe47b0898dd346854b3993c (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | .gitlab/issue_templates/Doc_cleanup.md | 43 | ||||
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue | 30 | ||||
-rw-r--r-- | app/services/ci/create_downstream_pipeline_service.rb | 4 | ||||
-rw-r--r-- | app/views/pwa/manifest.json.erb | 6 | ||||
-rw-r--r-- | config/feature_flags/development/ci_run_bridge_for_pipeline_duration_calculation.yml | 8 | ||||
-rw-r--r-- | doc/administration/snippets/index.md | 4 | ||||
-rw-r--r-- | doc/user/snippets.md | 4 | ||||
-rw-r--r-- | qa/Gemfile.lock | 2 | ||||
-rw-r--r-- | qa/qa/support/formatters/allure_metadata_formatter.rb | 11 | ||||
-rw-r--r-- | qa/qa/tools/reliable_report.rb | 2 | ||||
-rw-r--r-- | qa/spec/tools/reliable_report_spec.rb | 12 | ||||
-rwxr-xr-x | scripts/create-pipeline-failure-incident.rb | 2 | ||||
-rw-r--r-- | spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js | 27 | ||||
-rw-r--r-- | spec/requests/pwa_controller_spec.rb | 17 | ||||
-rw-r--r-- | spec/services/ci/create_downstream_pipeline_service_spec.rb | 31 |
15 files changed, 82 insertions, 121 deletions
diff --git a/.gitlab/issue_templates/Doc_cleanup.md b/.gitlab/issue_templates/Doc_cleanup.md index eac70ab9801..3ea692ed1ac 100644 --- a/.gitlab/issue_templates/Doc_cleanup.md +++ b/.gitlab/issue_templates/Doc_cleanup.md @@ -1,3 +1,5 @@ +/labels ~"documentation" ~"docs-only" ~"documentation" ~"docs::improvement" ~"type::maintenance" ~"maintenance::refactor" ~"Seeking community contributions" ~"quick win" ~"Technical Writing" + <!-- * Use this template for documentation issues identified * by [Vale](https://docs.gitlab.com/ee/development/documentation/testing.html#vale) @@ -12,14 +14,15 @@ Do you want to work on this issue? -- **If the issue is assigned to someone already**, choose another issue. +- **If the issue is unassigned**, in a comment, type `@docs-hackathon I would like to work on this issue` and a writer will assign it to you. -- **If the issue is unassigned**, in a comment, type `@gl-docsteam I would like to work on this issue` and a writer will assign it to you. +- **If the issue is assigned to someone already**, choose another issue. Do not open a merge request for this issue if you are not assigned. ## To resolve the issue [Follow these instructions to create a merge request](https://docs.gitlab.com/ee/development/documentation/workflow.html#how-to-update-the-docs). +- Don't submit your merge request until after the Hackathon has started. - Try to address the issue in a single merge request. - Try to stick to the scope of the issue. If you see other improvements that can be made in the file, open a separate merge request. - When you create the merge request, select the **Documentation** merge request description template. @@ -28,42 +31,8 @@ Do you want to work on this issue? Use three to five words for your commit message, start with message with a capital letter, and do **not** end it in a period. Other commit messages can cause the pipeline to fail. -Thank you again for contributing to the GitLab documentation! - -### A few additional notes - -- If you were not assigned the issue, do not create a merge request. It will not be accepted. -- If this issue is for a Hackathon, merge requests created before the Hackathon has started - do not count towards the Hackathon. +Thank you again for contributing to the GitLab documentation! :tada: ## Documentation issue -<!-- -* Describe the issue. If the item is from an automated test, -* include a copy/paste from the the test results. -* [This issue](https://gitlab.com/gitlab-org/gitlab/-/issues/339543) is an example of text to include with a Vale issue. -* -* Limit the work to a reasonable amount. For example, you might have -* several moderate changes on one page, a few intermediate changes across five pages, or several very small -* changes for up to 10 pages. Break larger items into smaller issues to better distribute -* the opportunities for contributors. -* -* If you expect the work to take more than one MR to resolve, explain approximately -* how many MRs you expect to receive for the issue. ---> - -## Additional information - -<!-- -* Any concepts, procedures, reference info we can add to make it easier to successfully use GitLab. -* Include use cases, benefits, and/or goals for this work. -* If adding content: What audience is it intended for? (What roles and scenarios?) - For ideas, see personas at https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/ or the persona labels at - https://gitlab.com/groups/gitlab-org/-/labels?subscribed=&search=persona%3A ---> - -### Other links/references - -<!-- For example, related GitLab issues/MRs --> -/label ~documentation diff --git a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue index 65855d58d67..5cf0c4154bb 100644 --- a/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue +++ b/app/assets/javascripts/work_items/components/work_item_links/work_item_links_form.vue @@ -130,6 +130,16 @@ export default { }, }; } + + if (this.associateIteration) { + workItemInput = { + ...workItemInput, + iterationWidget: { + iterationId: this.parentIterationId, + }, + }; + } + return workItemInput; }, workItemsMvcEnabled() { @@ -228,13 +238,6 @@ export default { } else { this.unsetError(); this.$emit('addWorkItemChild', data.workItemCreate.workItem); - /** - * call update mutation only when there is an iteration associated with the issue - */ - // TODO: setting the iteration should be moved to the creation mutation once the backend is done - if (this.associateIteration) { - this.addIterationToWorkItem(data.workItemCreate.workItem.id); - } } }) .catch(() => { @@ -245,19 +248,6 @@ export default { this.childToCreateTitle = null; }); }, - async addIterationToWorkItem(workItemId) { - await this.$apollo.mutate({ - mutation: updateWorkItemMutation, - variables: { - input: { - id: workItemId, - iterationWidget: { - iterationId: this.parentIterationId, - }, - }, - }, - }); - }, setSearchKey(value) { this.search = value; }, diff --git a/app/services/ci/create_downstream_pipeline_service.rb b/app/services/ci/create_downstream_pipeline_service.rb index be717554a09..3d0a7fb99ea 100644 --- a/app/services/ci/create_downstream_pipeline_service.rb +++ b/app/services/ci/create_downstream_pipeline_service.rb @@ -29,9 +29,7 @@ module Ci return ServiceResponse.error(message: 'Pre-conditions not met') unless ensure_preconditions!(target_ref) - if Feature.enabled?(:ci_run_bridge_for_pipeline_duration_calculation, project) && !@bridge.run - return ServiceResponse.error(message: 'Can not run the bridge') - end + return ServiceResponse.error(message: 'Can not run the bridge') unless @bridge.run service = ::Ci::CreatePipelineService.new( pipeline_params.fetch(:project), diff --git a/app/views/pwa/manifest.json.erb b/app/views/pwa/manifest.json.erb index 557a39ee157..c5403caeafa 100644 --- a/app/views/pwa/manifest.json.erb +++ b/app/views/pwa/manifest.json.erb @@ -1,7 +1,7 @@ { - "name": "GitLab", - "short_name": "GitLab", - "description": "<%= _("The complete DevOps platform. One application with endless possibilities. Organizations rely on GitLab’s source code management, CI/CD, security, and more to deliver software rapidly.") %>", + "name": "<%= Appearance.current&.title.presence || _('GitLab') %>", + "short_name": "<%= Appearance.current&.short_title.presence || _('GitLab') %>", + "description": "<%= Appearance.current&.description.presence || _("The complete DevOps platform. One application with endless possibilities. Organizations rely on GitLab’s source code management, CI/CD, security, and more to deliver software rapidly.") %>", "start_url": "<%= explore_projects_path %>", "scope": "<%= root_path %>", "display": "browser", diff --git a/config/feature_flags/development/ci_run_bridge_for_pipeline_duration_calculation.yml b/config/feature_flags/development/ci_run_bridge_for_pipeline_duration_calculation.yml deleted file mode 100644 index 05ab9e02114..00000000000 --- a/config/feature_flags/development/ci_run_bridge_for_pipeline_duration_calculation.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: ci_run_bridge_for_pipeline_duration_calculation -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/99473 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/356759 -milestone: '15.7' -type: development -group: group::pipeline execution -default_enabled: false diff --git a/doc/administration/snippets/index.md b/doc/administration/snippets/index.md index 7bf828afedd..4bd03aeb8c8 100644 --- a/doc/administration/snippets/index.md +++ b/doc/administration/snippets/index.md @@ -72,3 +72,7 @@ You can also use the API to [retrieve the current value](../../api/settings.md#g ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings" ``` + +## Related topics + +- [User snippets](../../user/snippets.md) diff --git a/doc/user/snippets.md b/doc/user/snippets.md index 6a8184e9ca1..ee84f8a4169 100644 --- a/doc/user/snippets.md +++ b/doc/user/snippets.md @@ -267,3 +267,7 @@ creating a new snippet, use this workaround: 1. Enter any string into the text area for the second file. 1. Scroll back to the first filename, and select **Delete file**. 1. Create the rest of your file, and select **Create snippet** when done. + +## Related topics + +- [Configure snippet settings](../administration/snippets/index.md) on a self-managed GitLab instance diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 869a207a7bb..243389e6e4a 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -155,7 +155,7 @@ GEM httpclient (2.8.3) i18n (1.12.0) concurrent-ruby (~> 1.0) - influxdb-client (2.8.0) + influxdb-client (2.9.0) jwt (2.5.0) knapsack (4.0.0) rake diff --git a/qa/qa/support/formatters/allure_metadata_formatter.rb b/qa/qa/support/formatters/allure_metadata_formatter.rb index 02719536b17..c8ddbeb4536 100644 --- a/qa/qa/support/formatters/allure_metadata_formatter.rb +++ b/qa/qa/support/formatters/allure_metadata_formatter.rb @@ -116,8 +116,7 @@ module QA # @return [Array] def flaky_specs @flaky_specs ||= influx_data.lazy.each_with_object({}) do |data, result| - # Do not consider failures in same merge request - records = data.records.reject { |r| r.values["_value"] == merge_request_iid } + records = data.records runs = records.count failed = records.count { |r| r.values["status"] == "failed" } @@ -136,14 +135,14 @@ module QA def influx_data return [] unless run_type - query_api.query(query: <<~QUERY).values - from(bucket: "#{Support::InfluxdbTools::INFLUX_TEST_METRICS_BUCKET}") - |> range(start: -14d) + query_api.query(query: <<~QUERY) + from(bucket: "#{Support::InfluxdbTools::INFLUX_MAIN_TEST_METRICS_BUCKET}") + |> range(start: -30d) |> filter(fn: (r) => r._measurement == "test-stats") |> filter(fn: (r) => r.run_type == "#{run_type}" and r.status != "pending" and r.quarantined == "false" and - r._field == "merge_request_iid" + r._field == "id" ) |> group(columns: ["testcase"]) QUERY diff --git a/qa/qa/tools/reliable_report.rb b/qa/qa/tools/reliable_report.rb index 08e87d994f8..fd39b637f83 100644 --- a/qa/qa/tools/reliable_report.rb +++ b/qa/qa/tools/reliable_report.rb @@ -326,7 +326,7 @@ module QA def test_runs(reliable:) puts("Fetching data on #{reliable ? 'reliable ' : ''}test execution for past #{range} days\n".colorize(:green)) - all_runs = query_api.query(query: query(reliable)).values + all_runs = query_api.query(query: query(reliable)) all_runs.each_with_object(Hash.new { |hsh, key| hsh[key] = {} }) do |table, result| records = table.records.sort_by { |record| record.values["_time"] } # skip specs that executed less time than defined by range or stopped executing before report date diff --git a/qa/spec/tools/reliable_report_spec.rb b/qa/spec/tools/reliable_report_spec.rb index c1ac5899279..9786d247d5e 100644 --- a/qa/spec/tools/reliable_report_spec.rb +++ b/qa/spec/tools/reliable_report_spec.rb @@ -22,8 +22,8 @@ describe QA::Tools::ReliableReport do "stage" => "manage", "_time" => time } - { - 0 => instance_double( + [ + instance_double( "InfluxDB2::FluxTable", records: [ instance_double("InfluxDB2::FluxRecord", values: values), @@ -31,7 +31,7 @@ describe QA::Tools::ReliableReport do instance_double("InfluxDB2::FluxRecord", values: values.merge({ "_time" => Time.now.to_s })) ] ) - } + ] end let(:reliable_runs) do @@ -42,8 +42,8 @@ describe QA::Tools::ReliableReport do "stage" => "create", "_time" => time } - { - 0 => instance_double( + [ + instance_double( "InfluxDB2::FluxTable", records: [ instance_double("InfluxDB2::FluxRecord", values: { **values, "status" => "passed" }), @@ -51,7 +51,7 @@ describe QA::Tools::ReliableReport do instance_double("InfluxDB2::FluxRecord", values: values.merge({ "_time" => Time.now.to_s })) ] ) - } + ] end def flux_query(reliable:) diff --git a/scripts/create-pipeline-failure-incident.rb b/scripts/create-pipeline-failure-incident.rb index 92d8444c7cd..1035a680291 100755 --- a/scripts/create-pipeline-failure-incident.rb +++ b/scripts/create-pipeline-failure-incident.rb @@ -14,7 +14,7 @@ class CreatePipelineFailureIncident project: nil, incident_json_file: 'incident.json' }.freeze - DEFAULT_LABELS = ['Engineering Productivity', 'master-broken:undetermined'].freeze + DEFAULT_LABELS = ['Engineering Productivity', 'master-broken::undetermined'].freeze def initialize(options) @project = options.delete(:project) diff --git a/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js b/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js index 6a316158fc5..bbe460a55ba 100644 --- a/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js +++ b/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js @@ -176,16 +176,22 @@ describe('WorkItemLinksForm', () => { preventDefault: jest.fn(), }); await waitForPromises(); - expect(updateMutationResolver).toHaveBeenCalledWith({ + expect(createMutationResolver).toHaveBeenCalledWith({ input: { - id: 'gid://gitlab/WorkItem/1', + title: 'Create task test', + projectPath: 'project/path', + workItemTypeId: 'gid://gitlab/WorkItems::Type/3', + hierarchyWidget: { + parentId: 'gid://gitlab/WorkItem/1', + }, + confidential: false, iterationWidget: { iterationId: mockParentIteration.id, }, }, }); }); - it('does not update when parent has no iteration associated', async () => { + it('does not send the iteration widget to mutation when parent has no iteration associated', async () => { await createComponent({ hasIterationsFeature: true, }); @@ -195,7 +201,20 @@ describe('WorkItemLinksForm', () => { preventDefault: jest.fn(), }); await waitForPromises(); - expect(updateMutationResolver).not.toHaveBeenCalled(); + expect(createMutationResolver).not.toHaveBeenCalledWith({ + input: { + title: 'Create task test', + projectPath: 'project/path', + workItemTypeId: 'gid://gitlab/WorkItems::Type/3', + hierarchyWidget: { + parentId: 'gid://gitlab/WorkItem/1', + }, + confidential: false, + iterationWidget: { + iterationId: mockParentIteration.id, + }, + }, + }); }); }); }); diff --git a/spec/requests/pwa_controller_spec.rb b/spec/requests/pwa_controller_spec.rb index 68adcb3179f..3971790c094 100644 --- a/spec/requests/pwa_controller_spec.rb +++ b/spec/requests/pwa_controller_spec.rb @@ -10,6 +10,23 @@ RSpec.describe PwaController, feature_category: :navigation do expect(response.body).to include('The complete DevOps platform.') expect(response).to have_gitlab_http_status(:success) end + + context 'with customized appearance' do + let_it_be(:appearance) do + create(:appearance, title: 'Long name', short_title: 'Short name', description: 'This is a test') + end + + it 'uses custom values', :aggregate_failures do + get manifest_path(format: :json) + + expect(Gitlab::Json.parse(response.body)).to include({ + 'description' => 'This is a test', + 'name' => 'Long name', + 'short_name' => 'Short name' + }) + expect(response).to have_gitlab_http_status(:success) + end + end end describe 'GET #offline' do diff --git a/spec/services/ci/create_downstream_pipeline_service_spec.rb b/spec/services/ci/create_downstream_pipeline_service_spec.rb index 20ca47a05d4..bcdb2b4f796 100644 --- a/spec/services/ci/create_downstream_pipeline_service_spec.rb +++ b/spec/services/ci/create_downstream_pipeline_service_spec.rb @@ -158,17 +158,6 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute', feature_category .to change { upstream_pipeline.reload.duration }.from(nil).to(an_instance_of(Integer)) end - context 'when feature flag ci_run_bridge_for_pipeline_duration_calculation is disabled' do - before do - stub_feature_flags(ci_run_bridge_for_pipeline_duration_calculation: false) - end - - it 'does not trigger the upstream pipeline duration calculation', :sidekiq_inline do - expect { subject } - .not_to change { upstream_pipeline.reload.duration }.from(nil) - end - end - context 'when bridge job has already any downstream pipeline' do before do bridge.create_sourced_pipeline!( @@ -678,26 +667,6 @@ RSpec.describe Ci::CreateDownstreamPipelineService, '#execute', feature_category expect(subject).to be_error expect(subject.message).to eq('Can not run the bridge') end - - context 'when feature flag ci_run_bridge_for_pipeline_duration_calculation is disabled' do - before do - stub_feature_flags(ci_run_bridge_for_pipeline_duration_calculation: false) - end - - it 'tracks the exception' do - expect(Gitlab::ErrorTracking) - .to receive(:track_exception) - .with( - instance_of(Ci::Bridge::InvalidTransitionError), - bridge_id: bridge.id, - downstream_pipeline_id: kind_of(Numeric)) - - expect(subject).to be_error - expect(subject.message).to eq( - "Cannot transition status via :drop from :failed (Reason(s): Status cannot transition via \"drop\")" - ) - end - end end context 'when bridge job has YAML variables defined' do |