提交 ccaa9448 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 d65442b1
......@@ -126,6 +126,10 @@ module ErrorTracking
end
end
def expire_issues_cache
Rails.cache.delete_matched(expand_cache_key('list_issues'))
end
# http://HOST/api/0/projects/ORG/PROJECT
# ->
# http://HOST/ORG/PROJECT
......@@ -142,6 +146,12 @@ module ErrorTracking
private
def expand_cache_key(resource_prefix)
klass_key = self.class.reactive_cache_key.call(self).join(':')
"#{klass_key}:#{resource_prefix}*"
end
def add_gitlab_issue_details(issue)
issue.gitlab_commit = match_gitlab_commit(issue.first_release_version)
issue.gitlab_commit_path = project_commit_path(project, issue.gitlab_commit) if issue.gitlab_commit
......
......@@ -2,6 +2,8 @@
module ErrorTracking
class IssueUpdateService < ErrorTracking::BaseService
include ::Gitlab::Utils::StrongMemoize
private
def perform
......@@ -9,6 +11,7 @@ module ErrorTracking
unless parse_errors(response).present?
response[:closed_issue_iid] = update_related_issue&.iid
project_error_tracking_setting.expire_issues_cache
end
response
......@@ -22,10 +25,9 @@ module ErrorTracking
end
def update_related_issue
issue = related_issue
return unless issue
return if related_issue.nil?
close_and_create_note(issue)
close_and_create_note(related_issue)
end
def close_and_create_note(issue)
......@@ -49,10 +51,12 @@ module ErrorTracking
end
def related_issue
SentryIssueFinder
.new(project, current_user: current_user)
.execute(params[:issue_id])
&.issue
strong_memoize(:related_issue) do
SentryIssueFinder
.new(project, current_user: current_user)
.execute(params[:issue_id])
&.issue
end
end
def resolving?
......
---
title: Allow users to sign out on a read-only instance
merge_request: 23545
author:
type: fixed
......@@ -403,13 +403,13 @@ If you need to manually remove ALL job artifacts associated with multiple jobs,
```ruby
project = Project.find_by_full_path('path/to/project')
builds_with_artifacts = project.builds.with_existing_job_artifacts
builds_with_artifacts = project.builds.with_existing_job_artifacts(Ci::JobArtifact.trace)
```
To select jobs with artifacts across the entire GitLab instance:
```ruby
builds_with_artifacts = Ci::Build.with_existing_job_artifacts
builds_with_artifacts = Ci::Build.with_existing_job_artifacts(Ci::JobArtifact.trace)
```
1. Select the user which will be mentioned in the web UI as erasing the job:
......
......@@ -895,6 +895,42 @@ loop do
end
```
## Registry
### Registry Disk Space Usage by Project
As a GitLab administrator, you may need to reduce disk space consumption.
A common culprit is Docker Registry images that are no longer in use. To find
the storage broken down by each project, run the following in the
GitLab Rails console:
```ruby
projects_and_size = []
# a list of projects you want to look at, can get these however
projects = Project.last(100)
projects.each do |p|
project_total_size = 0
container_repositories = p.container_repositories
container_repositories.each do |c|
c.tags.each do |t|
project_total_size = project_total_size + t.total_size
end
end
if project_total_size > 0
projects_and_size << [p.full_path,project_total_size]
end
end
# projects_and_size is filled out now
# maybe print it as comma separated output?
projects_and_size.each do |ps|
puts "%s,%s" % ps
end
```
## Sidekiq
### Size of a queue
......
......@@ -300,6 +300,15 @@ You can filter by [custom attributes](custom_attributes.md) with:
GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value
```
### Pagination limits
From GitLab 12.10, [offset-based pagination](README.md#offset-based-pagination) will be
[limited to 10,000 records](https://gitlab.com/gitlab-org/gitlab/issues/34565).
[Keyset pagination](README.md#keyset-based-pagination) will be required to retrieve projects
beyond this limit.
Note that keyset pagination only supports `order_by=id`. Other sorting options are not available.
## List user projects
Get a list of visible projects owned by the given user. When accessed without authentication, only public projects are returned.
......
......@@ -5,7 +5,7 @@ type: reference
# Getting started with GitLab CI/CD
NOTE: **Note:**
Starting from version 8.0, GitLab [Continuous Integration][ci] (CI)
Starting from version 8.0, GitLab [Continuous Integration](https://about.gitlab.com/product/continuous-integration/) (CI)
is fully integrated into GitLab itself and is [enabled] by default on all
projects.
......
......@@ -766,6 +766,7 @@ nicely on different mobile devices.
- To display raw Markdown instead of rendered Markdown, you can use triple backticks
with `md`, like the `Markdown code` example above, unless you want to include triple
backticks in the code block as well. In that case, use triple tildes (`~~~`) instead.
- [Syntax highlighting for code blocks](https://github.com/rouge-ruby/rouge/wiki/List-of-supported-languages-and-lexers) is available for many languages.
- For a complete reference on code blocks, check the [Kramdown guide](https://about.gitlab.com/handbook/product/technical-writing/markdown-guide/#code-blocks).
## Alert boxes
......
......@@ -547,10 +547,9 @@ GitLab will sign the request with the provided private key. GitLab will include
### GitLab+SAML Testing Environments
If you need to troubleshoot, below is a complete GitLab+SAML testing environment using docker compose:
https://gitlab.com/gitlab-com/support/toolbox/replication/tree/master/compose_files
If you need to troubleshoot, [a complete GitLab+SAML testing environment using Docker compose](https://gitlab.com/gitlab-com/support/toolbox/replication/tree/master/compose_files) is available.
If you only need a SAML provider for testing, below is quick start guide to start a Docker container with a plug and play SAML 2.0 Identity Provider (IdP): https://docs.gitlab.com/ee/administration/troubleshooting/test_environments.html#saml
If you only need a SAML provider for testing, a [quick start guide to start a Docker container](../administration/troubleshooting/test_environments.html#saml) with a plug and play SAML 2.0 Identity Provider (IdP) is available.
### 500 error after login
......
......@@ -118,10 +118,13 @@ To remove a child epic from a parent epic:
To set a **Start date** and **Due date** for an epic, select one of the following:
- **Fixed**: Enter a fixed value.
- **From milestones**: Inherit a dynamic value from the issues added to the epic.
- **Inherited**: Inherit a dynamic value from the issues added to the epic. ([Introduced](https://gitlab.com/gitlab-org/gitlab/issues/7332) in GitLab 12.5 to replace **From milestones**).
- **From milestones**: Inherit a dynamic value from the milestones currently assigned to the epic's issues.
Note that GitLab 12.5 replaced this option with **Inherited**.
- **Inherited**: Inherit a dynamic value from the epic's issues, child epics, and milestones ([Introduced](https://gitlab.com/gitlab-org/gitlab/issues/7332) in GitLab 12.5 to replace **From milestones**).
### Milestones
### From milestones
> [Replaced](https://gitlab.com/gitlab-org/gitlab/issues/7332) in GitLab 12.5 by **Inherited**.
If you select **From milestones** for the start date, GitLab will automatically set the date to be earliest
start date across all milestones that are currently assigned to the issues that are added to the epic.
......@@ -136,6 +139,8 @@ These are dynamic dates which are recalculated if any of the following occur:
### Inherited
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/7332) in GitLab 12.5 to replace **From milestones**.
If you select **Inherited** for the start date, GitLab will scan all child epics and issues assigned to the epic,
and will set the start date to match the earliest found start date or milestone. Similarly, if you select
**Inherited** for the due date, GitLab will set the due date to match the latest due date or milestone
......
......@@ -24,6 +24,10 @@ module Gitlab
'projects/compare' => %w{create}
}.freeze
WHITELISTED_LOGOUT_ROUTES = {
'sessions' => %w{destroy}
}.freeze
GRAPHQL_URL = '/api/graphql'
def initialize(app, env)
......@@ -85,7 +89,7 @@ module Gitlab
# Overridden in EE module
def whitelisted_routes
grack_route? || internal_route? || lfs_route? || compare_git_revisions_route? || sidekiq_route? || graphql_query?
grack_route? || internal_route? || lfs_route? || compare_git_revisions_route? || sidekiq_route? || logout_route? || graphql_query?
end
def grack_route?
......@@ -118,6 +122,13 @@ module Gitlab
WHITELISTED_GIT_LFS_ROUTES[route_hash[:controller]]&.include?(route_hash[:action])
end
def logout_route?
# Calling route_hash may be expensive. Only do it if we think there's a possible match
return false unless request.post? && request.path.end_with?('/users/sign_out')
WHITELISTED_LOGOUT_ROUTES[route_hash[:controller]]&.include?(route_hash[:action])
end
def sidekiq_route?
request.path.start_with?("#{relative_url}/admin/sidekiq")
end
......
......@@ -21,4 +21,16 @@ describe 'Logout/Sign out', :js do
expect(page).not_to have_selector('.flash-notice')
end
context 'on a read-only instance' do
before do
allow(Gitlab::Database).to receive(:read_only?).and_return(true)
end
it 'sign out redirects to sign in page' do
gitlab_sign_out
expect(current_path).to eq new_user_session_path
end
end
end
......@@ -440,4 +440,18 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
end
end
end
describe '#expire_issues_cache', :use_clean_rails_memory_store_caching do
it 'clears the cache' do
klass_key = subject.class.reactive_cache_key.call(subject).join(':')
key = "#{klass_key}:list_issues:some_suffix"
Rails.cache.write(key, 1)
expect(Rails.cache.exist?(key)).to eq(true)
subject.expire_issues_cache
expect(Rails.cache.exist?(key)).to eq(false)
end
end
end
......@@ -40,6 +40,16 @@ describe ErrorTracking::IssueUpdateService do
result
end
it 'clears the reactive cache' do
allow(error_tracking_setting)
.to receive(:expire_issues_cache)
result
expect(error_tracking_setting)
.to have_received(:expire_issues_cache)
end
context 'related issue and resolving' do
let(:issue) { create(:issue, project: project) }
let(:sentry_issue) { create(:sentry_issue, issue: issue) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册