Commit 4204cf30 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent cd4cb29b
$space-between-cards: 8px;
.convdev-empty svg {
.devops-empty svg {
margin: 64px auto 32px;
max-width: 420px;
}
.convdev-header {
.devops-header {
margin-top: $gl-padding;
margin-bottom: $gl-padding;
padding: 0 4px;
display: flex;
align-items: center;
.convdev-header-title {
.devops-header-title {
font-size: 48px;
line-height: 1;
margin: 0;
}
.convdev-header-subtitle {
.devops-header-subtitle {
font-size: 22px;
line-height: 1;
color: $gl-text-color-secondary;
......@@ -36,13 +36,13 @@ $space-between-cards: 8px;
}
}
.convdev-cards {
.devops-cards {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.convdev-card-wrapper {
.devops-card-wrapper {
display: flex;
flex-direction: column;
align-items: stretch;
......@@ -70,7 +70,7 @@ $space-between-cards: 8px;
}
}
.convdev-card {
.devops-card {
border: solid 1px $border-color;
border-radius: 3px;
border-top-width: 3px;
......@@ -79,7 +79,7 @@ $space-between-cards: 8px;
flex-grow: 1;
}
.convdev-card-low {
.devops-card-low {
border-top-color: $red-400;
.board-card-score-big {
......@@ -87,7 +87,7 @@ $space-between-cards: 8px;
}
}
.convdev-card-average {
.devops-card-average {
border-top-color: $orange-400;
.board-card-score-big {
......@@ -95,7 +95,7 @@ $space-between-cards: 8px;
}
}
.convdev-card-high {
.devops-card-high {
border-top-color: $green-400;
.board-card-score-big {
......@@ -103,7 +103,7 @@ $space-between-cards: 8px;
}
}
.convdev-card-title {
.devops-card-title {
margin: $gl-padding auto auto;
max-width: 100px;
......@@ -170,7 +170,7 @@ $space-between-cards: 8px;
}
}
.convdev-steps {
.devops-steps {
margin-top: $gl-padding;
height: 1px;
min-width: 100%;
......@@ -179,7 +179,7 @@ $space-between-cards: 8px;
background: $border-color;
}
.convdev-step {
.devops-step {
$step-positions: 5% 10% 30% 42% 48% 55% 60% 70% 75% 90%;
@each $pos in $step-positions {
$i: index($step-positions, $pos);
......@@ -212,7 +212,7 @@ $space-between-cards: 8px;
height: auto;
width: auto;
.convdev-step-title {
.devops-step-title {
max-height: 2em;
opacity: 1;
transition: opacity 0.2s;
......@@ -233,7 +233,7 @@ $space-between-cards: 8px;
}
}
.convdev-step-title {
.devops-step-title {
max-height: 0;
opacity: 0;
text-transform: uppercase;
......@@ -242,14 +242,14 @@ $space-between-cards: 8px;
font-size: 12px;
}
.convdev-high-score {
.devops-high-score {
color: $green-400;
}
.convdev-average-score {
.devops-average-score {
color: $orange-400;
}
.convdev-low-score {
.devops-low-score {
color: $red-400;
}
......@@ -349,7 +349,7 @@ table.u2f-registrations {
vertical-align: top;
}
&.convdev {
&.devops {
margin: 0 0 0 30px;
svg {
......@@ -382,7 +382,7 @@ table.u2f-registrations {
height: 75px;
}
&.convdev {
&.devops {
margin: $gl-padding auto 0;
svg {
......
- documentation_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path("integration/google") }
- link_end = '<a/>'.html_safe
= s_('Google authentication is not %{link_start}property configured%{link_end}. Ask your GitLab administrator if you want to use this service.').html_safe % { link_start: documentation_link_start, link_end: link_end }
= s_('Google authentication is not %{link_start}properly configured%{link_end}. Ask your GitLab administrator if you want to use this service.').html_safe % { link_start: documentation_link_start, link_end: link_end }
......@@ -9,5 +9,5 @@
= _('Introducing Your Conversational Development Index')
%p
= _('Your Conversational Development Index gives an overview of how you are using GitLab from a feature perspective. View how you compare with other organizations, discover features you are not using, and learn best practices through blog posts and white papers.')
.svg-container.convdev
.svg-container.devops
= custom_icon('convdev_overview')
.convdev-card-wrapper
.convdev-card{ class: "convdev-card-#{score_level(card.percentage_score)}" }
.convdev-card-title
.devops-card-wrapper
.devops-card{ class: "devops-card-#{score_level(card.percentage_score)}" }
.devops-card-title
%h3
= card.title
.light-text
......
.container.convdev-empty
.container.devops-empty
.col-sm-12.justify-content-center.text-center
= custom_icon('convdev_no_index')
%h4= _('Usage ping is not enabled')
......
.container.convdev-empty
.container.devops-empty
.col-sm-12.justify-content-center.text-center
= custom_icon('convdev_no_data')
%h4= _('Data is still calculating...')
......
......@@ -11,23 +11,23 @@
- elsif @metric.blank?
= render 'no_data'
- else
.convdev
.convdev-header
%h2.convdev-header-title{ class: "convdev-#{score_level(@metric.average_percentage_score)}-score" }
.devops
.devops-header
%h2.devops-header-title{ class: "devops-#{score_level(@metric.average_percentage_score)}-score" }
= number_to_percentage(@metric.average_percentage_score, precision: 1)
.convdev-header-subtitle
.devops-header-subtitle
= _('index')
%br
= _('score')
= link_to icon('question-circle', 'aria-hidden' => 'true'), help_page_path('user/instance_statistics/convdev')
.convdev-cards.board-card-container
.devops-cards.board-card-container
- @metric.cards.each do |card|
= render 'card', card: card
.convdev-steps.d-none.d-lg-block.d-xl-block
.devops-steps.d-none.d-lg-block.d-xl-block
- @metric.idea_to_production_steps.each_with_index do |step, index|
.convdev-step{ class: "convdev-#{score_level(step.percentage_score)}-score" }
.devops-step{ class: "devops-#{score_level(step.percentage_score)}-score" }
= custom_icon("i2p_step_#{index + 1}")
%h4.convdev-step-title
%h4.devops-step-title
= step.title
---
title: |
Add allow failure in pipeline webhook event
merge_request: 20978
author: Gaetan Semet
type: added
---
title: Use cascading deletes for deleting oauth_openid_requests upon deleting an oauth_access_grant
merge_request: 19617
author:
type: fixed
# frozen_string_literal: true
class UpdateOauthOpenIdRequestsForeignKeys < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_foreign_key(:oauth_openid_requests, :oauth_access_grants, column: :access_grant_id, on_delete: :cascade, name: new_foreign_key_name)
remove_foreign_key_if_exists(:oauth_openid_requests, name: existing_foreign_key_name)
end
def down
add_concurrent_foreign_key(:oauth_openid_requests, :oauth_access_grants, column: :access_grant_id, on_delete: false, name: existing_foreign_key_name)
remove_foreign_key_if_exists(:oauth_openid_requests, name: new_foreign_key_name)
end
private
def new_foreign_key_name
concurrent_foreign_key_name(:oauth_openid_requests, :access_grant_id)
end
def existing_foreign_key_name
'fk_oauth_openid_requests_oauth_access_grants_access_grant_id'
end
end
class AddIndexToGrafanaIntegrations < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :grafana_integrations, :enabled, where: 'enabled IS TRUE'
end
def down
remove_concurrent_index :grafana_integrations, :enabled
end
end
......@@ -1888,6 +1888,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do
t.string "encrypted_token_iv", limit: 255, null: false
t.string "grafana_url", limit: 1024, null: false
t.boolean "enabled", default: false, null: false
t.index ["enabled"], name: "index_grafana_integrations_on_enabled", where: "(enabled IS TRUE)"
t.index ["project_id"], name: "index_grafana_integrations_on_project_id"
end
......@@ -4535,7 +4536,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do
add_foreign_key "notes", "projects", name: "fk_99e097b079", on_delete: :cascade
add_foreign_key "notes", "reviews", name: "fk_2e82291620", on_delete: :nullify
add_foreign_key "notification_settings", "users", name: "fk_0c95e91db7", on_delete: :cascade
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_oauth_openid_requests_oauth_access_grants_access_grant_id"
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_77114b3b09", on_delete: :cascade
add_foreign_key "operations_feature_flag_scopes", "operations_feature_flags", column: "feature_flag_id", on_delete: :cascade
add_foreign_key "operations_feature_flags", "projects", on_delete: :cascade
add_foreign_key "operations_feature_flags_clients", "projects", on_delete: :cascade
......
This diff is collapsed.
......@@ -591,7 +591,7 @@ filter_output = search_field_tag search_id, nil, class: "dropdown-input-field",
> `data-qa-*` data attributes and CSS classes starting with `qa-` are used solely for the purpose of QA and testing.
> By defining these, we add **testability** to the application.
>
> When defining a data attribute like: `qa_selector: 'labels_block'`, it should match the element definition: `element :labels_block`. We use a [sanity test](https://gitlab.com/gitlab-org/gitlab-foss/tree/master/qa/qa/page#how-did-we-solve-fragile-tests-problem) to check that defined elements have their respective selectors in the specified views.
> When defining a data attribute like: `qa_selector: 'labels_block'`, it should match the element definition: `element :labels_block`. We use a [sanity test](https://gitlab.com/gitlab-org/gitlab-foss/tree/master/doc/development/testing_guide/end_to_end/page_objects.md#how-did-we-solve-fragile-tests-problem) to check that defined elements have their respective selectors in the specified views.
#### Updates in the `QA::Page::Base` class
......
......@@ -1076,6 +1076,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null,
"when": "manual",
"manual": true,
"allow_failure": false,
"user":{
"name": "Administrator",
"username": "root",
......@@ -1097,6 +1098,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null,
"when": "on_success",
"manual": false,
"allow_failure": false,
"user":{
"name": "Administrator",
"username": "root",
......@@ -1123,6 +1125,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": "2016-08-12 15:26:29 UTC",
"when": "on_success",
"manual": false,
"allow_failure": false,
"user":{
"name": "Administrator",
"username": "root",
......@@ -1149,6 +1152,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": "2016-08-12 15:25:26 UTC",
"when": "on_success",
"manual": false,
"allow_failure": false,
"user":{
"name": "Administrator",
"username": "root",
......@@ -1175,6 +1179,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null,
"when": "on_success",
"manual": false,
"allow_failure": false,
"user":{
"name": "Administrator",
"username": "root",
......
......@@ -61,6 +61,7 @@ module Gitlab
finished_at: build.finished_at,
when: build.when,
manual: build.action?,
allow_failure: build.allow_failure,
user: build.user.try(:hook_attrs),
runner: build.runner && runner_hook_attrs(build.runner),
artifacts_file: {
......
# frozen_string_literal: true
module Gitlab
class GrafanaEmbedUsageData
class << self
def issue_count
# rubocop:disable CodeReuse/ActiveRecord
Issue.joins('JOIN grafana_integrations USING (project_id)')
.where("issues.description LIKE '%' || grafana_integrations.grafana_url || '%'")
.where(grafana_integrations: { enabled: true })
.count
# rubocop:enable CodeReuse/ActiveRecord
end
end
end
end
......@@ -84,6 +84,7 @@ module Gitlab
issues: count(Issue),
issues_with_associated_zoom_link: count(ZoomMeeting.added_to_issue),
issues_using_zoom_quick_actions: count(ZoomMeeting.select(:issue_id).distinct),
issues_with_embedded_grafana_charts_approx: ::Gitlab::GrafanaEmbedUsageData.issue_count,
keys: count(Key),
label_lists: count(List.label),
lfs_objects: count(LfsObject),
......
......@@ -8581,7 +8581,7 @@ msgstr ""
msgid "Google Takeout"
msgstr ""
msgid "Google authentication is not %{link_start}property configured%{link_end}. Ask your GitLab administrator if you want to use this service."
msgid "Google authentication is not %{link_start}properly configured%{link_end}. Ask your GitLab administrator if you want to use this service."
msgstr ""
msgid "Got it"
......
# frozen_string_literal: true
module QA
context 'Manage', :orchestrated, :smtp do
describe 'mail notification' do
context 'Plan', :orchestrated, :smtp do
describe 'Email Notification' do
let(:user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end
......@@ -17,7 +17,7 @@ module QA
Flow::Login.sign_in
end
it 'user receives email for project invitation' do
it 'is received by a user for project invitation' do
Flow::Project.add_member(project: project, username: user.username)
expect(page).to have_content(/@#{user.username}(\n| )?Given access/)
......
# frozen_string_literal: true
FactoryBot.define do
factory :oauth_openid_request, class: 'Doorkeeper::OpenidConnect::Request' do
access_grant factory: :oauth_access_grant
sequence(:nonce) { |n| n.to_s }
end
end
......@@ -34,6 +34,7 @@ describe Gitlab::DataBuilder::Pipeline do
expect(build_data).to be_a(Hash)
expect(build_data[:id]).to eq(build.id)
expect(build_data[:status]).to eq(build.status)
expect(build_data[:allow_failure]).to eq(build.allow_failure)
expect(project_data).to eq(project.hook_attrs(backward: false))
expect(data[:merge_request]).to be_nil
end
......
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::GrafanaEmbedUsageData do
describe '#issue_count' do
subject { described_class.issue_count }
let(:project) { create(:project) }
let(:description_with_embed) { "Some comment\n\nhttps://grafana.example.com/d/xvAk4q0Wk/go-processes?orgId=1&from=1573238522762&to=1573240322762&var-job=prometheus&var-interval=10m&panelId=1&fullscreen" }
let(:description_with_unintegrated_embed) { "Some comment\n\nhttps://grafana.exp.com/d/xvAk4q0Wk/go-processes?orgId=1&from=1573238522762&to=1573240322762&var-job=prometheus&var-interval=10m&panelId=1&fullscreen" }
let(:description_with_non_grafana_inline_metric) { "Some comment\n\n#{Gitlab::Routing.url_helpers.metrics_namespace_project_environment_url(*['foo', 'bar', 12])}" }
shared_examples "zero count" do
it "does not count the issue" do
expect(subject).to eq(0)
end
end
context 'with project grafana integration enabled' do
before do
create(:grafana_integration, project: project, enabled: true)
end
context 'with valid and invalid embeds' do
before do
# Valid
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project, description: description_with_embed)
# In-Valid
create(:issue, project: project, description: description_with_unintegrated_embed)
create(:issue, project: project, description: description_with_non_grafana_inline_metric)
create(:issue, project: project, description: nil)
create(:issue, project: project, description: '')
create(:issue, project: project)
end
it 'counts only the issues with embeds' do
expect(subject).to eq(2)
end
end
end
context 'with project grafana integration disabled' do
before do
create(:grafana_integration, project: project, enabled: false)
end
context 'with one issue having a grafana link in the description and one without' do
before do
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project)
end
it_behaves_like('zero count')
end
end
context 'with an un-integrated project' do
context 'with one issue having a grafana link in the description and one without' do
before do
create(:issue, project: project, description: description_with_embed)
create(:issue, project: project)
end
it_behaves_like('zero count')
end
end
end
end
......@@ -53,6 +53,8 @@ describe Gitlab::UsageData do
create(:grafana_integration, project: projects[1], enabled: true)
create(:grafana_integration, project: projects[2], enabled: false)
allow(Gitlab::GrafanaEmbedUsageData).to receive(:issue_count).and_return(2)
ProjectFeature.first.update_attribute('repository_access_level', 0)
end
......@@ -152,6 +154,7 @@ describe Gitlab::UsageData do
issues
issues_with_associated_zoom_link
issues_using_zoom_quick_actions
issues_with_embedded_grafana_charts_approx
keys
label_lists
labels
......@@ -211,6 +214,7 @@ describe Gitlab::UsageData do
expect(count_data[:projects_with_error_tracking_enabled]).to eq(1)
expect(count_data[:issues_with_associated_zoom_link]).to eq(2)
expect(count_data[:issues_using_zoom_quick_actions]).to eq(3)
expect(count_data[:issues_with_embedded_grafana_charts_approx]).to eq(2)
expect(count_data[:clusters_enabled]).to eq(4)
expect(count_data[:project_clusters_enabled]).to eq(3)
......
# frozen_string_literal: true
require 'spec_helper'
describe OauthAccessGrant do
let(:user) { create(:user) }
let(:application) { create(:oauth_application, owner: user) }
describe '#delete' do
it 'cascades to oauth_openid_requests' do
access_grant = create(:oauth_access_grant, application: application)
create(:oauth_openid_request, access_grant: access_grant)
expect { access_grant.delete }.to change(Doorkeeper::OpenidConnect::Request, :count).by(-1)
end
end
end
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