Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-09-23 06:10:24 +00:00
parent 8c1c323ac0
commit 17569e185c
15 changed files with 149 additions and 31 deletions

View File

@ -0,0 +1,2 @@
.progress
.progress-bar{ class: "bg-#{@variant}", style: "width: #{@value}%;" }

View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
module Pajamas
class ProgressComponent < Pajamas::Component
def initialize(value: 0, variant: :primary)
@value = value
@variant = filter_attribute(variant, VARIANT_OPTIONS, default: :primary)
end
VARIANT_OPTIONS = [:primary, :success].freeze
end
end

View File

@ -8,12 +8,12 @@ module TimeHelper
if minutes >= 1
if seconds % 60 == 0
pluralize(minutes, "minute")
n_('%d minute', '%d minutes', minutes) % minutes
else
[pluralize(minutes, "minute"), pluralize(seconds, "second")].to_sentence
[n_('%d minute', '%d minutes', minutes) % minutes, n_('%d second', '%d seconds', seconds) % seconds].to_sentence
end
else
pluralize(seconds, "second")
n_('%d second', '%d seconds', seconds) % seconds
end
end

View File

@ -77,14 +77,10 @@ module TimeboxesHelper
end
def milestone_progress_bar(milestone)
options = {
class: 'progress-bar bg-success',
style: "width: #{milestone.percent_complete}%;"
}
content_tag :div, class: 'progress' do
content_tag :div, nil, options
end
render Pajamas::ProgressComponent.new(
value: milestone.percent_complete,
variant: :success
)
end
def milestone_time_for(date, date_type)

View File

