Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
37a0fef392
commit
66b52237fd
9 changed files with 347 additions and 500 deletions
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'rails', '6.0.2'
|
||||
gem 'rails', '~> 6.0.2.2'
|
||||
|
||||
gem 'bootsnap', '~> 1.4.6'
|
||||
|
||||
|
|
106
Gemfile.lock
106
Gemfile.lock
|
@ -6,59 +6,59 @@ GEM
|
|||
ace-rails-ap (4.1.2)
|
||||
acme-client (2.0.5)
|
||||
faraday (~> 0.9, >= 0.9.1)
|
||||
actioncable (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
actioncable (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
actionmailbox (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
activejob (= 6.0.2)
|
||||
activerecord (= 6.0.2)
|
||||
activestorage (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
actionmailbox (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
activejob (= 6.0.2.2)
|
||||
activerecord (= 6.0.2.2)
|
||||
activestorage (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
mail (>= 2.7.1)
|
||||
actionmailer (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
actionview (= 6.0.2)
|
||||
activejob (= 6.0.2)
|
||||
actionmailer (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
actionview (= 6.0.2.2)
|
||||
activejob (= 6.0.2.2)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (6.0.2)
|
||||
actionview (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
rack (~> 2.0)
|
||||
actionpack (6.0.2.2)
|
||||
actionview (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
rack (~> 2.0, >= 2.0.8)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||
actiontext (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
activerecord (= 6.0.2)
|
||||
activestorage (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
actiontext (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
activerecord (= 6.0.2.2)
|
||||
activestorage (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
actionview (6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||
activejob (6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
activejob (6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
activerecord (6.0.2)
|
||||
activemodel (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
activemodel (6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
activerecord (6.0.2.2)
|
||||
activemodel (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
activerecord-explain-analyze (0.1.0)
|
||||
activerecord (>= 4)
|
||||
pg
|
||||
activestorage (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
activejob (= 6.0.2)
|
||||
activerecord (= 6.0.2)
|
||||
activestorage (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
activejob (= 6.0.2.2)
|
||||
activerecord (= 6.0.2.2)
|
||||
marcel (~> 0.3.1)
|
||||
activesupport (6.0.2)
|
||||
activesupport (6.0.2.2)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
|
@ -808,20 +808,20 @@ GEM
|
|||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rack-timeout (0.5.1)
|
||||
rails (6.0.2)
|
||||
actioncable (= 6.0.2)
|
||||
actionmailbox (= 6.0.2)
|
||||
actionmailer (= 6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
actiontext (= 6.0.2)
|
||||
actionview (= 6.0.2)
|
||||
activejob (= 6.0.2)
|
||||
activemodel (= 6.0.2)
|
||||
activerecord (= 6.0.2)
|
||||
activestorage (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
rails (6.0.2.2)
|
||||
actioncable (= 6.0.2.2)
|
||||
actionmailbox (= 6.0.2.2)
|
||||
actionmailer (= 6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
actiontext (= 6.0.2.2)
|
||||
actionview (= 6.0.2.2)
|
||||
activejob (= 6.0.2.2)
|
||||
activemodel (= 6.0.2.2)
|
||||
activerecord (= 6.0.2.2)
|
||||
activestorage (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 6.0.2)
|
||||
railties (= 6.0.2.2)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-controller-testing (1.0.4)
|
||||
actionpack (>= 5.0.1.x)
|
||||
|
@ -835,9 +835,9 @@ GEM
|
|||
rails-i18n (6.0.0)
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 6.0.0, < 7)
|
||||
railties (6.0.2)
|
||||
actionpack (= 6.0.2)
|
||||
activesupport (= 6.0.2)
|
||||
railties (6.0.2.2)
|
||||
actionpack (= 6.0.2.2)
|
||||
activesupport (= 6.0.2.2)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.20.3, < 2.0)
|
||||
|
@ -1146,7 +1146,7 @@ GEM
|
|||
xml-simple (1.1.5)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.2.2)
|
||||
zeitwerk (2.3.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
@ -1337,7 +1337,7 @@ DEPENDENCIES
|
|||
rack-oauth2 (~> 1.9.3)
|
||||
rack-proxy (~> 0.6.0)
|
||||
rack-timeout
|
||||
rails (= 6.0.2)
|
||||
rails (~> 6.0.2.2)
|
||||
rails-controller-testing
|
||||
rails-i18n (~> 6.0)
|
||||
rainbow (~> 3.0)
|
||||
|
|
|
@ -52,8 +52,6 @@ module ChatMessage
|
|||
def attachments
|
||||
return message if markdown
|
||||
|
||||
return [{ text: format(message), color: attachment_color }] unless fancy_notifications?
|
||||
|
||||
[{
|
||||
fallback: format(message),
|
||||
color: attachment_color,
|
||||
|
@ -103,10 +101,6 @@ module ChatMessage
|
|||
failed_jobs.uniq { |job| job[:name] }.reverse
|
||||
end
|
||||
|
||||
def fancy_notifications?
|
||||
Feature.enabled?(:fancy_pipeline_slack_notifications, default_enabled: true)
|
||||
end
|
||||
|
||||
def failed_stages_field
|
||||
{
|
||||
title: s_("ChatMessage|Failed stage").pluralize(failed_stages.length),
|
||||
|
@ -166,7 +160,6 @@ module ChatMessage
|
|||
end
|
||||
|
||||
def humanized_status
|
||||
if fancy_notifications?
|
||||
case status
|
||||
when 'success'
|
||||
detailed_status == "passed with warnings" ? s_("ChatMessage|has passed with warnings") : s_("ChatMessage|has passed")
|
||||
|
@ -175,34 +168,15 @@ module ChatMessage
|
|||
else
|
||||
status
|
||||
end
|
||||
else
|
||||
case status
|
||||
when 'success'
|
||||
s_("ChatMessage|passed")
|
||||
when 'failed'
|
||||
s_("ChatMessage|failed")
|
||||
else
|
||||
status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def attachment_color
|
||||
if fancy_notifications?
|
||||
case status
|
||||
when 'success'
|
||||
detailed_status == 'passed with warnings' ? 'warning' : 'good'
|
||||
else
|
||||
'danger'
|
||||
end
|
||||
else
|
||||
case status
|
||||
when 'success'
|
||||
'good'
|
||||
else
|
||||
'danger'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def ref_url
|
||||
|
@ -230,7 +204,7 @@ module ChatMessage
|
|||
end
|
||||
|
||||
def pipeline_url
|
||||
if fancy_notifications? && failed_jobs.any?
|
||||
if failed_jobs.any?
|
||||
pipeline_failed_jobs_url
|
||||
else
|
||||
"#{project_url}/pipelines/#{pipeline_id}"
|
||||
|
|
5
changelogs/unreleased/sh-update-rails-6-0-2-2.yml
Normal file
5
changelogs/unreleased/sh-update-rails-6-0-2-2.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Update to Rails 6.0.2.2
|
||||
merge_request: 29743
|
||||
author:
|
||||
type: other
|
|
@ -7,7 +7,7 @@
|
|||
# This is covered by tests in `BulkInsertSafe`
|
||||
# that validates handling of different data types
|
||||
|
||||
if Rails.gem_version > Gem::Version.new("6.0.2")
|
||||
if Rails.gem_version > Gem::Version.new("6.0.2.2")
|
||||
raise Gem::DependencyError,
|
||||
"Remove patch once the https://github.com/rails/rails/pull/38763 is included"
|
||||
end
|
||||
|
|
|
@ -1244,6 +1244,20 @@ a helpful link back to how the feature was developed.
|
|||
NOTE: **Note:**
|
||||
Version text must be on its own line and surounded by blank lines to render correctly.
|
||||
|
||||
### Versions in the past or future
|
||||
|
||||
When describing functionality available in past or future versions, use:
|
||||
|
||||
- **Earlier**, and not **older** or **before**.
|
||||
- **Later**, and not **newer** or **after**.
|
||||
|
||||
For example:
|
||||
|
||||
- Available in GitLab 12.3 and earlier.
|
||||
- Available in GitLab 12.4 and later.
|
||||
- If using GitLab 11.4 or earlier, ...
|
||||
- If using GitLab 10.6 or later, ...
|
||||
|
||||
### Importance of referencing GitLab versions and tiers
|
||||
|
||||
Mentioning GitLab versions and tiers is important to all users and contributors
|
||||
|
|
|
@ -608,6 +608,17 @@ Each scenario can be a third-level heading, e.g. `### Getting error message X`.
|
|||
If you have none to add when creating a doc, leave this section in place
|
||||
but commented out to help encourage others to add to it in the future. -->
|
||||
|
||||
## Optimizing DAST
|
||||
|
||||
By default, DAST will download all artifacts defined by previous jobs in the pipeline. If
|
||||
your DAST job does not rely on `environment_url.txt` to define the URL under test or any other files created
|
||||
in previous jobs, we recommend you don't download artifacts. To avoid downloading artifacts, add the following to your `gitlab-ci.yml` file:
|
||||
|
||||
```json
|
||||
dast:
|
||||
dependencies: []
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Running out of memory
|
||||
|
|
|
@ -3639,9 +3639,6 @@ msgstr ""
|
|||
msgid "ChatMessage|and [%{count} more](%{pipeline_failed_jobs_url})"
|
||||
msgstr ""
|
||||
|
||||
msgid "ChatMessage|failed"
|
||||
msgstr ""
|
||||
|
||||
msgid "ChatMessage|has failed"
|
||||
msgstr ""
|
||||
|
||||
|
@ -3657,9 +3654,6 @@ msgstr ""
|
|||
msgid "ChatMessage|in %{project_link}"
|
||||
msgstr ""
|
||||
|
||||
msgid "ChatMessage|passed"
|
||||
msgstr ""
|
||||
|
||||
msgid "Check again"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -55,156 +55,6 @@ describe ChatMessage::PipelineMessage do
|
|||
allow(Gitlab::UrlBuilder).to receive(:build).with(args[:user]).and_return("http://example.gitlab.com/hacker")
|
||||
end
|
||||
|
||||
context 'when the fancy_pipeline_slack_notifications feature flag is disabled' do
|
||||
before do
|
||||
stub_feature_flags(fancy_pipeline_slack_notifications: false)
|
||||
end
|
||||
|
||||
it 'returns an empty pretext' do
|
||||
expect(subject.pretext).to be_empty
|
||||
end
|
||||
|
||||
it "returns the pipeline summary in the activity's title" do
|
||||
expect(subject.activity[:title]).to eq(
|
||||
"Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of branch [develop](http://example.gitlab.com/commits/develop)" \
|
||||
" by The Hacker (hacker) passed"
|
||||
)
|
||||
end
|
||||
|
||||
context "when the pipeline failed" do
|
||||
before do
|
||||
args[:object_attributes][:status] = 'failed'
|
||||
end
|
||||
|
||||
it "returns the summary with a 'failed' status" do
|
||||
expect(subject.activity[:title]).to eq(
|
||||
"Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of branch [develop](http://example.gitlab.com/commits/develop)" \
|
||||
" by The Hacker (hacker) failed"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when no user is provided because the pipeline was triggered by the API' do
|
||||
before do
|
||||
args[:user] = nil
|
||||
end
|
||||
|
||||
it "returns the summary with 'API' as the username" do
|
||||
expect(subject.activity[:title]).to eq(
|
||||
"Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of branch [develop](http://example.gitlab.com/commits/develop)" \
|
||||
" by API passed"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it "returns a link to the project in the activity's subtitle" do
|
||||
expect(subject.activity[:subtitle]).to eq("in [project_name](http://example.gitlab.com)")
|
||||
end
|
||||
|
||||
it "returns the build duration in the activity's text property" do
|
||||
expect(subject.activity[:text]).to eq("in 02:00:10")
|
||||
end
|
||||
|
||||
it "returns the user's avatar image URL in the activity's image property" do
|
||||
expect(subject.activity[:image]).to eq("http://example.com/avatar")
|
||||
end
|
||||
|
||||
context 'when the user does not have an avatar' do
|
||||
before do
|
||||
args[:user][:avatar_url] = nil
|
||||
end
|
||||
|
||||
it "returns an empty string in the activity's image property" do
|
||||
expect(subject.activity[:image]).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
it "returns the pipeline summary as the attachment's text property" do
|
||||
expect(subject.attachments.first[:text]).to eq(
|
||||
"<http://example.gitlab.com|project_name>:" \
|
||||
" Pipeline <http://example.gitlab.com/pipelines/123|#123>" \
|
||||
" of branch <http://example.gitlab.com/commits/develop|develop>" \
|
||||
" by The Hacker (hacker) passed in 02:00:10"
|
||||
)
|
||||
end
|
||||
|
||||
it "returns 'good' as the attachment's color property" do
|
||||
expect(subject.attachments.first[:color]).to eq('good')
|
||||
end
|
||||
|
||||
context "when the pipeline failed" do
|
||||
before do
|
||||
args[:object_attributes][:status] = 'failed'
|
||||
end
|
||||
|
||||
it "returns 'danger' as the attachment's color property" do
|
||||
expect(subject.attachments.first[:color]).to eq('danger')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when rendering markdown' do
|
||||
before do
|
||||
args[:markdown] = true
|
||||
end
|
||||
|
||||
it 'returns the pipeline summary as the attachments in markdown format' do
|
||||
expect(subject.attachments).to eq(
|
||||
"[project_name](http://example.gitlab.com):" \
|
||||
" Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of branch [develop](http://example.gitlab.com/commits/develop)" \
|
||||
" by The Hacker (hacker) passed in 02:00:10"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when ref type is tag' do
|
||||
before do
|
||||
args[:object_attributes][:tag] = true
|
||||
args[:object_attributes][:ref] = 'new_tag'
|
||||
end
|
||||
|
||||
it "returns the pipeline summary in the activity's title" do
|
||||
expect(subject.activity[:title]).to eq(
|
||||
"Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of tag [new_tag](http://example.gitlab.com/-/tags/new_tag)" \
|
||||
" by The Hacker (hacker) passed"
|
||||
)
|
||||
end
|
||||
|
||||
it "returns the pipeline summary as the attachment's text property" do
|
||||
expect(subject.attachments.first[:text]).to eq(
|
||||
"<http://example.gitlab.com|project_name>:" \
|
||||
" Pipeline <http://example.gitlab.com/pipelines/123|#123>" \
|
||||
" of tag <http://example.gitlab.com/-/tags/new_tag|new_tag>" \
|
||||
" by The Hacker (hacker) passed in 02:00:10"
|
||||
)
|
||||
end
|
||||
|
||||
context 'when rendering markdown' do
|
||||
before do
|
||||
args[:markdown] = true
|
||||
end
|
||||
|
||||
it 'returns the pipeline summary as the attachments in markdown format' do
|
||||
expect(subject.attachments).to eq(
|
||||
"[project_name](http://example.gitlab.com):" \
|
||||
" Pipeline [#123](http://example.gitlab.com/pipelines/123)" \
|
||||
" of tag [new_tag](http://example.gitlab.com/-/tags/new_tag)" \
|
||||
" by The Hacker (hacker) passed in 02:00:10"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the fancy_pipeline_slack_notifications feature flag is enabled' do
|
||||
before do
|
||||
stub_feature_flags(fancy_pipeline_slack_notifications: true)
|
||||
end
|
||||
|
||||
it 'returns an empty pretext' do
|
||||
expect(subject.pretext).to be_empty
|
||||
end
|
||||
|
@ -526,4 +376,3 @@ describe ChatMessage::PipelineMessage do
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue