提交 3dcdea95 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 607646ef
......@@ -124,10 +124,10 @@ export default {
<div
v-for="(link, index) in release.assets.links"
:key="link.id"
class="row flex-column flex-sm-row align-items-stretch align-items-sm-start"
class="row flex-column flex-sm-row align-items-stretch align-items-sm-start no-gutters"
>
<gl-form-group
class="url-field form-group col"
class="url-field form-group col pr-sm-2"
:label="__('URL')"
:label-for="`asset-url-${index}`"
>
......@@ -164,7 +164,7 @@ export default {
</gl-form-group>
<gl-form-group
class="link-title-field col"
class="link-title-field col px-sm-2"
:label="__('Link title')"
:label-for="`asset-link-name-${index}`"
>
......@@ -186,7 +186,7 @@ export default {
<gl-form-group
v-if="glFeatures.releaseAssetLinkType"
class="link-type-field col-auto"
class="link-type-field col-auto px-sm-2"
:label="__('Type')"
:label-for="`asset-type-${index}`"
>
......@@ -200,7 +200,7 @@ export default {
/>
</gl-form-group>
<div class="mb-5 mb-sm-3 mt-sm-4 col col-sm-auto">
<div class="mb-5 mb-sm-3 mt-sm-4 col col-sm-auto pl-sm-2">
<gl-button
v-gl-tooltip
class="remove-button w-100 form-control"
......
......@@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
VERSION = '0.17.0'
VERSION = '0.17.1'
self.table_name = 'clusters_applications_runners'
......
......@@ -46,7 +46,7 @@ module Issues
end
def email_results_to_user
Notify.import_issues_csv_email(@user.id, @project.id, @results).deliver_now
Notify.import_issues_csv_email(@user.id, @project.id, @results).deliver_later
end
def detect_col_sep(header)
......
......@@ -12,7 +12,7 @@ module IncidentManagement
return unless project
new_issue = create_issue(project, alert_payload)
return unless am_alert_id && new_issue.persisted?
return unless am_alert_id && new_issue&.persisted?
link_issue_with_alert(am_alert_id, new_issue.id)
end
......@@ -27,6 +27,7 @@ module IncidentManagement
IncidentManagement::CreateIssueService
.new(project, alert_payload)
.execute
.dig(:issue)
end
def link_issue_with_alert(alert_id, issue_id)
......
---
title: Resolve spacing ux debt on Release assets form field
merge_request: 33684
author:
type: fixed
---
title: Prevent duplicate issues when importing from CSV
merge_request: 33626
author:
type: fixed
---
title: Fix linking alerts to created issues for the Generic alerts intergration
merge_request: 33647
author:
type: fixed
---
title: Update GitLab Runner Helm Chart to 0.17.1
merge_request: 33504
author:
type: other
# frozen_string_literal: true
NO_SPECS_LABELS = %w[backstage documentation QA].freeze
NO_NEW_SPEC_MESSAGE = <<~MSG.freeze
NO_NEW_SPEC_MESSAGE = <<~MSG
You've made some app changes, but didn't add any tests.
That's OK as long as you're refactoring existing code,
but please consider adding any of the %<labels>s labels.
MSG
EE_CHANGE_WITH_FOSS_SPEC_CHANGE_MESSAGE = <<~MSG
You've made some EE-specific changes, but only made changes to FOSS tests.
This could be a sign that you're testing an EE-specific behavior in a FOSS test.
has_app_changes = !helper.all_changed_files.grep(%r{\A(ee/)?(app|lib|db/(geo/)?(post_)?migrate)/}).empty?
has_spec_changes = !helper.all_changed_files.grep(%r{\A(ee/)?spec/}).empty?
Please make sure the spec files pass in AS-IF-FOSS mode either:
1. Locally with `FOSS_ONLY=1 bin/rspec -- %<spec_files>s`.
1. In the MR pipeline by verifying that the `rspec foss-impact` job has passed.
1. In the MR pipelines by including `RUN AS-IF-FOSS` in the MR title (you can do it with the ``/title %<mr_title>s [RUN AS-IF-FOSS]`` quick action) and start a new MR pipeline.
MSG
has_app_changes = helper.all_changed_files.grep(%r{\A(app|lib|db/(geo/)?(post_)?migrate)/}).any?
has_ee_app_changes = helper.all_changed_files.grep(%r{\Aee/(app|lib|db/(geo/)?(post_)?migrate)/}).any?
spec_changes = helper.all_changed_files.grep(%r{\Aspec/})
has_spec_changes = spec_changes.any?
has_ee_spec_changes = helper.all_changed_files.grep(%r{\Aee/spec/}).any?
new_specs_needed = (gitlab.mr_labels & NO_SPECS_LABELS).empty?
if has_app_changes && !has_spec_changes && new_specs_needed
if (has_app_changes || has_ee_app_changes) && !(has_spec_changes || has_ee_spec_changes) && new_specs_needed
warn format(NO_NEW_SPEC_MESSAGE, labels: helper.labels_list(NO_SPECS_LABELS)), sticky: false
end
# The only changes outside `ee/` are in `spec/`
if has_ee_app_changes && has_spec_changes && !(has_app_changes || has_ee_spec_changes)
warn format(EE_CHANGE_WITH_FOSS_SPEC_CHANGE_MESSAGE, spec_files: spec_changes.join(" "), mr_title: gitlab.mr_json['title']), sticky: false
end
# frozen_string_literal: true
class ChangeConstraintNameOnResourceStateEvents < ActiveRecord::Migration[6.0]
DOWNTIME = false
NEW_CONSTRAINT_NAME = 'state_events_must_belong_to_issue_or_merge_request_or_epic'
OLD_CONSTRAINT_NAME = 'resource_state_events_must_belong_to_issue_or_merge_request_or_epic'
def up
execute "ALTER TABLE resource_state_events RENAME CONSTRAINT #{OLD_CONSTRAINT_NAME} TO #{NEW_CONSTRAINT_NAME};"
end
def down
execute "ALTER TABLE resource_state_events RENAME CONSTRAINT #{NEW_CONSTRAINT_NAME} TO #{OLD_CONSTRAINT_NAME};"
end
end
......@@ -5895,7 +5895,7 @@ CREATE TABLE public.resource_state_events (
created_at timestamp with time zone NOT NULL,
state smallint NOT NULL,
epic_id integer,
CONSTRAINT resource_state_events_must_belong_to_issue_or_merge_request_or_ CHECK ((((issue_id <> NULL::bigint) AND (merge_request_id IS NULL) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id <> NULL::bigint) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id IS NULL) AND (epic_id <> NULL::integer))))
CONSTRAINT state_events_must_belong_to_issue_or_merge_request_or_epic CHECK ((((issue_id <> NULL::bigint) AND (merge_request_id IS NULL) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id <> NULL::bigint) AND (epic_id IS NULL)) OR ((issue_id IS NULL) AND (merge_request_id IS NULL) AND (epic_id <> NULL::integer))))
);
CREATE SEQUENCE public.resource_state_events_id_seq
......@@ -13776,5 +13776,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200527152116
20200527152657
20200528123703
20200603073101
\.
---
stage: Create
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
# Gitaly
[Gitaly](https://gitlab.com/gitlab-org/gitaly) is the service that
provides high-level RPC access to Git repositories. Without it, no other
components can read or write Git data. GitLab components that access Git
repositories (GitLab Rails, GitLab Shell, GitLab Workhorse, etc.) act as clients
to Gitaly. End users do not have direct access to Gitaly.
[Gitaly](https://gitlab.com/gitlab-org/gitaly) is the service that provides high-level RPC access to
Git repositories. Without it, no GitLab components can read or write Git data.
On this page:
In the Gitaly documentation:
- **Gitaly server** refers to any node that runs Gitaly itself.
- **Gitaly client** refers to any node that runs a process that makes requests of the
Gitaly server. Processes include, but are not limited to:
- GitLab Rails application.
- GitLab Shell.
- GitLab Workhorse.
- [GitLab Rails application](https://gitlab.com/gitlab-org/gitlab).
- [GitLab Shell](https://gitlab.com/gitlab-org/gitlab-shell).
- [GitLab Workhorse](https://gitlab.com/gitlab-org/gitlab-workhorse).
GitLab end users do not have direct access to Gitaly.
CAUTION: **Caution:**
From GitLab 13.0, using NFS for Git repositories is deprecated. In GitLab 14.0,
......@@ -22,7 +28,7 @@ support for NFS for Git repositories is scheduled to be removed. Upgrade to
## Architecture
Here's a high-level architecture overview of how Gitaly is used.
The following is a high-level architecture overview of how Gitaly is used.
![Gitaly architecture diagram](img/architecture_v12_4.png)
......@@ -30,7 +36,7 @@ Here's a high-level architecture overview of how Gitaly is used.
The Gitaly service itself is configured via a [TOML configuration file](reference.md).
If you want to change any of its settings:
To change Gitaly settings:
**For Omnibus GitLab**
......@@ -44,12 +50,20 @@ If you want to change any of its settings:
## Running Gitaly on its own server
This is an optional way to deploy Gitaly which can benefit GitLab
installations that are larger than a single machine. Most
installations will be better served with the default configuration
used by Omnibus and the GitLab source installation guide.
Following transition to Gitaly on its own server,
[Gitaly servers will need to be upgraded before Gitaly clients in your cluster](https://docs.gitlab.com/omnibus/update/#upgrading-gitaly-servers).
By default, Gitaly is run on the same server as Gitaly clients and is
[configured as above](#configuring-gitaly). Single-server installations are best served by
this default configuration used by:
- [Omnibus GitLab](https://docs.gitlab.com/omnibus/).
- The GitLab [source installation guide](../../install/installation.md).
However, Gitaly can be deployed to its own server, which can benefit GitLab installations that span
multiple machines.
NOTE: **Note:**
When configured to run on their own servers, Gitaly servers
[must be upgraded](https://docs.gitlab.com/omnibus/update/#upgrading-gitaly-servers) before Gitaly
clients in your cluster.
Starting with GitLab 11.4, Gitaly is able to serve all Git requests without
requiring a shared NFS mount for Git repository data.
......
---
stage: Create
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
......
---
stage: Create
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
......
---
stage: Create
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: reference
---
......
......@@ -144,6 +144,10 @@ It's also important to ensure that any background migrations have been fully com
before upgrading to a new major version. To see the current size of the `background_migration` queue,
[Check for background migrations before upgrading](../update/README.md#checking-for-background-migrations-before-upgrading).
If your GitLab instance has any GitLab Runners associated with it, it is very
important to upgrade the GitLab Runners to match the GitLab minor version that was
upgraded to. This is to ensure [compatibility with GitLab versions](https://docs.gitlab.com/runner/#compatibility-with-gitlab-versions).
### Version 12 onwards: Extra step for major upgrades
From version 12 onwards, an additional step is required. More significant migrations
......
......@@ -1017,7 +1017,7 @@ You can also use raw HTML in your Markdown, and it will usually work pretty well
See the documentation for HTML::Pipeline's [SanitizationFilter](https://github.com/jch/html-pipeline/blob/v2.12.3/lib/html/pipeline/sanitization_filter.rb#L42)
class for the list of allowed HTML tags and attributes. In addition to the default
`SanitizationFilter` whitelist, GitLab allows `span`, `abbr`, `details` and `summary` elements.
`SanitizationFilter` allowlist, GitLab allows `span`, `abbr`, `details` and `summary` elements.
```html
<dl>
......
......@@ -250,7 +250,27 @@ When the `_gitlab_session` expires or isn't available, GitLab uses the `remember
to get you a new `_gitlab_session` and keep you signed in through browser restarts.
After your `remember_user_token` expires and your `_gitlab_session` is cleared/expired,
you will be asked to sign in again to verify your identity (which is for security reasons).
you will be asked to sign in again to verify your identity for security reasons.
### Increased sign-in time
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/20340) in GitLab 13.1.
The `remember_user_token` lifetime of a cookie can now extend beyond the deadline set by `config.remember_for`, as the `config.extend_remember_period` flag is now set to true.
GitLab uses both session and persistent cookies:
- Session cookie: Session cookies are normally removed at the end of the browser session when the browser is closed. The `_gitlab_session` cookie has no expiration date.
- Persistent cookie: The `remember_me_token` is a cookie with an expiration date of two weeks. GitLab activates this cookie if you click Remember Me when you sign in.
By default, the server sets a time-to-live (TTL) of 1-week on any session that is used.
When you close a browser, the session cookie may still remain. For example, Chrome has the "Continue where you left off" option that restores session cookies.
In other words, as long as you access GitLab at least once every 2 weeks, you could remain signed in with GitLab, as long as your browser tab is open.
The server continues to reset the TTL for that session, independent of whether 2FA is installed,
If you close your browser and open it up again, the `remember_user_token` cookie allows your user to reauthenticate itself.
Without the `config.extend_remember_period` flag, you would be forced to sign in again after two weeks.
<!-- ## Troubleshooting
......
......@@ -47,6 +47,10 @@ Keep in mind the limitations of the [import/export feature](../settings/import_e
You will still need to migrate your Container Registry over a series of
Docker pulls and pushes and re-run any CI pipelines to retrieve any build artifacts.
## Migrating from GitLab.com to self-managed GitLab
The process is essentially the same as for [migrating from self-managed GitLab to GitLab.com](#migrating-from-self-managed-gitlab-to-gitlabcom). The main difference is that users can be created on the self-managed GitLab instance by an admin through the UI or the [users API](../../../api/users.md#user-creation).
## Migrating between two self-managed GitLab instances
The best method for migrating from one GitLab instance to another,
......
---
stage: Create
group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type: howto
---
......
......@@ -14179,6 +14179,9 @@ msgstr ""
msgid "MissingSSHKeyWarningLink|You won't be able to pull or push project code via SSH until you add an SSH key to your profile"
msgstr ""
msgid "ModalButton|Add projects"
msgstr ""
msgid "Modal|Cancel"
msgstr ""
......
......@@ -525,6 +525,14 @@ describe('RepoEditor', () => {
);
};
const watchState = watched =>
new Promise(resolve => {
const unwatch = vm.$store.watch(watched, () => {
unwatch();
resolve();
});
});
beforeEach(() => {
setFileName('bar.md');
......@@ -562,7 +570,10 @@ describe('RepoEditor', () => {
it("adds a markdown image tag to the file's contents", () => {
pasteImage();
return waitForPromises().then(() => {
// Pasting an image does a lot of things like using the FileReader API,
// so, waitForPromises isn't very reliable (and causes a flaky spec)
// Read more about state.watch: https://vuex.vuejs.org/api/#watch
return watchState(s => s.entries['foo/bar.md'].content).then(() => {
expect(vm.file.content).toBe('hello world\n![foo.png](./foo.png)');
});
});
......
......@@ -18,9 +18,7 @@ describe Issues::ImportCsvService do
let(:file) { fixture_file_upload('spec/fixtures/banana_sample.gif') }
it 'returns invalid file error' do
expect_next_instance_of(Notify) do |instance|
expect(instance).to receive(:import_issues_csv_email)
end
expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later)
expect(subject[:success]).to eq(0)
expect(subject[:parse_error]).to eq(true)
......@@ -31,9 +29,7 @@ describe Issues::ImportCsvService do
let(:file) { fixture_file_upload('spec/fixtures/csv_gitlab_export.csv') }
it 'imports the CSV without errors' do
expect_next_instance_of(Notify) do |instance|
expect(instance).to receive(:import_issues_csv_email)
end
expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later)
expect(subject[:success]).to eq(4)
expect(subject[:error_lines]).to eq([])
......@@ -54,9 +50,7 @@ describe Issues::ImportCsvService do
let(:file) { fixture_file_upload('spec/fixtures/csv_comma.csv') }
it 'imports CSV without errors' do
expect_next_instance_of(Notify) do |instance|
expect(instance).to receive(:import_issues_csv_email)
end
expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later)
expect(subject[:success]).to eq(3)
expect(subject[:error_lines]).to eq([])
......@@ -77,9 +71,7 @@ describe Issues::ImportCsvService do
let(:file) { fixture_file_upload('spec/fixtures/csv_tab.csv') }
it 'imports CSV with some error rows' do
expect_next_instance_of(Notify) do |instance|
expect(instance).to receive(:import_issues_csv_email)
end
expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later)
expect(subject[:success]).to eq(2)
expect(subject[:error_lines]).to eq([3])
......@@ -100,9 +92,7 @@ describe Issues::ImportCsvService do
let(:file) { fixture_file_upload('spec/fixtures/csv_semicolon.csv') }
it 'imports CSV with a blank row' do
expect_next_instance_of(Notify) do |instance|
expect(instance).to receive(:import_issues_csv_email)
end
expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later)
expect(subject[:success]).to eq(3)
expect(subject[:error_lines]).to eq([4])
......
......@@ -7,40 +7,39 @@ describe IncidentManagement::ProcessAlertWorker do
describe '#perform' do
let(:alert_management_alert_id) { nil }
let(:alert_payload) { { alert: 'payload' } }
let(:new_issue) { create(:issue, project: project) }
let(:create_issue_service) { instance_double(IncidentManagement::CreateIssueService, execute: new_issue) }
let(:alert_payload) do
{
'annotations' => { 'title' => 'title' },
'startsAt' => Time.now.rfc3339
}
end
let(:created_issue) { Issue.last }
subject { described_class.new.perform(project.id, alert_payload, alert_management_alert_id) }
before do
allow(IncidentManagement::CreateIssueService)
.to receive(:new).with(project, alert_payload)
.and_return(create_issue_service)
.and_call_original
end
it 'calls create issue service' do
expect(Project).to receive(:find_by_id).and_call_original
it 'creates an issue' do
expect(IncidentManagement::CreateIssueService)
.to receive(:new).with(project, alert_payload)
.and_return(create_issue_service)
expect(create_issue_service).to receive(:execute)
subject
expect { subject }.to change { Issue.count }.by(1)
end
context 'with invalid project' do
let(:invalid_project_id) { 0 }
let(:invalid_project_id) { non_existing_record_id }
subject { described_class.new.perform(invalid_project_id, alert_payload) }
it 'does not create issues' do
expect(Project).to receive(:find_by_id).and_call_original
expect(IncidentManagement::CreateIssueService).not_to receive(:new)
subject
expect { subject }.not_to change { Issue.count }
end
end
......@@ -59,7 +58,9 @@ describe IncidentManagement::ProcessAlertWorker do
context 'when alert can be updated' do
it 'updates AlertManagement::Alert#issue_id' do
expect { subject }.to change { alert.reload.issue_id }.to(new_issue.id)
subject
expect(alert.reload.issue_id).to eq(created_issue.id)
end
it 'does not write a warning to log' do
......@@ -76,12 +77,12 @@ describe IncidentManagement::ProcessAlertWorker do
expect { subject }.not_to change { alert.reload.issue_id }
end
it 'writes a worning to log' do
it 'logs a warning' do
subject
expect(Gitlab::AppLogger).to have_received(:warn).with(
message: 'Cannot link an Issue with Alert',
issue_id: new_issue.id,
issue_id: created_issue.id,
alert_id: alert_management_alert_id,
alert_errors: { hosts: ['hosts array is over 255 chars'] }
)
......
......@@ -787,10 +787,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.135.0.tgz#b190f50c0a744d3b915f11defcdd17d7ae585928"
integrity sha512-ziNYtJ6NXk/XVbptKvgdyVqbYocisPK63oRvWldYDSi/H8IMpdBo0upe+VhjepoEzxuUZ1yxc8Y1JMJ+RTpM+w==
"@gitlab/ui@16.1.0":
version "16.1.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-16.1.0.tgz#fe6bbb3a8fb8d1cb7a577f4bb7cb2f1b35b34c57"
integrity sha512-YPC0ntS7Wp3wQq/sSUu16Z62XgyY3Oe49vIvm0e3bt2ho2pVf9fuztrcsj7Kb9RrdHOUccUWfZLp+roDd9J0sQ==
"@gitlab/ui@16.2.0":
version "16.2.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-16.2.0.tgz#b187b54e2757c59473834114aceb886697abcae1"
integrity sha512-9x+b8l2guCFAtvBA/kf8y6oDs1vsPbOxVpxaSDbf/yV0A4w/bxsIjtN0kBacntTlhmK73yNBmydfhOB4Il8xrg==
dependencies:
"@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册