Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
8c1c323ac0
commit
17569e185c
15 changed files with 149 additions and 31 deletions
2
app/components/pajamas/progress_component.html.haml
Normal file
2
app/components/pajamas/progress_component.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
.progress
|
||||||
|
.progress-bar{ class: "bg-#{@variant}", style: "width: #{@value}%;" }
|
12
app/components/pajamas/progress_component.rb
Normal file
12
app/components/pajamas/progress_component.rb
Normal 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
|
|
@ -8,12 +8,12 @@ module TimeHelper
|
||||||
|
|
||||||
if minutes >= 1
|
if minutes >= 1
|
||||||
if seconds % 60 == 0
|
if seconds % 60 == 0
|
||||||
pluralize(minutes, "minute")
|
n_('%d minute', '%d minutes', minutes) % minutes
|
||||||
else
|
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
|
end
|
||||||
else
|
else
|
||||||
pluralize(seconds, "second")
|
n_('%d second', '%d seconds', seconds) % seconds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -77,14 +77,10 @@ module TimeboxesHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def milestone_progress_bar(milestone)
|
def milestone_progress_bar(milestone)
|
||||||
options = {
|
render Pajamas::ProgressComponent.new(
|
||||||
class: 'progress-bar bg-success',
|
value: milestone.percent_complete,
|
||||||
style: "width: #{milestone.percent_complete}%;"
|
variant: :success
|
||||||
}
|
)
|
||||||
|
|
||||||
content_tag :div, class: 'progress' do
|
|
||||||
content_tag :div, nil, options
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def milestone_time_for(date, date_type)
|
def milestone_time_for(date, date_type)
|
||||||
|
|
|
@ -92,7 +92,7 @@ module Ci
|
||||||
if all_related_merge_requests.none?
|
if all_related_merge_requests.none?
|
||||||
_("No related merge requests found.")
|
_("No related merge requests found.")
|
||||||
else
|
else
|
||||||
_("%{count} related %{pluralized_subject}: %{links}" % {
|
(_("%{count} related %{pluralized_subject}: %{links}") % {
|
||||||
count: all_related_merge_requests.count,
|
count: all_related_merge_requests.count,
|
||||||
pluralized_subject: n_('merge request', 'merge requests', 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(', ')
|
links: all_related_merge_request_links(limit: limit).join(', ')
|
||||||
|
|
|
@ -9,13 +9,14 @@
|
||||||
.well-segment.pipeline-info{ class: "gl-align-items-baseline!" }
|
.well-segment.pipeline-info{ class: "gl-align-items-baseline!" }
|
||||||
.icon-container
|
.icon-container
|
||||||
= sprite_icon('clock', css_class: 'gl-top-0!')
|
= sprite_icon('clock', css_class: 'gl-top-0!')
|
||||||
= pluralize @pipeline.total_size, "job"
|
- jobs = n_('%d job', '%d jobs', @pipeline.total_size) % @pipeline.total_size
|
||||||
= @pipeline.ref_text
|
|
||||||
- if @pipeline.duration
|
- if @pipeline.duration
|
||||||
in
|
= s_('Pipelines|%{jobs} %{ref_text} in %{duration}').html_safe % { jobs: jobs, ref_text: @pipeline.ref_text, duration: time_interval_in_words(@pipeline.duration) }
|
||||||
= time_interval_in_words(@pipeline.duration)
|
- else
|
||||||
|
= jobs
|
||||||
|
= @pipeline.ref_text
|
||||||
- if @pipeline.queued_duration
|
- 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)
|
- if has_pipeline_badges?(@pipeline)
|
||||||
.well-segment.qa-pipeline-badges
|
.well-segment.qa-pipeline-badges
|
||||||
|
|
|
@ -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
|
1
db/schema_migrations/20220919023208
Normal file
1
db/schema_migrations/20220919023208
Normal file
|
@ -0,0 +1 @@
|
||||||
|
e4e86511961bf3618bd3683e1bc97a8382bfa1369bd76186f01cfac9e80e0593
|
|
@ -17275,9 +17275,7 @@ CREATE TABLE merge_request_assignees (
|
||||||
id bigint NOT NULL,
|
id bigint NOT NULL,
|
||||||
user_id integer NOT NULL,
|
user_id integer NOT NULL,
|
||||||
merge_request_id integer NOT NULL,
|
merge_request_id integer NOT NULL,
|
||||||
created_at timestamp with time zone,
|
created_at timestamp with time zone
|
||||||
state smallint DEFAULT 0 NOT NULL,
|
|
||||||
updated_state_by_user_id bigint
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE SEQUENCE merge_request_assignees_id_seq
|
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_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_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);
|
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
|
ALTER TABLE ONLY dast_profile_schedules
|
||||||
ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
|
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
|
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;
|
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;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,13 @@ FLAG:
|
||||||
On self-managed GitLab, by default this feature is not available. To make it available,
|
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)
|
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
|
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
|
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.
|
are stored securely outside of your project's repository, and are not version controlled.
|
||||||
|
|
|
@ -3260,8 +3260,19 @@ branch or merge request pipelines.
|
||||||
|
|
||||||
**Possible inputs**:
|
**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).
|
An array including any number of:
|
||||||
- Alternatively, the array of file paths can be in [`rules:changes:paths`](#ruleschangespaths).
|
|
||||||
|
- 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`**:
|
**Example of `rules:changes`**:
|
||||||
|
|
||||||
|
|
|
@ -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
|
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.
|
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.
|
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.
|
You can see a **Create merge request** dropdown below the issue description.
|
||||||
|
|
||||||
NOTE:
|
NOTE:
|
||||||
|
|
|
@ -29386,6 +29386,12 @@ msgstr ""
|
||||||
msgid "Pipelines|\"Hello world\" with GitLab CI"
|
msgid "Pipelines|\"Hello world\" with GitLab CI"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Pipelines|%{jobs} %{ref_text} in %{duration}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Pipelines|(queued for %{queued_duration})"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
msgid "Pipelines|1. Set up a runner"
|
msgid "Pipelines|1. Set up a runner"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|
36
spec/components/pajamas/progress_component_spec.rb
Normal file
36
spec/components/pajamas/progress_component_spec.rb
Normal 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
|
|
@ -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
|
Loading…
Reference in a new issue