diff options
16 files changed, 143 insertions, 21 deletions
diff --git a/.gitlab/issue_templates/Technical Evaluation.md b/.gitlab/issue_templates/Technical Evaluation.md new file mode 100644 index 00000000000..f703f727113 --- /dev/null +++ b/.gitlab/issue_templates/Technical Evaluation.md @@ -0,0 +1,23 @@ +<!-- Instructions: Use this template for a proof of concept or when a deeper technical evaluation is required. Please weigh tech evaluation issues and follow the instructions below accordingly. --> + +### Topic to Evaluate + +<!-- Describe the related issue and challenge we need to establish a proof of concept for--> +* [Link to other Issue](link) + +### Tasks to Evaluate + +<!-- Outline the tasks with issues that you need evaluate as a part of the implementation issue --> + +- [ ] Add task +- [ ] Add task +- [ ] Add task + +### Risks and Implementation Considerations + +<!-- Idenitfy any risks found in the research, whether this is performance, impacts to other functionality or other bugs --> + +### Team + +- [ ] Add ~"workflow::planning breakdown" ~feature and the corresponding `~devops::<stage>` and `~group::<group>` labels. +- [ ] Ping the PM and EM. diff --git a/app/assets/javascripts/repository/components/preview/index.vue b/app/assets/javascripts/repository/components/preview/index.vue index 2bc93c3f1c1..99f100eaa60 100644 --- a/app/assets/javascripts/repository/components/preview/index.vue +++ b/app/assets/javascripts/repository/components/preview/index.vue @@ -1,5 +1,8 @@ <script> +import $ from 'jquery'; +import '~/behaviors/markdown/render_gfm'; import { GlLink, GlLoadingIcon } from '@gitlab/ui'; +import { handleLocationHash } from '~/lib/utils/common_utils'; import getReadmeQuery from '../../queries/getReadme.query.graphql'; export default { @@ -30,6 +33,16 @@ export default { loading: 0, }; }, + watch: { + readme(newVal) { + if (newVal) { + this.$nextTick(() => { + handleLocationHash(); + $(this.$refs.readme).renderGFM(); + }); + } + }, + }, }; </script> @@ -45,7 +58,7 @@ export default { </div> <div class="blob-viewer"> <gl-loading-icon v-if="loading > 0" size="md" color="dark" class="my-4 mx-auto" /> - <div v-else-if="readme" v-html="readme.html"></div> + <div v-else-if="readme" ref="readme" v-html="readme.html"></div> </div> </article> </template> diff --git a/app/services/incident_management/create_issue_service.rb b/app/services/incident_management/create_issue_service.rb index 94b6f037924..43077e03e6d 100644 --- a/app/services/incident_management/create_issue_service.rb +++ b/app/services/incident_management/create_issue_service.rb @@ -58,7 +58,7 @@ module IncidentManagement end def issue_description - horizontal_line = "\n---\n\n" + horizontal_line = "\n\n---\n\n" [ alert_summary, diff --git a/changelogs/unreleased/metrics-anomaly-chart-rendering-fails.yml b/changelogs/unreleased/metrics-anomaly-chart-rendering-fails.yml new file mode 100644 index 00000000000..367ad99c77b --- /dev/null +++ b/changelogs/unreleased/metrics-anomaly-chart-rendering-fails.yml @@ -0,0 +1,5 @@ +--- +title: Time series extends axis options correctly +merge_request: 25399 +author: +type: fixed diff --git a/changelogs/unreleased/nfriend-fix-edit-release-page.yml b/changelogs/unreleased/nfriend-fix-edit-release-page.yml new file mode 100644 index 00000000000..5155499d4e0 --- /dev/null +++ b/changelogs/unreleased/nfriend-fix-edit-release-page.yml @@ -0,0 +1,5 @@ +--- +title: Fix "Edit Release" page +merge_request: 25469 +author: +type: fixed diff --git a/changelogs/unreleased/pl-incident-issue-hline.yml b/changelogs/unreleased/pl-incident-issue-hline.yml new file mode 100644 index 00000000000..6b161aadb50 --- /dev/null +++ b/changelogs/unreleased/pl-incident-issue-hline.yml @@ -0,0 +1,5 @@ +--- +title: Fix markdown layout of incident issues +merge_request: 25352 +author: +type: fixed diff --git a/changelogs/unreleased/sh-fix-license-check-migration.yml b/changelogs/unreleased/sh-fix-license-check-migration.yml new file mode 100644 index 00000000000..95e15c2f303 --- /dev/null +++ b/changelogs/unreleased/sh-fix-license-check-migration.yml @@ -0,0 +1,5 @@ +--- +title: Fix upgrade failure in EE displaying license +merge_request: 25788 +author: +type: fixed diff --git a/config/initializers/0_license.rb b/config/initializers/0_license.rb index 5c4546f499f..19c71c34904 100644 --- a/config/initializers/0_license.rb +++ b/config/initializers/0_license.rb @@ -10,7 +10,7 @@ Gitlab.ee do end # Needed to run migration - if Gitlab::Database.cached_table_exists?('licenses') + if ActiveRecord::Base.connected? && ActiveRecord::Base.connection.table_exists?('licenses') message = LicenseHelper.license_message(signed_in: true, is_admin: true, in_html: false) if ::License.block_changes? && message.present? warn "WARNING: #{message}" diff --git a/doc/administration/pages/source.md b/doc/administration/pages/source.md index 8373d1c7b1b..3e5a82030a2 100644 --- a/doc/administration/pages/source.md +++ b/doc/administration/pages/source.md @@ -388,6 +388,11 @@ Each request to view a resource in a private site is authenticated by Pages using that token. For each request it receives, it makes a request to the GitLab API to check that the user is authorized to read that site. +From [GitLab 12.8](https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/3689) onwards, +Access Control parameters for Pages are set in a configuration file, which +by convention is named `gitlab-pages-config`. The configuration file is passed to +pages using the `-config flag` or CONFIG environment variable. + Pages access control is disabled by default. To enable it: 1. Modify your `config/gitlab.yml` file: @@ -402,13 +407,14 @@ Pages access control is disabled by default. To enable it: This should be called `GitLab Pages` and have a `Redirect URL` of `https://projects.example.io/auth`. It does not need to be a "trusted" application, but it does need the `api` scope. -1. Start the Pages daemon with the following additional arguments: +1. Start the Pages daemon by passing a configuration file with the following arguments: ```shell - -auth-client-secret <OAuth code generated by GitLab> \ - -auth-redirect-uri http://projects.example.io/auth \ - -auth-secret <40 random hex characters> \ - -auth-server <URL of the GitLab instance> + auth-client-id=<OAuth Application ID generated by GitLab> + auth-client-secret=<OAuth code generated by GitLab> + auth-redirect-uri='http://projects.example.io/auth' + auth-secret=<40 random hex characters> + auth-server=<URL of the GitLab instance> ``` 1. Users can now configure it in their [projects' settings](../../user/project/pages/introduction.md#gitlab-pages-access-control-core). diff --git a/doc/user/project/integrations/img/prometheus_dashboard_environments_v12_8.png b/doc/user/project/integrations/img/prometheus_dashboard_environments_v12_8.png Binary files differnew file mode 100644 index 00000000000..467deb86881 --- /dev/null +++ b/doc/user/project/integrations/img/prometheus_dashboard_environments_v12_8.png diff --git a/doc/user/project/integrations/img/prometheus_monitoring_dashboard_v12_8.png b/doc/user/project/integrations/img/prometheus_monitoring_dashboard_v12_8.png Binary files differnew file mode 100644 index 00000000000..8899852ed04 --- /dev/null +++ b/doc/user/project/integrations/img/prometheus_monitoring_dashboard_v12_8.png diff --git a/doc/user/project/integrations/prometheus.md b/doc/user/project/integrations/prometheus.md index 210ce4ffe56..b8ba27bb2ca 100644 --- a/doc/user/project/integrations/prometheus.md +++ b/doc/user/project/integrations/prometheus.md @@ -55,6 +55,17 @@ will help you to quickly create a deployment: 1. Navigate to your project's **CI/CD > Pipelines** page, and run a pipeline on any branch. 1. When the pipeline has run successfully, graphs will be available on the **Operations > Metrics** page. +![Monitoring Dashboard](img/prometheus_monitoring_dashboard_v12_8.png) + +#### Using the Metrics Dashboard + +##### Select an environment + +The **Environment** dropdown box above the dashboard displays the list of all [environments](#monitoring-cicd-environments). +It enables you to search as you type through all environments and select the one you're looking for. + +![Monitoring Dashboard Environments](img/prometheus_dashboard_environments_v12_8.png) + #### About managed Prometheus deployments Prometheus is deployed into the `gitlab-managed-apps` namespace, using the [official Helm chart](https://github.com/helm/charts/tree/master/stable/prometheus). Prometheus is only accessible within the cluster, with GitLab communicating through the [Kubernetes API](https://kubernetes.io/docs/concepts/overview/kubernetes-api/). @@ -198,18 +209,23 @@ supported and will not be available in the UI. #### Duplicating a GitLab-defined dashboard -> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/37238) in GitLab 12.7. +> - [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/37238) in GitLab 12.7. +> - From [GitLab 12.8 onwards](https://gitlab.com/gitlab-org/gitlab/issues/39505), custom metrics are also duplicated when you duplicate a dashboard. -You can save a copy of a GitLab defined dashboard that can be customized and adapted to your project. You can decide to save the dashboard new `.yml` file in the project's **default** branch or in a newly created branch with a name of your choosing. +You can save a complete copy of a GitLab defined dashboard along with all custom metrics added to it. +Resulting `.yml` file can be customized and adapted to your project. +You can decide to save the dashboard `.yml` file in the project's **default** branch or in a +new branch. -1. Click on the "Duplicate dashboard" in the dashboard dropdown. +1. Click **Duplicate dashboard** in the dashboard dropdown. NOTE: **Note:** - Only GitLab-defined dashboards can be duplicated. + You can duplicate only GitLab-defined dashboards. -1. Input the file name and other information, such as a new commit message, and click on "Duplicate". +1. Enter the file name and other information, such as the new commit's message, and click **Duplicate**. -If you select your **default** branch, the new dashboard will become immediately available. If you select another branch, this branch should be merged to your **default** branch first. +If you select your **default** branch, the new dashboard becomes immediately available. +If you select another branch, this branch should be merged to your **default** branch first. #### Dashboard YAML properties diff --git a/lib/gitlab/ci/config/entry/job.rb b/lib/gitlab/ci/config/entry/job.rb index ffc8cb887e8..666c6e23eb4 100644 --- a/lib/gitlab/ci/config/entry/job.rb +++ b/lib/gitlab/ci/config/entry/job.rb @@ -165,7 +165,7 @@ module Gitlab helpers :before_script, :script, :stage, :type, :after_script, :cache, :image, :services, :only, :except, :variables, :artifacts, :environment, :coverage, :retry, :rules, - :parallel, :needs, :interruptible, :release + :parallel, :needs, :interruptible, :release, :tags attributes :script, :tags, :allow_failure, :when, :dependencies, :needs, :retry, :parallel, :extends, :start_in, :rules, @@ -242,6 +242,7 @@ module Gitlab services: services_value, stage: stage_value, cache: cache_value, + tags: tags_value, only: only_value, except: except_value, rules: has_rules? ? rules_value : nil, diff --git a/spec/frontend/repository/components/preview/index_spec.js b/spec/frontend/repository/components/preview/index_spec.js index 7587ca4186c..6ae323f5c3f 100644 --- a/spec/frontend/repository/components/preview/index_spec.js +++ b/spec/frontend/repository/components/preview/index_spec.js @@ -1,7 +1,10 @@ import { shallowMount } from '@vue/test-utils'; import { GlLoadingIcon } from '@gitlab/ui'; +import { handleLocationHash } from '~/lib/utils/common_utils'; import Preview from '~/repository/components/preview/index.vue'; +jest.mock('~/lib/utils/common_utils'); + let vm; let $apollo; @@ -38,6 +41,22 @@ describe('Repository file preview component', () => { }); }); + it('handles hash after render', () => { + factory({ + webUrl: 'http://test.com', + name: 'README.md', + }); + + vm.setData({ readme: { html: '<div class="blob">test</div>' } }); + + return vm.vm + .$nextTick() + .then(vm.vm.$nextTick()) + .then(() => { + expect(handleLocationHash).toHaveBeenCalled(); + }); + }); + it('renders loading icon', () => { factory({ webUrl: 'http://test.com', diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index e5c5aaa2265..cfc3d852de0 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -87,6 +87,29 @@ module Gitlab end end + describe 'tags entry with default values' do + it 'applies default values' do + config = YAML.dump({ default: { tags: %w[A B] }, + rspec: { script: "rspec" } }) + + config_processor = Gitlab::Ci::YamlProcessor.new(config) + + expect(config_processor.stage_builds_attributes("test").size).to eq(1) + expect(config_processor.stage_builds_attributes("test").first).to eq({ + stage: "test", + stage_idx: 2, + name: "rspec", + only: { refs: %w[branches tags] }, + options: { script: ["rspec"] }, + scheduling_type: :stage, + tag_list: %w[A B], + allow_failure: false, + when: "on_success", + yaml_variables: [] + }) + end + end + describe 'interruptible entry' do describe 'interruptible job' do let(:config) do diff --git a/spec/services/incident_management/create_issue_service_spec.rb b/spec/services/incident_management/create_issue_service_spec.rb index e720aafb897..4c7fb682193 100644 --- a/spec/services/incident_management/create_issue_service_spec.rb +++ b/spec/services/incident_management/create_issue_service_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe IncidentManagement::CreateIssueService do let(:project) { create(:project, :repository, :private) } - let(:user) { User.alert_bot } + let_it_be(:user) { User.alert_bot } let(:service) { described_class.new(project, alert_payload) } let(:alert_starts_at) { Time.now } let(:alert_title) { 'TITLE' } @@ -29,7 +29,6 @@ describe IncidentManagement::CreateIssueService do context 'when create_issue enabled' do let(:issue) { subject[:issue] } - let(:summary_separator) { "\n---\n\n" } before do setting.update!(create_issue: true) @@ -42,7 +41,7 @@ describe IncidentManagement::CreateIssueService do expect(issue.author).to eq(user) expect(issue.title).to eq(alert_title) expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip) - expect(separator_count(issue.description)).to eq 0 + expect(separator_count(issue.description)).to eq(0) end end @@ -74,7 +73,7 @@ describe IncidentManagement::CreateIssueService do expect(subject).to include(status: :success) expect(issue.description).to include(alert_presenter.issue_summary_markdown) - expect(separator_count(issue.description)).to eq 1 + expect(separator_count(issue.description)).to eq(1) expect(issue.description).to include(template_content) end end @@ -134,7 +133,7 @@ describe IncidentManagement::CreateIssueService do expect(issue.description).to include(alert_presenter.issue_summary_markdown) expect(issue.description).to include(template_content) expect(issue.description).to include(alt_template) - expect(separator_count(issue.description)).to eq 2 + expect(separator_count(issue.description)).to eq(2) end end @@ -171,7 +170,7 @@ describe IncidentManagement::CreateIssueService do expect(issue.title).to include(query_title) expect(issue.title).to include('for 5 minutes') expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip) - expect(separator_count(issue.description)).to eq 0 + expect(separator_count(issue.description)).to eq(0) end end @@ -306,6 +305,8 @@ describe IncidentManagement::CreateIssueService do end def separator_count(text) + summary_separator = "\n\n---\n\n" + text.scan(summary_separator).size end end |