@ -92,7 +92,7 @@ module Ci
if all_related_merge_requests.none?
_("No related merge requests found.")
else
_("%{count} related %{pluralized_subject}: %{links}" % {
(_("%{count} related %{pluralized_subject}: %{links}") % {
count: all_related_merge_requests.count,
pluralized_subject: n_('merge request', 'merge requests', all_related_merge_requests.count),
links: all_related_merge_request_links(limit: limit).join(', ')

View File

@ -9,13 +9,14 @@
.well-segment.pipeline-info{ class: "gl-align-items-baseline!" }
.icon-container
= sprite_icon('clock', css_class: 'gl-top-0!')
= pluralize @pipeline.total_size, "job"
= @pipeline.ref_text
- jobs = n_('%d job', '%d jobs', @pipeline.total_size) % @pipeline.total_size
- if @pipeline.duration
in
= time_interval_in_words(@pipeline.duration)
= s_('Pipelines|%{jobs} %{ref_text} in %{duration}').html_safe % { jobs: jobs, ref_text: @pipeline.ref_text, duration: time_interval_in_words(@pipeline.duration) }
- else
= jobs
= @pipeline.ref_text
- if @pipeline.queued_duration
= "(queued for #{time_interval_in_words(@pipeline.queued_duration)})"
= s_("Pipelines|(queued for %{queued_duration})") % { queued_duration: time_interval_in_words(@pipeline.queued_duration)}
- if has_pipeline_badges?(@pipeline)
.well-segment.qa-pipeline-badges

View File

@ -0,0 +1,40 @@
# frozen_string_literal: true
class DropUnusedFieldsFromMergeRequestAssignees < Gitlab::Database::Migration[2.0]
disable_ddl_transaction!
def up
with_lock_retries do
if column_exists?(:merge_request_assignees, :state) # rubocop:disable Style/IfUnlessModifier
remove_column :merge_request_assignees, :state
end
if column_exists?(:merge_request_assignees, :updated_state_by_user_id)
remove_column :merge_request_assignees, :updated_state_by_user_id
end
end
end
def down
with_lock_retries do
unless column_exists?(:merge_request_assignees, :state)
add_column :merge_request_assignees, :state, :smallint, default: 0, null: false
end
unless column_exists?(:merge_request_assignees, :updated_state_by_user_id)
add_column :merge_request_assignees, :updated_state_by_user_id, :bigint
end
end
add_concurrent_index :merge_request_assignees, [:user_id, :state],
where: 'state = 2',
name: 'index_on_merge_request_assignees_user_id_and_state'
add_concurrent_index :merge_request_assignees, :updated_state_by_user_id,
name: 'index_on_merge_request_assignees_updated_state_by_user_id'
add_concurrent_foreign_key :merge_request_assignees, :users,
column: :updated_state_by_user_id,
on_delete: :nullify
end
end

View File

@ -0,0 +1 @@
e4e86511961bf3618bd3683e1bc97a8382bfa1369bd76186f01cfac9e80e0593

View File

@ -17275,9 +17275,7 @@ CREATE TABLE merge_request_assignees (
id bigint NOT NULL,
user_id integer NOT NULL,
merge_request_id integer NOT NULL,
created_at timestamp with time zone,
state smallint DEFAULT 0 NOT NULL,
updated_state_by_user_id bigint
created_at timestamp with time zone
);
CREATE SEQUENCE merge_request_assignees_id_seq
@ -29554,10 +29552,6 @@ CREATE INDEX index_on_issues_closed_incidents_by_project_id_and_closed_at ON iss
CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type);
CREATE INDEX index_on_merge_request_assignees_updated_state_by_user_id ON merge_request_assignees USING btree (updated_state_by_user_id);
CREATE INDEX index_on_merge_request_assignees_user_id_and_state ON merge_request_assignees USING btree (user_id, state) WHERE (state = 2);
CREATE INDEX index_on_merge_request_reviewers_user_id_and_state ON merge_request_reviewers USING btree (user_id, state) WHERE (state = 2);
CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id);
@ -32907,9 +32901,6 @@ ALTER TABLE ONLY vulnerability_reads
ALTER TABLE ONLY dast_profile_schedules
ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY merge_request_assignees
ADD CONSTRAINT fk_af036e3261 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE;

View File

@ -13,7 +13,13 @@ FLAG:
On self-managed GitLab, by default this feature is not available. To make it available,
ask an administrator to [enable the feature flag](../../administration/feature_flags.md)
named `ci_secure_files`. Limited to 100 secure files per project. Files must be smaller
than 5 MB. The feature is not ready for production use.
than 5 MB. Project-level Secure Files is an experimental feature developed by [GitLab Incubation Engineering](https://about.gitlab.com/handbook/engineering/incubation/).
Project-level Secure Files is still in development, but you can:
- [Request a feature](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/feedback/-/issues/new?issuable_template=feature_request).
- [Report a bug](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/feedback/-/issues/new?issuable_template=report_bug).
- [Share feedback](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/feedback/-/issues/new?issuable_template=general_feedback).
You can securely store files for use in CI/CD pipelines as "secure files". These files
are stored securely outside of your project's repository, and are not version controlled.

View File

@ -3260,8 +3260,19 @@ branch or merge request pipelines.
**Possible inputs**:
- An array of file paths. In GitLab 13.6 and later, [file paths can include variables](../jobs/job_control.md#variables-in-ruleschanges).
- Alternatively, the array of file paths can be in [`rules:changes:paths`](#ruleschangespaths).
An array including any number of:
- Paths to files. In GitLab 13.6 and later, [file paths can include variables](../jobs/job_control.md#variables-in-ruleschanges).
A file path array can also be in [`rules:changes:paths`](#ruleschangespaths).
- Wildcard paths for:
- Single directories, for example `path/to/directory/*`.
- A directory and all its subdirectories, for example `path/to/directory/**/*`.
- Wildcard [glob](https://en.wikipedia.org/wiki/Glob_(programming)) paths for all files
with the same extension or multiple extensions, for example `*.md` or `path/to/directory/*.{rb,py,sh}`.
See the [Ruby `fnmatch` documentation](https://docs.ruby-lang.org/en/master/File.html#method-c-fnmatch)
for the supported syntax list.
- Wildcard paths to files in the root directory, or all directories, wrapped in double quotes.
For example `"*.json"` or `"**/*.json"`.
**Example of `rules:changes`**:

View File

@ -122,7 +122,7 @@ There are multiple ways to create a branch from the GitLab web interface.
If your development workflow requires an issue for every merge
request, you can create a branch directly from the issue to speed the process up.
The new branch, and later its merge request, are marked as related to this issue.
Once merged, the merge request closes the issue.
After merging the merge request, the issue is closed automatically, unless [automatic issue closing is disabled](../issues/managing_issues.md#disable-automatic-issue-closing).
You can see a **Create merge request** dropdown below the issue description.
NOTE:

View File

@ -29386,6 +29386,12 @@ msgstr ""
msgid "Pipelines|\"Hello world\" with GitLab CI"
msgstr ""
msgid "Pipelines|%{jobs} %{ref_text} in %{duration}"
msgstr ""
msgid "Pipelines|(queued for %{queued_duration})"
msgstr ""
msgid "Pipelines|1. Set up a runner"
msgstr ""

View File

@ -0,0 +1,36 @@
# frozen_string_literal: true
require "spec_helper"
RSpec.describe Pajamas::ProgressComponent, type: :component do
before do
render_inline(described_class.new(value: value, variant: variant))
end
let(:value) { 33 }
let(:variant) { nil }
describe "value" do
it "sets the width of the progressbar" do
expect(page).to have_css ".progress-bar[style='width: #{value}%;']"
end
end
describe "variant" do
where(:variant) { [:primary, :success] }
with_them do
it "adds variant class" do
expect(page).to have_css ".progress-bar.bg-#{variant}"
end
end
context "with unknown variant" do
let(:variant) { :nope }
it "adds the default variant class" do
expect(page).to have_css ".progress-bar.bg-primary"
end
end
end
end

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
module Pajamas
class ProgressComponentPreview < ViewComponent::Preview
# Progress
# ---
#
# See its design reference [here](https://design.gitlab.com/components/progress-bar).
#
# @param value number
# @param variant select [primary, success]
def default(value: 50, variant: :primary)
render Pajamas::ProgressComponent.new(value: value, variant: variant)
end
end
end