Commit c089cf73 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent f14507e5
......@@ -181,6 +181,8 @@ export default {
boardsStore.startMoving(list, issue);
this.$root.$emit('bv::hide::tooltip');
sortableStart();
},
onAdd: e => {
......
......@@ -149,7 +149,13 @@ export default {
};
</script>
<template>
<gl-dropdown :text="timeWindowText" class="date-time-picker" menu-class="date-time-picker-menu">
<gl-dropdown
:text="timeWindowText"
class="date-time-picker"
menu-class="date-time-picker-menu"
v-bind="$attrs"
toggle-class="w-100 text-truncate"
>
<div class="d-flex justify-content-between gl-p-2">
<gl-form-group
:label="__('Custom range')"
......
---
title: Hide label tooltips when dragging board cards
merge_request: 24239
author:
type: fixed
---
title: Update webpack related packages
merge_request: 22456
author: Takuya Noguchi
type: security
---
title: Bump auto-deploy-image for Auto DevOps deploy to 0.9.1
merge_request: 24231
author:
type: other
......@@ -18,7 +18,7 @@ to the existing rules, then this is the document for you.
A subset of the current checks can be run locally with the following rake task:
```shell
bundle exec danger_local
bin/rake danger_local
```
## Operation
......
......@@ -371,6 +371,54 @@ it('calls mutation on submitting form ', () => {
});
```
## Handling errors
GitLab's GraphQL mutations currently have two distinct error modes: [Top-level](#top-level-errors) and [errors-as-data](#errors-as-data).
When utilising a GraphQL mutation, we must consider handling **both of these error modes** to ensure that the user receives the appropriate feedback when an error occurs.
### Top-level errors
These errors are located at the "top level" of a GraphQL response. These are non-recoverable errors including argument errors and syntax errors, and should not be presented directly to the user.
#### Handling top-level errors
Apollo is aware of top-level errors, so we are able to leverage Apollo's various error-handling mechanisms to handle these errors (e.g. handling Promise rejections after invoking the [`mutate`](https://www.apollographql.com/docs/react/api/apollo-client/#ApolloClient.mutate) method, or handling the `error` event emitted from the [`ApolloMutation`](https://apollo.vuejs.org/api/apollo-mutation.html#events) component).
Because these errors are not intended for users, error messages for top-level errors should be defined client-side.
### Errors-as-data
These errors are nested within the `data` object of a GraphQL response. These are recoverable errors that, ideally, can be presented directly to the user.
#### Handling errors-as-data
First, we must add `errors` to our mutation object:
```diff
mutation createNoteMutation($input: String!) {
createNoteMutation(input: $input) {
note {
id
+ errors
}
}
```
Now, when we commit this mutation and errors occur, the response will include `errors` for us to handle:
```javascript
{
data: {
mutationName: {
errors: ["Sorry, we were not able to update the note."]
}
}
}
```
When handling errors-as-data, use your best judgement to determine whether to present the error message in the response, or another message defined client-side, to the user.
## Usage outside of Vue
It is also possible to use GraphQL outside of Vue by directly importing
......
......@@ -302,7 +302,7 @@ There are a few guidelines one should follow when using the
fields in the context of that code path, such as the URI of the request using
[`WithField`](https://godoc.org/github.com/sirupsen/logrus#WithField) or
[`WithFields`](https://godoc.org/github.com/sirupsen/logrus#WithFields). For
example, `logrus.WithField("file", "/app/go).Info("Opening dir")`. If you
example, `logrus.WithField("file", "/app/go").Info("Opening dir")`. If you
have to log multiple keys, always use `WithFields` instead of calling
`WithField` more than once.
......
......@@ -545,6 +545,15 @@ why without editing the source and rerun the tests.
This is especially useful whenever it's showing 500 internal server error.
Prefer named HTTP status like `:no_content` over its numeric representation
`206`. See a list of [supported status codes](https://github.com/rack/rack/blob/f2d2df4016a906beec755b63b4edfcc07b58ee05/lib/rack/utils.rb#L490).
Example:
```ruby
expect(response).to have_gitlab_http_status(:ok)
```
### Shared contexts
Shared contexts only used in one spec file can be declared inline.
......
......@@ -31,9 +31,7 @@ module Gitlab
end
def beta_enabled?
Feature.enabled?(:auto_devops_beta, project, default_enabled: true) &&
# workflow:rules are required by `Beta/Auto-DevOps.gitlab-ci.yml`
Feature.enabled?(:workflow_rules, project, default_enabled: true)
Feature.enabled?(:auto_devops_beta, project, default_enabled: true)
end
end
end
......
......@@ -31,9 +31,7 @@ module Gitlab
end
def beta_enabled?
Feature.enabled?(:auto_devops_beta, project, default_enabled: true) &&
# workflow:rules are required by `Beta/Auto-DevOps.gitlab-ci.yml`
Feature.enabled?(:workflow_rules, project, default_enabled: true)
Feature.enabled?(:auto_devops_beta, project, default_enabled: true)
end
end
end
......
......@@ -9,17 +9,7 @@ module Gitlab
include Chain::Helpers
def perform!
unless feature_enabled?
if has_workflow_rules?
error("Workflow rules are disabled", config_error: true)
end
return
end
unless workflow_passed?
error('Pipeline filtered out by workflow rules.')
end
error('Pipeline filtered out by workflow rules.') unless workflow_passed?
end
def break?
......@@ -28,10 +18,6 @@ module Gitlab
private
def feature_enabled?
Feature.enabled?(:workflow_rules, @pipeline.project, default_enabled: true)
end
def workflow_passed?
strong_memoize(:workflow_passed) do
workflow_rules.evaluate(@pipeline, global_context).pass?
......
.auto-deploy:
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.8.3"
image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v0.9.1"
review:
extends: .auto-deploy
......
......@@ -649,9 +649,6 @@ msgstr ""
msgid "1st contribution!"
msgstr ""
msgid "2 days"
msgstr ""
msgid "2 weeks"
msgstr ""
......@@ -682,9 +679,6 @@ msgstr ""
msgid "30+ contributions"
msgstr ""
msgid "4 hours"
msgstr ""
msgid "403|Please contact your GitLab administrator to get permission."
msgstr ""
......@@ -11991,6 +11985,9 @@ msgstr ""
msgid "Metrics|For grouping similar metrics"
msgstr ""
msgid "Metrics|Invalid time range, please verify."
msgstr ""
msgid "Metrics|Label of the y-axis (usually the unit). The x-axis always represents time."
msgstr ""
......@@ -13362,9 +13359,6 @@ msgstr ""
msgid "Past due"
msgstr ""
msgid "Past week"
msgstr ""
msgid "Paste a machine public key here. Read more about how to generate it %{link_start}here%{link_end}"
msgstr ""
......
......@@ -3,7 +3,7 @@
module QA
module Resource
module Events
MAX_WAIT = 10
MAX_WAIT = 60
RAISE_ON_FAILURE = true
EventNotFoundError = Class.new(RuntimeError)
......
import { shallowMount } from '@vue/test-utils';
import { GlColumnChart } from '@gitlab/ui/dist/charts';
import Component from '~/projects/pipelines/charts/components/app';
import StatisticsList from '~/projects/pipelines/charts/components/statistics_list';
import Component from '~/projects/pipelines/charts/components/app.vue';
import StatisticsList from '~/projects/pipelines/charts/components/statistics_list.vue';
import { counts, timesChartData } from '../mock_data';
describe('ProjectsPipelinesChartsApp', () => {
......
import { shallowMount } from '@vue/test-utils';
import Component from '~/projects/pipelines/charts/components/statistics_list';
import Component from '~/projects/pipelines/charts/components/statistics_list.vue';
import { counts } from '../mock_data';
describe('StatisticsList', () => {
......
......@@ -38,7 +38,7 @@ describe Gitlab::SafeRequestStore do
describe '.clear!' do
context 'when RequestStore is active', :request_store do
it 'uses RequestStore' do
expect(RequestStore).to receive(:clear!).twice.and_call_original
expect(RequestStore).to receive(:clear!).once.and_call_original
described_class.clear!
end
......@@ -56,7 +56,7 @@ describe Gitlab::SafeRequestStore do
describe '.end!' do
context 'when RequestStore is active', :request_store do
it 'uses RequestStore' do
expect(RequestStore).to receive(:end!).twice.and_call_original
expect(RequestStore).to receive(:end!).once.and_call_original
described_class.end!
end
......
......@@ -100,17 +100,6 @@ describe Ci::CreatePipelineService do
stub_ci_pipeline_yaml_file(config)
end
shared_examples 'workflow:rules feature disabled' do
before do
stub_feature_flags(workflow_rules: false)
end
it 'presents a message that rules are disabled' do
expect(pipeline.errors[:base]).to include('Workflow rules are disabled')
expect(pipeline).to be_persisted
end
end
context 'with a single regex-matching if: clause' do
let(:config) do
<<-EOY
......@@ -241,8 +230,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('No stages / jobs for this pipeline.')
expect(pipeline).not_to be_persisted
end
it_behaves_like 'workflow:rules feature disabled'
end
context 'where workflow passes and the job passes' do
......@@ -252,8 +239,6 @@ describe Ci::CreatePipelineService do
expect(pipeline).to be_pending
expect(pipeline).to be_persisted
end
it_behaves_like 'workflow:rules feature disabled'
end
context 'where workflow fails and the job fails' do
......@@ -263,8 +248,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.')
expect(pipeline).not_to be_persisted
end
it_behaves_like 'workflow:rules feature disabled'
end
context 'where workflow fails and the job passes' do
......@@ -274,8 +257,6 @@ describe Ci::CreatePipelineService do
expect(pipeline.errors[:base]).to include('Pipeline filtered out by workflow rules.')
expect(pipeline).not_to be_persisted
end
it_behaves_like 'workflow:rules feature disabled'
end
end
end
......
......@@ -208,11 +208,11 @@ RSpec.configure do |config|
example.run if config.inclusion_filter[:quarantine]
end
config.before(:example, :request_store) do
config.around(:example, :request_store) do |example|
RequestStore.begin!
end
config.after(:example, :request_store) do
example.run
RequestStore.end!
RequestStore.clear!
end
......
This diff is collapsed.
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