Skip to content
Snippets Groups Projects
Commit d466ee50 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 6a9d7c00
No related branches found
No related tags found
No related merge requests found
Showing
with 157 additions and 261 deletions
---
title: Fix Web IDE alert message look and feel
merge_request: 23300
author: Sean Nichols
type: fixed
---
title: Avoid double encoding of credential while importing a Project by URL
merge_request: 24514
author:
type: fixed
---
title: Fix autocomplete limitation bug
merge_request: 25127
author:
type: fixed
---
title: Separate access entities into own class files
merge_request: 24845
author: Rajendra Kadam
type: added
---
title: Separate environment entities into own class files
merge_request: 24951
author: Rajendra Kadam
type: added
---
title: Separate JobRequest entities into own class files
merge_request: 24977
author: Rajendra Kadam
type: added
---
title: Separate page domain entities into own class files
merge_request: 24987
author: Rajendra Kadam
type: added
---
title: Separate badge entities into own class files
merge_request: 25116
author: Rajendra Kadam
type: added
---
title: Separate cluster entities into own class files
merge_request: 25121
author: Rajendra Kadam
type: added
---
title: Replace underscore with lodash for ./app/assets/javascripts/serverless
merge_request: 25011
author: Tobias Spagert
type: other
# frozen_string_literal: true
class ScheduleRecalculateProjectAuthorizations < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
MIGRATION = 'RecalculateProjectAuthorizations'
BATCH_SIZE = 2_500
DELAY_INTERVAL = 2.minutes.to_i
disable_ddl_transaction!
class Namespace < ActiveRecord::Base
include ::EachBatch
self.table_name = 'namespaces'
end
class ProjectAuthorization < ActiveRecord::Base
include ::EachBatch
self.table_name = 'project_authorizations'
end
def up
say "Scheduling #{MIGRATION} jobs"
max_group_id = Namespace.where(type: 'Group').maximum(:id)
project_authorizations = ProjectAuthorization.where('project_id <= ?', max_group_id)
.select(:user_id)
.distinct
project_authorizations.each_batch(of: BATCH_SIZE, column: :user_id) do |authorizations, index|
delay = index * DELAY_INTERVAL
user_ids = authorizations.map(&:user_id)
BackgroundMigrationWorker.perform_in(delay, MIGRATION, [user_ids])
end
end
def down
end
end
Loading
Loading
@@ -18,6 +18,7 @@ GET /projects/:id/repository/commits
| `all` | boolean | no | Retrieve every commit from the repository |
| `with_stats` | boolean | no | Stats about each commit will be added to the response |
| `first_parent` | boolean | no | Follow only the first parent commit upon seeing a merge commit |
| `order` | string | no | List commits in order. Possible value: [`topo`](https://git-scm.com/docs/git-log#Documentation/git-log.txt---topo-order). |
 
```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits"
Loading
Loading
Loading
Loading
@@ -84,5 +84,6 @@ Ignoring an error will prevent it from appearing in the [Error Tracking List](#e
From within the [Error Details](#error-details) page you can resolve a Sentry error by
clicking the **Resolve** button near the top of the page.
 
Marking an error as resolved indicates that the error has stopped firing events. If another event
occurs, the error reverts to unresolved.
Marking an error as resolved indicates that the error has stopped firing events. If a GitLab issue is linked to the error, then the issue will be closed.
If another event occurs, the error reverts to unresolved.
Loading
Loading
@@ -38,6 +38,7 @@ module API
optional :all, type: Boolean, desc: 'Every commit will be returned'
optional :with_stats, type: Boolean, desc: 'Stats about each commit will be added to the response'
optional :first_parent, type: Boolean, desc: 'Only include the first parent of merges'
optional :order, type: String, desc: 'List commits in order', values: %w[topo]
use :pagination
end
get ':id/repository/commits' do
Loading
Loading
@@ -49,6 +50,7 @@ module API
all = params[:all]
with_stats = params[:with_stats]
first_parent = params[:first_parent]
order = params[:order]
 
commits = user_project.repository.commits(ref,
path: path,
Loading
Loading
@@ -57,7 +59,8 @@ module API
before: before,
after: after,
all: all,
first_parent: first_parent)
first_parent: first_parent,
order: order)
 
commit_count =
if all || path || before || after || first_parent
Loading
Loading
Loading
Loading
@@ -129,40 +129,6 @@ module API
end
end
 
class Namespace < NamespaceBasic
expose :members_count_with_descendants, if: -> (namespace, opts) { expose_members_count_with_descendants?(namespace, opts) } do |namespace, _|
namespace.users_with_descendants.count
end
def expose_members_count_with_descendants?(namespace, opts)
namespace.kind == 'group' && Ability.allowed?(opts[:current_user], :admin_group, namespace)
end
end
class MemberAccess < Grape::Entity
expose :access_level
expose :notification_level do |member, options|
if member.notification_setting
::NotificationSetting.levels[member.notification_setting.level]
end
end
end
class ProjectAccess < MemberAccess
end
class GroupAccess < MemberAccess
end
class NotificationSetting < Grape::Entity
expose :level
expose :events, if: ->(notification_setting, _) { notification_setting.custom? } do
::NotificationSetting.email_events.each do |event|
expose event
end
end
end
class Trigger < Grape::Entity
include ::API::Helpers::Presentable
 
Loading
Loading
@@ -204,39 +170,6 @@ module API
expose :variables, using: Entities::Variable
end
 
class EnvironmentBasic < Grape::Entity
expose :id, :name, :slug, :external_url
end
class Deployment < Grape::Entity
expose :id, :iid, :ref, :sha, :created_at, :updated_at
expose :user, using: Entities::UserBasic
expose :environment, using: Entities::EnvironmentBasic
expose :deployable, using: Entities::Job
expose :status
end
class Environment < EnvironmentBasic
expose :project, using: Entities::BasicProjectDetails
expose :last_deployment, using: Entities::Deployment, if: { last_deployment: true }
expose :state
end
class LicenseBasic < Grape::Entity
expose :key, :name, :nickname
expose :url, as: :html_url
expose(:source_url) { |license| license.meta['source'] }
end
class License < LicenseBasic
expose :popular?, as: :popular
expose(:description) { |license| license.meta['description'] }
expose(:conditions) { |license| license.meta['conditions'] }
expose(:permissions) { |license| license.meta['permissions'] }
expose(:limitations) { |license| license.meta['limitations'] }
expose :content
end
class ImpersonationToken < PersonalAccessToken
expose :impersonation
end
Loading
Loading
@@ -267,93 +200,6 @@ module API
end
end
 
module JobRequest
class JobInfo < Grape::Entity
expose :name, :stage
expose :project_id, :project_name
end
class GitInfo < Grape::Entity
expose :repo_url, :ref, :sha, :before_sha
expose :ref_type
expose :refspecs
expose :git_depth, as: :depth
end
class RunnerInfo < Grape::Entity
expose :metadata_timeout, as: :timeout
expose :runner_session_url
end
class Step < Grape::Entity
expose :name, :script, :timeout, :when, :allow_failure
end
class Port < Grape::Entity
expose :number, :protocol, :name
end
class Image < Grape::Entity
expose :name, :entrypoint
expose :ports, using: JobRequest::Port
end
class Service < Image
expose :alias, :command
end
class Artifacts < Grape::Entity
expose :name
expose :untracked
expose :paths
expose :when
expose :expire_in
expose :artifact_type
expose :artifact_format
end
class Cache < Grape::Entity
expose :key, :untracked, :paths, :policy
end
class Credentials < Grape::Entity
expose :type, :url, :username, :password
end
class Dependency < Grape::Entity
expose :id, :name, :token
expose :artifacts_file, using: JobArtifactFile, if: ->(job, _) { job.artifacts? }
end
class Response < Grape::Entity
expose :id
expose :token
expose :allow_git_fetch
expose :job_info, using: JobInfo do |model|
model
end
expose :git_info, using: GitInfo do |model|
model
end
expose :runner_info, using: RunnerInfo do |model|
model
end
expose :variables
expose :steps, using: Step
expose :image, using: Image
expose :services, using: Service
expose :artifacts, using: Artifacts
expose :cache, using: Cache
expose :credentials, using: Credentials
expose :all_dependencies, as: :dependencies, using: Dependency
expose :features
end
end
class UserAgentDetail < Grape::Entity
expose :user_agent
expose :ip_address
Loading
Loading
@@ -370,45 +216,6 @@ module API
expose :expiration
end
 
class PagesDomainCertificate < Grape::Entity
expose :subject
expose :expired?, as: :expired
expose :certificate
expose :certificate_text
end
class PagesDomainBasic < Grape::Entity
expose :domain
expose :url
expose :project_id
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
as: :certificate_expiration,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: PagesDomainCertificateExpiration do |pages_domain|
pages_domain
end
end
class PagesDomain < Grape::Entity
expose :domain
expose :url
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: PagesDomainCertificate do |pages_domain|
pages_domain
end
end
class Application < Grape::Entity
expose :id
expose :uid, as: :application_id
Loading
Loading
@@ -437,49 +244,6 @@ module API
expose :project_id
end
 
class BasicBadgeDetails < Grape::Entity
expose :name
expose :link_url
expose :image_url
expose :rendered_link_url do |badge, options|
badge.rendered_link_url(options.fetch(:project, nil))
end
expose :rendered_image_url do |badge, options|
badge.rendered_image_url(options.fetch(:project, nil))
end
end
class Badge < BasicBadgeDetails
expose :id
expose :kind do |badge|
badge.type == 'ProjectBadge' ? 'project' : 'group'
end
end
class ResourceLabelEvent < Grape::Entity
expose :id
expose :user, using: Entities::UserBasic
expose :created_at
expose :resource_type do |event, options|
event.issuable.class.name
end
expose :resource_id do |event, options|
event.issuable.id
end
expose :label, using: Entities::LabelBasic
expose :action
end
class Suggestion < Grape::Entity
expose :id
expose :from_line
expose :to_line
expose :appliable?, as: :appliable
expose :applied
expose :from_content
expose :to_content
end
module Platform
class Kubernetes < Grape::Entity
expose :api_url
Loading
Loading
@@ -501,23 +265,6 @@ module API
end
end
 
class Cluster < Grape::Entity
expose :id, :name, :created_at, :domain
expose :provider_type, :platform_type, :environment_scope, :cluster_type
expose :user, using: Entities::UserBasic
expose :platform_kubernetes, using: Entities::Platform::Kubernetes
expose :provider_gcp, using: Entities::Provider::Gcp
expose :management_project, using: Entities::ProjectIdentity
end
class ClusterProject < Cluster
expose :project, using: Entities::BasicProjectDetails
end
class ClusterGroup < Cluster
expose :group, using: Entities::BasicGroupDetails
end
module InternalPostReceive
class Message < Grape::Entity
expose :message
Loading
Loading
# frozen_string_literal: true
module API
module Entities
class Badge < Entities::BasicBadgeDetails
expose :id
expose :kind do |badge|
badge.type == 'ProjectBadge' ? 'project' : 'group'
end
end
end
end
# frozen_string_literal: true
module API
module Entities
class BasicBadgeDetails < Grape::Entity
expose :name
expose :link_url
expose :image_url
expose :rendered_link_url do |badge, options|
badge.rendered_link_url(options.fetch(:project, nil))
end
expose :rendered_image_url do |badge, options|
badge.rendered_image_url(options.fetch(:project, nil))
end
end
end
end
# frozen_string_literal: true
module API
module Entities
class Cluster < Grape::Entity
expose :id, :name, :created_at, :domain
expose :provider_type, :platform_type, :environment_scope, :cluster_type
expose :user, using: Entities::UserBasic
expose :platform_kubernetes, using: Entities::Platform::Kubernetes
expose :provider_gcp, using: Entities::Provider::Gcp
expose :management_project, using: Entities::ProjectIdentity
end
end
end
# frozen_string_literal: true
module API
module Entities
class ClusterGroup < Entities::Cluster
expose :group, using: Entities::BasicGroupDetails
end
end
end
# frozen_string_literal: true
module API
module Entities
class ClusterProject < Entities::Cluster
expose :project, using: Entities::BasicProjectDetails
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment