---
title: Fix Web IDE fork modal showing no text
merge_request: 25842
author:
type: fixed
---
title: Fix Group Import API file upload when object storage is disabled
merge_request: 25715
author:
type: fixed
---
title: Fix search for Sentry error list
merge_request: 26129
author:
type: fixed
---
title: Fixed repository browsing for folders with non-ascii characters
merge_request: 25877
author:
type: fixed
---
title: Show CI status in project dashboards
merge_request: 26403
author:
type: fixed
---
title: Disable Marginalia line backtrace in production
merge_request: 26199
author:
type: performance
---
title: Remove unnecessary Redis deletes for broadcast messages
merge_request: 26541
author:
type: performance
---
title: Rescue invalid URLs during badge retrieval in asset proxy
merge_request: 26524
author:
type: fixed
---
title: Send credentials with GraphQL fetch requests
merge_request: 26386
author:
type: fixed
...@@ -9,7 +9,13 @@ require 'marginalia' ...@@ -9,7 +9,13 @@ require 'marginalia'
# Refer: https://github.com/basecamp/marginalia/blob/v1.8.0/lib/marginalia/railtie.rb#L67 # Refer: https://github.com/basecamp/marginalia/blob/v1.8.0/lib/marginalia/railtie.rb#L67
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Marginalia::ActiveRecordInstrumentation) ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(Gitlab::Marginalia::ActiveRecordInstrumentation)
Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class, :line] Marginalia::Comment.components = [:application, :controller, :action, :correlation_id, :jid, :job_class]
# As mentioned in https://github.com/basecamp/marginalia/pull/93/files,
# adding :line has some overhead because a regexp on the backtrace has
# to be run on every SQL query. Only enable this in development because
# we've seen it slow things down.
Marginalia::Comment.components << :line if Rails.env.development?
Gitlab::Marginalia.set_application_name Gitlab::Marginalia.set_application_name
... ...
......
...@@ -65,6 +65,11 @@ alert is resolved. ...@@ -65,6 +65,11 @@ alert is resolved.
Metrics can be embedded anywhere where GitLab Markdown is used, for example, Metrics can be embedded anywhere where GitLab Markdown is used, for example,
descriptions and comments on issues and merge requests. descriptions and comments on issues and merge requests.
This can be useful for when you're sharing metrics, such as for discussing
an incident or performance issues, so you can output the dashboard directly
into any issue, merge request, epic, or any other Markdown text field in GitLab
by simply [copying and pasting the link to the metrics dashboard](../project/integrations/prometheus.md#embedding-gitlab-managed-kubernetes-metrics).
TIP: **Tip:** TIP: **Tip:**
Both GitLab-hosted and Grafana metrics can also be Both GitLab-hosted and Grafana metrics can also be
[embedded in issue templates](../project/integrations/prometheus.md#embedding-metrics-in-issue-templates). [embedded in issue templates](../project/integrations/prometheus.md#embedding-metrics-in-issue-templates).
...@@ -73,6 +78,32 @@ Both GitLab-hosted and Grafana metrics can also be ...@@ -73,6 +78,32 @@ Both GitLab-hosted and Grafana metrics can also be
Learn how to embed [GitLab hosted metric charts](../project/integrations/prometheus.md#embedding-metric-charts-within-gitlab-flavored-markdown). Learn how to embed [GitLab hosted metric charts](../project/integrations/prometheus.md#embedding-metric-charts-within-gitlab-flavored-markdown).
#### Context menu
From each of the embedded metrics panels, you can access more details
about the data you are viewing from a context menu.
You can access the context menu by clicking the **{ellipsis_v}** **More actions**
dropdown box above the upper right corner of the panel:
The options are:
- [View logs](#view-logs-ultimate) **(ULTIMATE)**
- [Download CSV](#download-csv)
##### View logs **(ULTIMATE)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/201846) in GitLab Ultimate 12.8.
This can be useful if you are triaging an application incident and need to
[explore logs](../project/integrations/prometheus.md#view-pod-logs-ultimate)
from across your application. It also helps you to understand
what is affecting your application's performance and quickly resolve any problems.
##### Download CSV
Data from embedded charts can be [downloaded as CSV](../project/integrations/prometheus.md#downloading-data-as-csv).
### Grafana metrics ### Grafana metrics
Learn how to embed [Grafana hosted metric charts](../project/integrations/prometheus.md#embedding-grafana-charts). Learn how to embed [Grafana hosted metric charts](../project/integrations/prometheus.md#embedding-grafana-charts).
... ...
......
doc/user/project/integrations/img/embedded_metrics_markdown_v12_8.png

13.5 KiB

doc/user/project/integrations/img/embedded_metrics_rendered_v12_8.png

64.5 KiB

...@@ -492,7 +492,9 @@ The options are: ...@@ -492,7 +492,9 @@ The options are:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/122013) in GitLab 12.8. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/122013) in GitLab 12.8.
If you have [Kubernetes Pod Logs](../clusters/kubernetes_pod_logs.md) enabled, you can navigate from the charts in the dashboard to view Pod Logs by clicking on the context menu in the upper-right corner. If you have [Pod Logs](../clusters/kubernetes_pod_logs.md) enabled,
you can navigate from the charts in the dashboard to view Pod Logs by
clicking on the context menu in the upper-right corner.
If you use the **Timeline zoom** function at the bottom of the chart, logs will narrow down to the time range you selected. If you use the **Timeline zoom** function at the bottom of the chart, logs will narrow down to the time range you selected.
...@@ -608,10 +610,19 @@ Prometheus server. ...@@ -608,10 +610,19 @@ Prometheus server.
It is possible to display metrics charts within [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown-gfm). The maximum number of embeds allowed in a GitLab Flavored Markdown field is 100. It is possible to display metrics charts within [GitLab Flavored Markdown](../../markdown.md#gitlab-flavored-markdown-gfm). The maximum number of embeds allowed in a GitLab Flavored Markdown field is 100.
This can be useful if you are sharing an application incident or performance
metrics to others and want to have relevant information directly available.
NOTE: **Note:** NOTE: **Note:**
Requires [Kubernetes](prometheus_library/kubernetes.md) metrics. Requires [Kubernetes](prometheus_library/kubernetes.md) metrics.
To display a metric chart, include a link of the form `https://<root_url>/<project>/-/environments/<environment_id>/metrics`. To display metric charts, include a link of the form `https://<root_url>/<project>/-/environments/<environment_id>/metrics`:
![Embedded Metrics Markdown](img/embedded_metrics_markdown_v12_8.png)
GitLab unfurls the link as an embedded metrics panel:
![Embedded Metrics Rendered](img/embedded_metrics_rendered_v12_8.png)
A single chart may also be embedded. You can generate a link to the chart via the dropdown located on the right side of the chart: A single chart may also be embedded. You can generate a link to the chart via the dropdown located on the right side of the chart:
... ...
......
...@@ -11,12 +11,14 @@ module Gitlab ...@@ -11,12 +11,14 @@ module Gitlab
return url if asset_host_whitelisted?(url) return url if asset_host_whitelisted?(url)
"#{Gitlab.config.asset_proxy.url}/#{asset_url_hash(url)}/#{hexencode(url)}" "#{Gitlab.config.asset_proxy.url}/#{asset_url_hash(url)}/#{hexencode(url)}"
rescue Addressable::URI::InvalidURIError
url
end end
private private
def asset_host_whitelisted?(url) def asset_host_whitelisted?(url)
parsed_url = URI.parse(url) parsed_url = Addressable::URI.parse(url)
Gitlab.config.asset_proxy.domain_regexp&.match?(parsed_url.host) Gitlab.config.asset_proxy.domain_regexp&.match?(parsed_url.host)
end end
... ...
......
...@@ -70,7 +70,7 @@ module Gitlab ...@@ -70,7 +70,7 @@ module Gitlab
# Lookup for rugged object by oid or ref name # Lookup for rugged object by oid or ref name
def lookup(oid_or_ref_name) def lookup(oid_or_ref_name)
rugged.rev_parse(oid_or_ref_name) rev_parse_target(oid_or_ref_name)
end end
end end
end end
... ...
......
...@@ -69,7 +69,7 @@ module Gitlab ...@@ -69,7 +69,7 @@ module Gitlab
end end
def entry_path(entry) def entry_path(entry)
File.join(*[path, entry[:file_name]].compact) File.join(*[path, entry[:file_name]].compact).force_encoding(Encoding::ASCII_8BIT)
end end
def build_entry(entry) def build_entry(entry)
... ...
......
...@@ -152,6 +152,61 @@ describe 'Dashboard Projects' do ...@@ -152,6 +152,61 @@ describe 'Dashboard Projects' do
end end
end end
describe 'with a pipeline', :clean_gitlab_redis_shared_state do
let(:pipeline) { create(:ci_pipeline, project: project, sha: project.commit.sha, ref: project.default_branch) }
before do
# Since the cache isn't updated when a new pipeline is created
# we need the pipeline to advance in the pipeline since the cache was created
# by visiting the login page.
pipeline.succeed
end
it 'shows that the last pipeline passed' do
visit dashboard_projects_path
page.within('.controls') do
expect(page).to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']")
expect(page).to have_css('.ci-status-link')
expect(page).to have_css('.ci-status-icon-success')
expect(page).to have_link('Pipeline: passed')
end
end
shared_examples 'hidden pipeline status' do
it 'does not show the pipeline status' do
visit dashboard_projects_path
page.within('.controls') do
expect(page).not_to have_xpath("//a[@href='#{pipelines_project_commit_path(project, project.commit, ref: pipeline.ref)}']")
expect(page).not_to have_css('.ci-status-link')
expect(page).not_to have_css('.ci-status-icon-success')
expect(page).not_to have_link('Pipeline: passed')
end
end
end
context 'guest user of project and project has private pipelines' do
let(:guest_user) { create(:user) }
before do
project.update(public_builds: false)
project.add_guest(guest_user)
sign_in(guest_user)
end
it_behaves_like 'hidden pipeline status'
end
context 'when dashboard_pipeline_status is disabled' do
before do
stub_feature_flags(dashboard_pipeline_status: false)
end
it_behaves_like 'hidden pipeline status'
end
end
context 'last push widget', :use_clean_rails_memory_store_caching do context 'last push widget', :use_clean_rails_memory_store_caching do
before do before do
event = create(:push_event, project: project, author: user) event = create(:push_event, project: project, author: user)
... ...
......
# frozen_string_literal: true
require 'spec_helper'
describe 'When a user searches for Sentry errors', :js, :use_clean_rails_memory_store_caching, :sidekiq_inline do
include_context 'sentry error tracking context feature'
let_it_be(:issues_response_body) { fixture_file('sentry/issues_sample_response.json') }
let_it_be(:error_search_response_body) { fixture_file('sentry/error_list_search_response.json') }
let(:issues_api_url) { "#{sentry_api_urls.issues_url}?limit=20&query=is:unresolved" }
let(:issues_api_url_search) { "#{sentry_api_urls.issues_url}?limit=20&query=is:unresolved%20NotFound" }
before do
stub_request(:get, issues_api_url).with(
headers: { 'Authorization' => 'Bearer access_token_123' }
).to_return(status: 200, body: issues_response_body, headers: { 'Content-Type' => 'application/json' })
stub_request(:get, issues_api_url_search).with(
headers: { 'Authorization' => 'Bearer access_token_123', 'Content-Type' => 'application/json' }
).to_return(status: 200, body: error_search_response_body, headers: { 'Content-Type' => 'application/json' })
end
it 'displays the results' do
sign_in(project.owner)
visit project_error_tracking_index_path(project)
page.within(find('.gl-table')) do
results = page.all('.table-row')
expect(results.count).to be(2)
end
find('.gl-form-input').set('NotFound').native.send_keys(:return)
page.within(find('.gl-table')) do
results = page.all('.table-row')
expect(results.count).to be(1)
expect(results.first).to have_content('NotFound')
end
end
end
...@@ -37,6 +37,16 @@ describe 'Projects tree', :js do ...@@ -37,6 +37,16 @@ describe 'Projects tree', :js do
expect(page).not_to have_selector('.flash-alert') expect(page).not_to have_selector('.flash-alert')
end end
it 'renders tree table with non-ASCII filenames without errors' do
visit project_tree_path(project, File.join(test_sha, 'encoding'))
wait_for_requests
expect(page).to have_selector('.tree-item')
expect(page).to have_content('Files, encoding and much more')
expect(page).to have_content('テスト.txt')
expect(page).not_to have_selector('.flash-alert')
end
context 'gravatar disabled' do context 'gravatar disabled' do
let(:gravatar_enabled) { false } let(:gravatar_enabled) { false }
... ...
......