diff options
111 files changed, 1418 insertions, 271 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 219077d79b8..b917c645ff8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,6 +134,11 @@ spinach 9 10: *spinach-knapsack image: "ruby:2.3" only: - master + cache: + key: "ruby-23" + paths: + - vendor/apt + - vendor/ruby .rspec-knapsack-ruby23: &rspec-knapsack-ruby23 <<: *rspec-knapsack diff --git a/CHANGELOG b/CHANGELOG index 72679b89d82..9e9ca9d02d9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,22 @@ Please view this file on the master branch, on stable branches it's out of date. -v 8.9.0 (unreleased) +v 8.10.0 (unreleased) + - Wrap code blocks on Activies and Todos page. !4783 (winniehell) + - Add Sidekiq queue duration to transaction metrics. + - Fix MR-auto-close text added to description. !4836 + - Eager load award emoji on notes + - Fix pagination when sorting by columns with lots of ties (like priority) + - Implement Subresource Integrity for CSS and JavaScript assets. This prevents malicious assets from loading in the case of a CDN compromise. + - Fix user creation with stronger minimum password requirements !4054 (nathan-pmt) + +v 8.9.1 + - Fix merge requests project settings help link anchor + - Fix GitLab project import issues related to notes and builds + - Improve performance of searching repository tags by name by using a memorized tag array + - Fix false truncated warnings with ISO-8559 files + - Fix 404 when accessing pipelines as guest user on public projects + +v 8.9.0 - Fix builds API response not including commit data - Fix error when CI job variables key specified but not defined - Fix pipeline status when there are no builds in pipeline @@ -13,7 +29,6 @@ v 8.9.0 (unreleased) - Fix endless redirections when accessing user OAuth applications when they are disabled - Allow enabling wiki page events from Webhook management UI - Bump rouge to 1.11.0 - - Fix MR-auto-close text added to description - Fix issue with arrow keys not working in search autocomplete dropdown - Fix an issue where note polling stopped working if a window was in the background during a refresh. diff --git a/Gemfile.lock b/Gemfile.lock index ba16e4bf337..ce52985bd4a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -277,7 +277,7 @@ GEM posix-spawn (~> 0.3) gitlab_emoji (0.3.1) gemojione (~> 2.2, >= 2.2.1) - gitlab_git (10.2.0) + gitlab_git (10.2.3) activesupport (~> 4.0) charlock_holmes (~> 0.7.3) github-linguist (~> 4.7.0) @@ -1 +1 @@ -8.9.0-pre +8.10.0-pre diff --git a/app/assets/javascripts/layout_nav.js.coffee b/app/assets/javascripts/layout_nav.js.coffee index f8f0aea427e..cad095daae1 100644 --- a/app/assets/javascripts/layout_nav.js.coffee +++ b/app/assets/javascripts/layout_nav.js.coffee @@ -4,10 +4,9 @@ hideEndFade = ($scrollingTabs) -> $this .find('.fade-right') - .toggleClass('end-scroll', $this.width() is $this.prop('scrollWidth')) + .toggleClass('scrolling', $this.width() < $this.prop('scrollWidth')) $ -> - $('.fade-left').addClass('end-scroll') hideEndFade($('.scrolling-tabs')) @@ -21,5 +20,5 @@ $ -> currentPosition = $this.scrollLeft() maxPosition = $this.prop('scrollWidth') - $this.outerWidth() - $this.find('.fade-left').toggleClass('end-scroll', currentPosition is 0) - $this.find('.fade-right').toggleClass('end-scroll', currentPosition is maxPosition) + $this.find('.fade-left').toggleClass('scrolling', currentPosition > 0) + $this.find('.fade-right').toggleClass('scrolling', currentPosition < maxPosition - 1) diff --git a/app/assets/stylesheets/framework/header.scss b/app/assets/stylesheets/framework/header.scss index a7bcb456560..e8cbe7f3c02 100644 --- a/app/assets/stylesheets/framework/header.scss +++ b/app/assets/stylesheets/framework/header.scss @@ -132,6 +132,10 @@ header { transition-duration: .3s; z-index: 999; + svg, img { + height: 36px; + } + &:hover { cursor: pointer; } diff --git a/app/assets/stylesheets/framework/nav.scss b/app/assets/stylesheets/framework/nav.scss index 0281b06d3ba..f53e63606de 100644 --- a/app/assets/stylesheets/framework/nav.scss +++ b/app/assets/stylesheets/framework/nav.scss @@ -1,6 +1,6 @@ @mixin fade($gradient-direction, $rgba, $gradient-color) { - visibility: visible; - opacity: 1; + visibility: hidden; + opacity: 0; z-index: 2; position: absolute; bottom: 12px; @@ -13,9 +13,9 @@ background: -moz-linear-gradient($gradient-direction, $rgba, $gradient-color 45%); background: linear-gradient($gradient-direction, $rgba, $gradient-color 45%); - &.end-scroll { - visibility: hidden; - opacity: 0; + &.scrolling { + visibility: visible; + opacity: 1; transition-duration: .3s; } @@ -272,7 +272,7 @@ float: right; padding: 7px 0 0; - @media (max-width: $screen-xs-max) { + @media (max-width: $screen-sm-max) { display: none; } @@ -377,9 +377,7 @@ .nav-control { .fade-right { - @media (min-width: $screen-xs-max) { - right: 68px; - } + @media (max-width: $screen-xs-min) { right: 0; } diff --git a/app/assets/stylesheets/pages/events.scss b/app/assets/stylesheets/pages/events.scss index 6c36f603daf..a2145956eb5 100644 --- a/app/assets/stylesheets/pages/events.scss +++ b/app/assets/stylesheets/pages/events.scss @@ -54,6 +54,10 @@ } } + code { + white-space: pre-wrap; + } + pre { border: none; background: #f9f9f9; diff --git a/app/assets/stylesheets/pages/labels.scss b/app/assets/stylesheets/pages/labels.scss index f5f67e2cd84..47bfd144930 100644 --- a/app/assets/stylesheets/pages/labels.scss +++ b/app/assets/stylesheets/pages/labels.scss @@ -6,6 +6,7 @@ height: 30px; display: inline-block; margin-right: 10px; + margin-bottom: 10px; } &.suggest-colors-dropdown { diff --git a/app/assets/stylesheets/pages/todos.scss b/app/assets/stylesheets/pages/todos.scss index afc00a68572..cf16d070cfe 100644 --- a/app/assets/stylesheets/pages/todos.scss +++ b/app/assets/stylesheets/pages/todos.scss @@ -62,6 +62,10 @@ } } + code { + white-space: pre-wrap; + } + pre { border: none; background: #f9f9f9; diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 851822d805a..6c26c7f7658 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -320,8 +320,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController def define_show_vars # Build a note object for comment form @note = @project.notes.new(noteable: @merge_request) - @notes = @merge_request.mr_and_commit_notes.inc_author.fresh - @discussions = @notes.discussions + @discussions = @merge_request.mr_and_commit_notes.inc_author_project_award_emoji.fresh.discussions + @notes = @discussions.flatten @noteable = @merge_request # Get commits from repository diff --git a/app/models/ability.rb b/app/models/ability.rb index 9c58b956007..f5950879ccb 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -196,7 +196,8 @@ class Ability @public_project_rules ||= project_guest_rules + [ :download_code, :fork_project, - :read_commit_status + :read_commit_status, + :read_pipeline ] end diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index ca5a685dd11..0c9a5e42eec 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -170,6 +170,19 @@ module Ci builds.where.not(environment: nil).success.pluck(:environment).uniq end + # Manually set the notes for a Ci::Pipeline + # There is no ActiveRecord relation between Ci::Pipeline and notes + # as they are related to a commit sha. This method helps importing + # them using the +Gitlab::ImportExport::RelationFactory+ class. + def notes=(notes) + notes.each do |note| + note[:id] = nil + note[:commit_id] = sha + note[:noteable_id] = self['id'] + note.save! + end + end + def notes Note.for_commit_id(sha) end diff --git a/app/models/concerns/awardable.rb b/app/models/concerns/awardable.rb index 539c7c31e30..06beff177b1 100644 --- a/app/models/concerns/awardable.rb +++ b/app/models/concerns/awardable.rb @@ -2,10 +2,11 @@ module Awardable extend ActiveSupport::Concern included do - has_many :award_emoji, as: :awardable, dependent: :destroy + has_many :award_emoji, -> { includes(:user) }, as: :awardable, dependent: :destroy if self < Participable - participant :award_emoji_with_associations + # By default we always load award_emoji user association + participant :award_emoji end end @@ -34,12 +35,9 @@ module Awardable end end - def award_emoji_with_associations - award_emoji.includes(:user) - end - def grouped_awards(with_thumbs: true) - awards = award_emoji_with_associations.group_by(&:name) + # By default we always load award_emoji user association + awards = award_emoji.group_by(&:name) if with_thumbs awards[AwardEmoji::UPVOTE_NAME] ||= [] diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 0ccd3474b81..d6f55885dd6 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -19,9 +19,14 @@ module Issuable belongs_to :milestone has_many :notes, as: :noteable, dependent: :destroy do def authors_loaded? - # We check first if we're loaded to not load unnecesarily. + # We check first if we're loaded to not load unnecessarily. loaded? && to_a.all? { |note| note.association(:author).loaded? } end + + def award_emojis_loaded? + # We check first if we're loaded to not load unnecessarily. + loaded? && to_a.all? { |note| note.association(:award_emoji).loaded? } + end end has_many :label_links, as: :target, dependent: :destroy has_many :labels, through: :label_links @@ -49,7 +54,7 @@ module Issuable scope :without_label, -> { joins("LEFT OUTER JOIN label_links ON label_links.target_type = '#{name}' AND label_links.target_id = #{table_name}.id").where(label_links: { id: nil }) } scope :join_project, -> { joins(:project) } - scope :inc_notes_with_associations, -> { includes(notes: :author) } + scope :inc_notes_with_associations, -> { includes(notes: [ :project, :author, :award_emoji ]) } scope :references_project, -> { references(:project) } scope :non_archived, -> { join_project.where(projects: { archived: false }) } @@ -112,15 +117,18 @@ module Issuable end def sort(method, excluded_labels: []) - case method.to_s - when 'milestone_due_asc' then order_milestone_due_asc - when 'milestone_due_desc' then order_milestone_due_desc - when 'downvotes_desc' then order_downvotes_desc - when 'upvotes_desc' then order_upvotes_desc - when 'priority' then order_labels_priority(excluded_labels: excluded_labels) - else - order_by(method) - end + sorted = case method.to_s + when 'milestone_due_asc' then order_milestone_due_asc + when 'milestone_due_desc' then order_milestone_due_desc + when 'downvotes_desc' then order_downvotes_desc + when 'upvotes_desc' then order_upvotes_desc + when 'priority' then order_labels_priority(excluded_labels: excluded_labels) + else + order_by(method) + end + + # Break ties with the ID column for pagination + sorted.order(id: :desc) end def order_labels_priority(excluded_labels: []) @@ -257,7 +265,14 @@ module Issuable # already have their authors loaded (possibly because the scope # `inc_notes_with_associations` was used) and skip the inclusion if that's # the case. - notes.authors_loaded? ? notes : notes.includes(:author) + includes = [] + includes << :author unless notes.authors_loaded? + includes << :award_emoji unless notes.award_emojis_loaded? + if includes.any? + notes.includes(includes) + else + notes + end end def updated_tasks diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index 95fd510eb3a..33d2a69ebaf 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -20,7 +20,7 @@ class LegacyDiffNote < Note end def discussion_id - @discussion_id ||= self.class.build_discussion_id(noteable_type, noteable_id || commit_id, line_code, active?) + @discussion_id ||= self.class.build_discussion_id(noteable_type, noteable_id || commit_id, line_code) end def diff_file_hash diff --git a/app/models/note.rb b/app/models/note.rb index 8d164647550..e510525b89d 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -49,11 +49,13 @@ class Note < ActiveRecord::Base scope :fresh, ->{ order(created_at: :asc, id: :asc) } scope :inc_author_project, ->{ includes(:project, :author) } scope :inc_author, ->{ includes(:author) } + scope :inc_author_project_award_emoji, ->{ includes(:project, :author, :award_emoji) } scope :legacy_diff_notes, ->{ where(type: 'LegacyDiffNote') } scope :non_diff_notes, ->{ where(type: ['Note', nil]) } scope :with_associations, -> do + # FYI noteable cannot be loaded for LegacyDiffNote for commits includes(:author, :noteable, :updated_by, project: [:project_members, { group: [:group_members] }]) end diff --git a/app/models/repository.rb b/app/models/repository.rb index 221c87164ca..acc720ccfa3 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -130,7 +130,7 @@ class Repository end def find_tag(name) - raw_repository.tags.find { |tag| tag.name == name } + tags.find { |tag| tag.name == name } end def add_branch(user, branch_name, target) diff --git a/app/models/user.rb b/app/models/user.rb index 876ccc69d8d..04b220ee13c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -308,7 +308,7 @@ class User < ActiveRecord::Base def generate_password if self.force_random_password - self.password = self.password_confirmation = Devise.friendly_token.first(8) + self.password = self.password_confirmation = Devise.friendly_token.first(Devise.password_length.min) end end diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index e0ed657919e..d5965a6ec99 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -25,11 +25,14 @@ = favicon_link_tag 'favicon.ico' - = stylesheet_link_tag "application", media: "all" - = stylesheet_link_tag "print", media: "print" + = stylesheet_link_tag "application", media: "all", integrity: true + = stylesheet_link_tag "print", media: "print", integrity: true - = javascript_include_tag "application" + = javascript_include_tag "application", integrity: true + -# FIXME: SRI doesn't apply to the dynamically-generated per-page + -# JavaScript due to a bug in sprockets-rails. + -# See https://github.com/rails/sprockets-rails/issues/359 - if page_specific_javascripts = javascript_include_tag page_specific_javascripts, {"data-turbolinks-track" => true} diff --git a/app/views/notify/project_was_not_exported_email.html.haml b/app/views/notify/project_was_not_exported_email.html.haml index c9e9ade2cf1..c888da29c17 100644 --- a/app/views/notify/project_was_not_exported_email.html.haml +++ b/app/views/notify/project_was_not_exported_email.html.haml @@ -6,4 +6,4 @@ %ul - @errors.each do |error| %li - error + #{error} diff --git a/app/views/notify/project_was_not_exported_email.text.erb b/app/views/notify/project_was_not_exported_email.text.erb deleted file mode 100644 index a07f6edacf7..00000000000 --- a/app/views/notify/project_was_not_exported_email.text.erb +++ /dev/null @@ -1,6 +0,0 @@ -Project <%= @project.name %> couldn't be exported. - -The errors we encountered were: - -- @errors.each do |error| -<%= error %>
\ No newline at end of file diff --git a/app/views/notify/project_was_not_exported_email.text.haml b/app/views/notify/project_was_not_exported_email.text.haml new file mode 100644 index 00000000000..b27cb620b9e --- /dev/null +++ b/app/views/notify/project_was_not_exported_email.text.haml @@ -0,0 +1,6 @@ += "Project #{@project.name} couldn't be exported." + += "The errors we encountered were:" + +- @errors.each do |error| + #{error}
\ No newline at end of file diff --git a/app/views/projects/_merge_request_settings.html.haml b/app/views/projects/_merge_request_settings.html.haml index da522b53417..771a2e0df7d 100644 --- a/app/views/projects/_merge_request_settings.html.haml +++ b/app/views/projects/_merge_request_settings.html.haml @@ -8,4 +8,4 @@ %strong Only allow merge requests to be merged if the build succeeds .help-block Builds need to be configured to enable this feature. - = link_to icon('question-circle'), help_page_path('workflow', 'merge_requests#only-allow-merge-requests-to-be-merged-if-the-build-succeeds') + = link_to icon('question-circle'), help_page_path('workflow', 'merge_requests', anchor: 'only-allow-merge-requests-to-be-merged-if-the-build-succeeds') diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml index 0fe8a3b490a..290743feb4a 100644 --- a/app/views/search/results/_blob.html.haml +++ b/app/views/search/results/_blob.html.haml @@ -2,9 +2,10 @@ .blob-result .file-holder .file-title - = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(blob.ref, blob.filename), :anchor => "L" + blob.startline.to_s) do + - blob_link = namespace_project_blob_path(@project.namespace, @project, tree_join(blob.ref, blob.filename)) + = link_to blob_link do %i.fa.fa-file %strong = blob.filename .file-content.code.term - = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline + = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link diff --git a/app/views/shared/_event_filter.html.haml b/app/views/shared/_event_filter.html.haml index aa18e6f236f..8824bcc158e 100644 --- a/app/views/shared/_event_filter.html.haml +++ b/app/views/shared/_event_filter.html.haml @@ -1,9 +1,5 @@ %ul.nav-links.event-filter.scrolling-tabs - %li.fade-left - = icon('arrow-left') = event_filter_link EventFilter.push, 'Push events' = event_filter_link EventFilter.merged, 'Merge events' = event_filter_link EventFilter.comments, 'Comments' = event_filter_link EventFilter.team, 'Team' - %li.fade-right - = icon('arrow-right') diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml index 37dcf39c062..ad944a19ca1 100644 --- a/app/views/shared/_file_highlight.html.haml +++ b/app/views/shared/_file_highlight.html.haml @@ -2,11 +2,12 @@ .line-numbers - if blob.data.present? - link_icon = icon('link') + - link = blob_link if defined?(blob_link) - blob.data.each_line.each_with_index do |_, index| - offset = defined?(first_line_number) ? first_line_number : 1 - i = index + offset -# We're not using `link_to` because it is too slow once we get to thousands of lines. - %a.diff-line-num{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i} + %a.diff-line-num{href: "#{link}#L#{i}", id: "L#{i}", 'data-line-number' => i} = link_icon = i .blob-content{data: {blob_id: blob.id}} diff --git a/doc/README.md b/doc/README.md index 5d89d0c9821..f1283cea0ad 100644 --- a/doc/README.md +++ b/doc/README.md @@ -3,17 +3,18 @@ ## User documentation - [API](api/README.md) Automate GitLab via a simple and powerful API. -- [CI](ci/README.md) GitLab Continuous Integration (CI) getting started, `.gitlab-ci.yml` options, and examples. +- [CI/CD](ci/README.md) GitLab Continuous Integration (CI) and Continuous Delivery (CD) getting started, `.gitlab-ci.yml` options, and examples. - [GitLab as OAuth2 authentication service provider](integration/oauth_provider.md). It allows you to login to other applications from GitLab. +- [Container Registry](container_registry/README.md) Learn how to use GitLab Container Registry. - [GitLab Basics](gitlab-basics/README.md) Find step by step how to start working on your commandline and on GitLab. - [Importing to GitLab](workflow/importing/README.md). +- [Importing and exporting projects between instances](user/project/settings/import_export.md). - [Markdown](markdown/markdown.md) GitLab's advanced formatting system. -- [Migrating from SVN](workflow/importing/migrating_from_svn.md) Convert a SVN repository to Git and GitLab +- [Migrating from SVN](workflow/importing/migrating_from_svn.md) Convert a SVN repository to Git and GitLab. - [Permissions](permissions/permissions.md) Learn what each role in a project (external/guest/reporter/developer/master/owner) can do. - [Profile Settings](profile/README.md) - [Project Services](project_services/project_services.md) Integrate a project with external services, such as CI and chat. - [Public access](public_access/public_access.md) Learn how you can allow public and internal access to projects. -- [Container Registry](container_registry/README.md) Learn how to use GitLab Container Registry. - [SSH](ssh/README.md) Setup your ssh keys and deploy keys for secure access to your projects. - [Webhooks](web_hooks/web_hooks.md) Let GitLab notify you when new code has been pushed to your project. - [Workflow](workflow/README.md) Using GitLab functionality and importing projects from GitHub and SVN. @@ -24,15 +25,15 @@ external authentication with LDAP, SAML, CAS and additional Omniauth providers. - [Custom git hooks](hooks/custom_hooks.md) Custom git hooks (on the filesystem) for when webhooks aren't enough. - [Install](install/README.md) Requirements, directory structures and installation from source. -- [Restart GitLab](administration/restart_gitlab.md) Learn how to restart GitLab and its components +- [Restart GitLab](administration/restart_gitlab.md) Learn how to restart GitLab and its components. - [Integration](integration/README.md) How to integrate with systems such as JIRA, Redmine, Twitter. - [Issue closing](customization/issue_closing.md) Customize how to close an issue from commit messages. - [Libravatar](customization/libravatar.md) Use Libravatar for user avatars. - [Log system](administration/logs.md) Log system. - [Environment Variables](administration/environment_variables.md) to configure GitLab. -- [Operations](operations/README.md) Keeping GitLab up and running +- [Operations](operations/README.md) Keeping GitLab up and running. - [Raketasks](raketasks/README.md) Backups, maintenance, automatic webhook setup and the importing of projects. -- [Repository checks](administration/repository_checks.md) Periodic Git repository checks +- [Repository checks](administration/repository_checks.md) Periodic Git repository checks. - [Security](security/README.md) Learn what you can do to further secure your GitLab instance. - [System hooks](system_hooks/system_hooks.md) Notifications when users, projects and keys are changed. - [Update](update/README.md) Update guides to upgrade your installation. @@ -41,11 +42,11 @@ - [Migrate GitLab CI to CE/EE](migrate_ci_to_ce/README.md) Follow this guide to migrate your existing GitLab CI data to GitLab CE/EE. - [Git LFS configuration](workflow/lfs/lfs_administration.md) - [Housekeeping](administration/housekeeping.md) Keep your Git repository tidy and fast. -- [GitLab Performance Monitoring](monitoring/performance/introduction.md) Configure GitLab and InfluxDB for measuring performance metrics -- [Monitoring uptime](monitoring/health_check.md) Check the server status using the health check endpoint -- [Sidekiq Troubleshooting](administration/troubleshooting/sidekiq.md) Debug when Sidekiq appears hung and is not processing jobs -- [High Availability](administration/high_availability/README.md) Configure multiple servers for scaling or high availability -- [Container Registry](administration/container_registry.md) Configure Docker Registry with GitLab +- [GitLab Performance Monitoring](monitoring/performance/introduction.md) Configure GitLab and InfluxDB for measuring performance metrics. +- [Monitoring uptime](monitoring/health_check.md) Check the server status using the health check endpoint. +- [Sidekiq Troubleshooting](administration/troubleshooting/sidekiq.md) Debug when Sidekiq appears hung and is not processing jobs. +- [High Availability](administration/high_availability/README.md) Configure multiple servers for scaling or high availability. +- [Container Registry](administration/container_registry.md) Configure Docker Registry with GitLab. ## Contributor documentation diff --git a/doc/administration/container_registry.md b/doc/administration/container_registry.md index 7870669fa77..d5d43303454 100644 --- a/doc/administration/container_registry.md +++ b/doc/administration/container_registry.md @@ -22,6 +22,7 @@ You can read more about Docker Registry at https://docs.docker.com/registry/intr - [Disable Container Registry per project](#disable-container-registry-per-project) - [Disable Container Registry for new projects site-wide](#disable-container-registry-for-new-projects-site-wide) - [Container Registry storage path](#container-registry-storage-path) +- [Container Registry storage driver](#container-registry-storage-driver) - [Storage limitations](#storage-limitations) - [Changelog](#changelog) @@ -84,6 +85,17 @@ GitLab does not ship with a Registry init file. Hence, [restarting GitLab][resta will not restart the Registry should you modify its settings. Read the upstream documentation on how to achieve that. +The Docker Registry configuration will need `container_registry` as the service and `https://gitlab.example.com/jwt/auth` as the realm: + +``` +auth: + token: + realm: https://gitlab.example.com/jwt/auth + service: container_registry + issuer: gitlab-issuer + rootcertbundle: /root/certs/certbundle +``` + ## Container Registry domain configuration There are two ways you can configure the Registry's external domain. @@ -306,8 +318,12 @@ the Container Registry by themselves, follow the steps below. ## Container Registry storage path -To change the storage path where Docker images will be stored, follow the -steps below. +>**Note:** +For configuring storage in the cloud instead of the filesystem, see the +[storage driver configuration](#container-registry-storage-driver). + +If you want to store your images on the filesystem, you can change the storage +path for the Container Registry, follow the steps below. This path is accessible to: @@ -349,6 +365,72 @@ The default location where images are stored in source installations, is 1. Save the file and [restart GitLab][] for the changes to take effect. +## Container Registry storage driver + +You can configure the Container Registry to use a different storage backend by +configuring a different storage driver. By default the GitLab Container Registry +is configured to use the filesystem driver, which makes use of [storage path](#container-registry-storage-path) +configuration. + +The different supported drivers are: + +| Driver | Description | +|------------|-------------------------------------| +| filesystem | Uses a path on the local filesystem | +| azure | Microsoft Azure Blob Storage | +| gcs | Google Cloud Storage | +| s3 | Amazon Simple Storage Service | +| swift | OpenStack Swift Object Storage | +| oss | Aliyun OSS | + +Read more about the individual driver's config options in the +[Docker Registry docs][storage-config]. + +> **Warning** GitLab will not backup Docker images that are not stored on the +filesystem. Remember to enable backups with your object storage provider if +desired. + +--- + +**Omnibus GitLab installations** + +To configure the storage driver in Omnibus: + +1. Edit `/etc/gitlab/gitlab.rb`: + + ```ruby + registry['storage'] = { + 's3' => { + 'accesskey' => 's3-access-key', + 'secretkey' => 's3-secret-key-for-access-key', + 'bucket' => 'your-s3-bucket' + } + } + ``` + +1. Save the file and [reconfigure GitLab][] for the changes to take effect. + +--- + +**Installations from source** + +Configuring the storage driver is done in your registry config YML file created +when you [deployed your docker registry][registry-deploy]. + +Example: + +``` +storage: + s3: + accesskey: 'AKIAKIAKI' + secretkey: 'secret123' + bucket: 'gitlab-registry-bucket-AKIAKIAKI' + cache: + blobdescriptor: inmemory + delete: + enabled: true +``` + ## Storage limitations Currently, there is no storage limitation, which means a user can upload an diff --git a/doc/administration/raketasks/project_import_export.md b/doc/administration/raketasks/project_import_export.md new file mode 100644 index 00000000000..c212059b9d5 --- /dev/null +++ b/doc/administration/raketasks/project_import_export.md @@ -0,0 +1,33 @@ +# Project import/export + +>**Note:** + - This feature was [introduced][ce-3050] in GitLab 8.9 + - Importing will not be possible if the import instance version is lower + than that of the exporter. + - For existing installations, the project import option has to be enabled in + application settings (`/admin/application_settings`) under 'Import sources'. + - The exports are stored in a temporary [shared directory][tmp] and are deleted + every 24 hours by a specific worker. + +The GitLab Import/Export version can be checked by using: + +```bash +# Omnibus installations +sudo gitlab-rake gitlab:import_export:version + +# Installations from source +bundle exec rake gitlab:import_export:version RAILS_ENV=production +``` + +The current list of DB tables that will get exported can be listed by using: + +```bash +# Omnibus installations +sudo gitlab-rake gitlab:import_export:data + +# Installations from source +bundle exec rake gitlab:import_export:data RAILS_ENV=production +``` + +[ce-3050]: https://gitlab.com/gitlab-org/gitlab-ce/issues/3050 +[tmp]: ../../development/shared_files.md diff --git a/doc/ci/README.md b/doc/ci/README.md index 5a1cb5319c6..3dd4e2bc230 100644 --- a/doc/ci/README.md +++ b/doc/ci/README.md @@ -5,6 +5,7 @@ - [Get started with GitLab CI](quick_start/README.md) - [CI examples for various languages](examples/README.md) - [Learn how to enable or disable GitLab CI](enable_or_disable_ci.md) +- [Pipelines and builds](pipelines.md) - [Environments and deployments](environments.md) - [Learn how `.gitlab-ci.yml` works](yaml/README.md) - [Configure a Runner, the application that runs your builds](runners/README.md) diff --git a/doc/ci/environments.md b/doc/ci/environments.md index 040379bb381..d85b8a34ced 100644 --- a/doc/ci/environments.md +++ b/doc/ci/environments.md @@ -52,7 +52,7 @@ Clicking on an environment will show the history of deployments. Only deploys that happen after your `.gitlab-ci.yml` is properly configured will show up in the environments and deployments lists. -[Pipelines]: quick_start/README.md +[Pipelines]: pipelines.md [jobs]: yaml/README.md#jobs [environments]: #environments [deployments]: #deployments diff --git a/doc/ci/pipelines.md b/doc/ci/pipelines.md new file mode 100644 index 00000000000..48a9f994759 --- /dev/null +++ b/doc/ci/pipelines.md @@ -0,0 +1,38 @@ +# Introduction to pipelines and builds + +>**Note:** +Introduced in GitLab 8.8. + +## Pipelines + +A pipeline is a group of [builds] that get executed in [stages] (batches). All +of the builds in a stage are executed in parallel (if there are enough +concurrent [runners]), and if they all succeed, the pipeline moves on to the +next stage. If one of the builds fails, the next stage is not (usually) +executed. + +## Builds + +Builds are individual runs of [jobs]. Not to be confused with a `build` job or +`build` stage. + +## Defining pipelines + +Pipelines are defined in `.gitlab-ci.yml` by specifying [jobs] that run in +[stages]. + +See full [documentation](yaml/README.md#jobs). + +## Seeing pipeline status + +You can find the current and historical pipeline runs under **Pipelines** for your +project. + +## Seeing build status + +Clicking on a pipeline will show the builds that were run for that pipeline. + +[builds]: #builds +[jobs]: yaml/README.md#jobs +[stages]: yaml/README.md#stages +[runners]: runners/README.md diff --git a/doc/ci/quick_start/README.md b/doc/ci/quick_start/README.md index 386b8e29fcf..7fa1a478f34 100644 --- a/doc/ci/quick_start/README.md +++ b/doc/ci/quick_start/README.md @@ -4,41 +4,41 @@ is fully integrated into GitLab itself and is [enabled] by default on all projects. -The TL;DR version of how GitLab CI works is the following. - ---- - GitLab offers a [continuous integration][ci] service. If you [add a `.gitlab-ci.yml` file][yaml] to the root directory of your repository, and configure your GitLab project to use a [Runner], then each merge request or -push triggers a build. +push triggers your CI [pipeline]. -The `.gitlab-ci.yml` file tells the GitLab runner what to do. By default it -runs three [stages]: `build`, `test`, and `deploy`. +The `.gitlab-ci.yml` file tells the GitLab runner what to do. By default it runs +a pipeline with three [stages]: `build`, `test`, and `deploy`. You don't need to +use all three stages; stages with no jobs are simply ignored. If everything runs OK (no non-zero return values), you'll get a nice green checkmark associated with the pushed commit or merge request. This makes it -easy to see whether a merge request will cause any of the tests to fail before +easy to see whether a merge request caused any of the tests to fail before you even look at the code. -Most projects only use GitLab's CI service to run the test suite so that +Most projects use GitLab's CI service to run the test suite so that developers get immediate feedback if they broke something. +There's a growing trend to use continuous delivery and continuous deployment to +automatically deploy tested code to staging and production environments. + So in brief, the steps needed to have a working CI can be summed up to: 1. Add `.gitlab-ci.yml` to the root directory of your repository 1. Configure a Runner -From there on, on every push to your Git repository, the build will be -automagically started by the Runner and will appear under the project's -`/builds` page. +From there on, on every push to your Git repository, the Runner will +automagically start the pipeline and the pipeline will appear under the +project's `/pipelines` page. --- This guide assumes that you: - have a working GitLab instance of version 8.0 or higher or are using - [GitLab.com](https://gitlab.com/users/sign_in) + [GitLab.com](https://gitlab.com) - have a project in GitLab that you would like to use CI for Let's break it down to pieces and work on solving the GitLab CI puzzle. @@ -57,15 +57,14 @@ On any push to your repository, GitLab will look for the `.gitlab-ci.yml` file and start builds on _Runners_ according to the contents of the file, for that commit. -Because `.gitlab-ci.yml` is in the repository, it is version controlled, -old versions still build successfully, forks can easily make use of CI, -branches can have separate builds and you have a single source of truth for CI. -You can read more about the reasons why we are using `.gitlab-ci.yml` -[in our blog about it][blog-ci]. +Because `.gitlab-ci.yml` is in the repository and is version controlled, old +versions still build successfully, forks can easily make use of CI, branches can +have different pipelines and jobs, and you have a single source of truth for CI. +You can read more about the reasons why we are using `.gitlab-ci.yml` [in our +blog about it][blog-ci]. **Note:** `.gitlab-ci.yml` is a [YAML](https://en.wikipedia.org/wiki/YAML) file -so you have to pay extra attention to the indentation. Always use spaces, not -tabs. +so you have to pay extra attention to indentation. Always use spaces, not tabs. ### Creating a simple `.gitlab-ci.yml` file @@ -108,7 +107,7 @@ If you want to check whether your `.gitlab-ci.yml` file is valid, there is a Lint tool under the page `/ci/lint` of your GitLab instance. You can also find the link under **Settings > CI settings** in your project. -For more information and a complete `.gitlab-ci.yml` syntax, please check +For more information and a complete `.gitlab-ci.yml` syntax, please read [the documentation on .gitlab-ci.yml](../yaml/README.md). ### Push `.gitlab-ci.yml` to GitLab @@ -122,7 +121,8 @@ git commit -m "Add .gitlab-ci.yml" git push origin master ``` -Now if you go to the **Builds** page you will see that the builds are pending. +Now if you go to the **Pipelines** page you will see that the pipeline is +pending. You can also go to the **Commits** page and notice the little clock icon next to the commit SHA. @@ -138,15 +138,14 @@ Notice that there are two jobs pending which are named after what we wrote in `.gitlab-ci.yml`. The red triangle indicates that there is no Runner configured yet for these builds. -The next step is to configure a Runner so that it picks the pending jobs. +The next step is to configure a Runner so that it picks the pending builds. ## Configuring a Runner -In GitLab, Runners run the builds that you define in `.gitlab-ci.yml`. -A Runner can be a virtual machine, a VPS, a bare-metal machine, a docker -container or even a cluster of containers. GitLab and the Runners communicate -through an API, so the only needed requirement is that the machine on which the -Runner is configured to have Internet access. +In GitLab, Runners run the builds that you define in `.gitlab-ci.yml`. A Runner +can be a virtual machine, a VPS, a bare-metal machine, a docker container or +even a cluster of containers. GitLab and the Runners communicate through an API, +so the only requirement is that the Runner's machine has Internet access. A Runner can be specific to a certain project or serve multiple projects in GitLab. If it serves all projects it's called a _Shared Runner_. @@ -188,12 +187,16 @@ To enable **Shared Runners** you have to go to your project's [Read more on Shared Runners](../runners/README.md). -## Seeing the status of your build +## Seeing the status of your pipeline and builds After configuring the Runner successfully, you should see the status of your last commit change from _pending_ to either _running_, _success_ or _failed_. -You can view all builds, by going to the **Builds** page in your project. +You can view all pipelines by going to the **Pipelines** page in your project. + +![Commit status](img/pipelines_status.png) + +Or you can view all builds, by going to the **Pipelines > Builds** page. ![Commit status](img/builds_status.png) @@ -238,3 +241,4 @@ CI with various languages. [runner]: ../runners/README.md [enabled]: ../enable_or_disable_ci.md [stages]: ../yaml/README.md#stages +[pipeline]: ../pipelines.md diff --git a/doc/ci/quick_start/img/pipelines_status.png b/doc/ci/quick_start/img/pipelines_status.png Binary files differnew file mode 100644 index 00000000000..6bc97bb739c --- /dev/null +++ b/doc/ci/quick_start/img/pipelines_status.png diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index d0fbcbe9988..1892acda29b 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -13,32 +13,34 @@ If you want a quick introduction to GitLab CI, follow our **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [.gitlab-ci.yml](#gitlab-ci-yml) - - [image and services](#image-and-services) - - [before_script](#before_script) - - [after_script](#after_script) - - [stages](#stages) - - [types](#types) - - [variables](#variables) - - [cache](#cache) - - [cache:key](#cache-key) + - [image and services](#image-and-services) + - [before_script](#before_script) + - [after_script](#after_script) + - [stages](#stages) + - [types](#types) + - [variables](#variables) + - [cache](#cache) + - [cache:key](#cache-key) - [Jobs](#jobs) - - [script](#script) - - [stage](#stage) - - [job variables](#job-variables) - - [only and except](#only-and-except) - - [tags](#tags) - - [when](#when) - - [environment](#environment) - - [artifacts](#artifacts) - - [artifacts:name](#artifacts-name) - - [artifacts:when](#artifacts-when) - - [artifacts:expire_in](#artifacts-expire_in) - - [dependencies](#dependencies) - - [before_script and after_script](#before_script-and-after_script) + - [script](#script) + - [stage](#stage) + - [only and except](#only-and-except) + - [job variables](#job-variables) + - [tags](#tags) + - [when](#when) + - [environment](#environment) + - [artifacts](#artifacts) + - [artifacts:name](#artifactsname) + - [artifacts:when](#artifactswhen) + - [artifacts:expire_in](#artifactsexpire_in) + - [dependencies](#dependencies) + - [before_script and after_script](#before_script-and-after_script) +- [Git Strategy](#git-strategy) +- [Shallow cloning](#shallow-cloning) - [Hidden jobs](#hidden-jobs) - [Special YAML features](#special-yaml-features) - - [Anchors](#anchors) -- [Validate the .gitlab-ci.yml](#validate-the-gitlab-ci-yml) + - [Anchors](#anchors) +- [Validate the .gitlab-ci.yml](#validate-the-gitlab-ciyml) - [Skipping builds](#skipping-builds) - [Examples](#examples) @@ -54,7 +56,7 @@ of your repository and contains definitions of how your project should be built. The YAML file defines a set of jobs with constraints stating when they should be run. The jobs are defined as top-level elements with a name and always have -to contain the `script` clause: +to contain at least the `script` clause: ```yaml job1: @@ -165,7 +167,7 @@ stages: There are also two edge cases worth mentioning: -1. If no `stages` is defined in `.gitlab-ci.yml`, then by default the `build`, +1. If no `stages` are defined in `.gitlab-ci.yml`, then by default the `build`, `test` and `deploy` are allowed to be used as job's stage by default. 2. If a job doesn't specify a `stage`, the job is assigned the `test` stage. @@ -724,8 +726,8 @@ time they are uploaded and stored on GitLab. You can use the **Keep** button on the build page to override expiration and keep artifacts forever. -By default, artifacts are deleted hourly (via a cron job), but they are not -accessible after expiry. +After expiry, artifacts are actually deleted hourly by default (via a cron job), +but they are not accessible after expiry. The value of `expire_in` is an elapsed time. Examples of parseable values: - '3 mins 4 sec' @@ -821,6 +823,61 @@ job: - execute this after my script ``` +## Git Strategy + +>**Note:** +Introduced in GitLab 8.9 as an experimental feature. May change in future +releases or be removed completely. + +You can set the `GIT_STRATEGY` used for getting recent application code. `clone` +is slower, but makes sure you have a clean directory before every build. `fetch` +is faster. `GIT_STRATEGY` can be specified in the global `variables` section or +in the `variables` section for individual jobs. If it's not specified, then the +default from project settings will be used. + +``` +variables: + GIT_STRATEGY: clone +``` + +or + +``` +variables: + GIT_STRATEGY: fetch +``` + +## Shallow cloning + +>**Note:** +Introduced in GitLab 8.9 as an experimental feature. May change in future +releases or be removed completely. + +You can specify the depth of fetching and cloning using `GIT_DEPTH`. This allows +shallow cloning of the repository which can significantly speed up cloning for +repositories with a large number of commits or old, large binaries. The value is +passed to `git fetch` and `git clone`. + +>**Note:** +If you use a depth of 1 and have a queue of builds or retry +builds, jobs may fail. + +Since Git fetching and cloning is based on a ref, such as a branch name, runners +can't clone a specific commit SHA. If there are multiple builds in the queue, or +you are retrying an old build, the commit to be tested needs to be within the +git history that is cloned. Setting too small a value for `GIT_DEPTH` can make +it impossible to run these old commits. You will see `unresolved reference` in +build logs. You should then reconsider changing `GIT_DEPTH` to a higher value. + +Builds that rely on `git describe` may not work correctly when `GIT_DEPTH` is +set since only part of the git history is present. + +To fetch or clone only the last 3 commits: +``` +variables: + GIT_DEPTH: "3" +``` + ## Hidden jobs >**Note:** diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index 8a7547e5322..e2ca46504e7 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -37,7 +37,6 @@ First, you need to provide information on whether the migration can be applied: For example: ``` -# rubocop:disable all # Migration type: online without errors (works on previous version and new one) class MyMigration < ActiveRecord::Migration ... diff --git a/doc/development/rake_tasks.md b/doc/development/rake_tasks.md index 6d04b9590e6..41685c7ee41 100644 --- a/doc/development/rake_tasks.md +++ b/doc/development/rake_tasks.md @@ -33,3 +33,23 @@ bundle exec rake gitlab:generate_docs ``` bundle exec rake services:doc ``` + +## Updating Emoji Digests + +To update the Emoji digests file (used for Emoji autocomplete) you must run the +following: + +``` +bundle exec rake gemojione:digests +``` + +This will update the file `fixtures/emojis/digests.json` based on the currently +available Emoji. + +## Emoji Sprites + +Generating a sprite file containing all the Emoji can be done by running: + +``` +bundle exec rake gemojione:sprite +``` diff --git a/doc/intro/README.md b/doc/intro/README.md index 382d10aaf40..1850031eb26 100644 --- a/doc/intro/README.md +++ b/doc/intro/README.md @@ -12,7 +12,7 @@ Create projects and groups. Create issues, labels, milestones, cast your vote, and review issues. - [Create a new issue](../gitlab-basics/create-issue.md) -- [Assign labels to issues](../workflow/labels.md) +- [Assign labels to issues](../user/project/labels.md) - [Use milestones as an overview of your project's tracker](../workflow/milestones.md) - [Use voting to express your like/dislike to issues and merge requests](../workflow/award_emoji.md) diff --git a/doc/monitoring/performance/grafana_configuration.md b/doc/monitoring/performance/grafana_configuration.md index 168bd85c26a..7947b0fedc4 100644 --- a/doc/monitoring/performance/grafana_configuration.md +++ b/doc/monitoring/performance/grafana_configuration.md @@ -44,70 +44,32 @@ on a separate server) ## Apply retention policies and create continuous queries -If you intend to import the GitLab provided Grafana dashboards, you will need -to copy and run a set of queries against InfluxDB to create the needed data -sets. +If you intend to import the GitLab provided Grafana dashboards, you will need to +set up the right retention policies and continuous queries. The easiest way of +doing this is by using the [influxdb-management](https://gitlab.com/gitlab-org/influxdb-management) +repository. -On the InfluxDB server, run the following command, substituting your InfluxDB -user and password: +To use this repository you must first clone it: -```bash -influxdb --username admin -password super_secret +``` +git clone https://gitlab.com/gitlab-org/influxdb-management.git +cd influxdb-management ``` -This will drop you in to an InfluxDB interactive session. Copy the entire -contents below and paste it in to the interactive session: +Next you must install the required dependencies: ``` -CREATE RETENTION POLICY default ON gitlab DURATION 1h REPLICATION 1 DEFAULT -CREATE RETENTION POLICY downsampled ON gitlab DURATION 7d REPLICATION 1 -CREATE CONTINUOUS QUERY grape_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.grape_git_timings_per_action FROM gitlab."default".rails_method_calls WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY grape_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.grape_markdown_render_timings_overall FROM gitlab."default".rails_transactions WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY grape_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.grape_markdown_render_timings_per_action FROM gitlab."default".rails_transactions WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY grape_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.grape_markdown_timings_overall FROM gitlab."default".rails_method_calls WHERE (action !~ /.+/ OR action =~ /^Grape#/) AND method =~ /^Banzai/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY grape_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.grape_method_call_timings_per_action_and_method FROM gitlab."default".rails_method_calls WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), method, action END; -CREATE CONTINUOUS QUERY grape_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.grape_method_call_timings_per_method FROM gitlab."default".rails_method_calls WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), method END; -CREATE CONTINUOUS QUERY grape_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.grape_transaction_counts_overall FROM gitlab."default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY grape_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.grape_transaction_counts_per_action FROM gitlab."default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY grape_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.grape_transaction_timings_overall FROM gitlab."default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY grape_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.grape_transaction_timings_per_action FROM gitlab."default".rails_transactions WHERE action !~ /.+/ OR action =~ /^Grape#/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY rails_file_descriptor_counts ON gitlab BEGIN SELECT sum(value) AS count INTO gitlab.downsampled.rails_file_descriptor_counts FROM gitlab."default".rails_file_descriptors GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_gc_counts ON gitlab BEGIN SELECT sum(count) AS total, sum(minor_gc_count) AS minor, sum(major_gc_count) AS major INTO gitlab.downsampled.rails_gc_counts FROM gitlab."default".rails_gc_statistics GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_gc_timings ON gitlab BEGIN SELECT mean(total_time) AS duration_mean, percentile(total_time, 95) AS duration_95th, percentile(total_time, 99) AS duration_99th INTO gitlab.downsampled.rails_gc_timings FROM gitlab."default".rails_gc_statistics GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.rails_git_timings_per_action FROM gitlab."default".rails_method_calls WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY rails_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.rails_markdown_render_timings_overall FROM gitlab."default".rails_transactions WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.rails_markdown_render_timings_per_action FROM gitlab."default".rails_transactions WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY rails_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.rails_markdown_timings_overall FROM gitlab."default".rails_method_calls WHERE (action =~ /.+/ AND action !~ /^Grape#/) AND method =~ /^Banzai/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_memory_usage_overall ON gitlab BEGIN SELECT mean(value) AS memory_mean, percentile(value, 95) AS memory_95th, percentile(value, 99) AS memory_99th INTO gitlab.downsampled.rails_memory_usage_overall FROM gitlab."default".rails_memory_usage GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.rails_method_call_timings_per_action_and_method FROM gitlab."default".rails_method_calls WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), method, action END; -CREATE CONTINUOUS QUERY rails_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.rails_method_call_timings_per_method FROM gitlab."default".rails_method_calls WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), method END; -CREATE CONTINUOUS QUERY rails_object_counts_overall ON gitlab BEGIN SELECT sum(count) AS count INTO gitlab.downsampled.rails_object_counts_overall FROM gitlab."default".rails_object_counts GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_object_counts_per_type ON gitlab BEGIN SELECT sum(count) AS count INTO gitlab.downsampled.rails_object_counts_per_type FROM gitlab."default".rails_object_counts GROUP BY time(1m), type END; -CREATE CONTINUOUS QUERY rails_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.rails_transaction_counts_overall FROM gitlab."default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.rails_transaction_counts_per_action FROM gitlab."default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY rails_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.rails_transaction_timings_overall FROM gitlab."default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY rails_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.rails_transaction_timings_per_action FROM gitlab."default".rails_transactions WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY rails_view_timings_per_action_and_view ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.rails_view_timings_per_action_and_view FROM gitlab."default".rails_views WHERE action =~ /.+/ AND action !~ /^Grape#/ GROUP BY time(1m), action, view END; -CREATE CONTINUOUS QUERY sidekiq_file_descriptor_counts ON gitlab BEGIN SELECT sum(value) AS count INTO gitlab.downsampled.sidekiq_file_descriptor_counts FROM gitlab."default".sidekiq_file_descriptors GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_gc_counts ON gitlab BEGIN SELECT sum(count) AS total, sum(minor_gc_count) AS minor, sum(major_gc_count) AS major INTO gitlab.downsampled.sidekiq_gc_counts FROM gitlab."default".sidekiq_gc_statistics GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_gc_timings ON gitlab BEGIN SELECT mean(total_time) AS duration_mean, percentile(total_time, 95) AS duration_95th, percentile(total_time, 99) AS duration_99th INTO gitlab.downsampled.sidekiq_gc_timings FROM gitlab."default".sidekiq_gc_statistics GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_git_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.sidekiq_git_timings_per_action FROM gitlab."default".sidekiq_method_calls WHERE method =~ /^(Rugged|Gitlab::Git)/ GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY sidekiq_markdown_render_timings_overall ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.sidekiq_markdown_render_timings_overall FROM gitlab."default".sidekiq_transactions WHERE (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_markdown_render_timings_per_action ON gitlab BEGIN SELECT mean(banzai_cached_render_real_time) AS cached_real_mean, percentile(banzai_cached_render_real_time, 95) AS cached_real_95th, percentile(banzai_cached_render_real_time, 99) AS cached_real_99th, mean(banzai_cached_render_cpu_time) AS cached_cpu_mean, percentile(banzai_cached_render_cpu_time, 95) AS cached_cpu_95th, percentile(banzai_cached_render_cpu_time, 99) AS cached_cpu_99th, sum(banzai_cached_render_call_count) AS cached_call_count, mean(banzai_cacheless_render_real_time) AS cacheless_real_mean, percentile(banzai_cacheless_render_real_time, 95) AS cacheless_real_95th, percentile(banzai_cacheless_render_real_time, 99) AS cacheless_real_99th, mean(banzai_cacheless_render_cpu_time) AS cacheless_cpu_mean, percentile(banzai_cacheless_render_cpu_time, 95) AS cacheless_cpu_95th, percentile(banzai_cacheless_render_cpu_time, 99) AS cacheless_cpu_99th, sum(banzai_cacheless_render_call_count) AS cacheless_call_count INTO gitlab.downsampled.sidekiq_markdown_render_timings_per_action FROM gitlab."default".sidekiq_transactions WHERE (banzai_cached_render_call_count > 0 OR banzai_cacheless_render_call_count > 0) GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY sidekiq_markdown_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.sidekiq_markdown_timings_overall FROM gitlab."default".sidekiq_method_calls WHERE method =~ /^Banzai/ GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_memory_usage_overall ON gitlab BEGIN SELECT mean(value) AS memory_mean, percentile(value, 95) AS memory_95th, percentile(value, 99) AS memory_99th INTO gitlab.downsampled.sidekiq_memory_usage_overall FROM gitlab."default".sidekiq_memory_usage GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_method_call_timings_per_action_and_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.sidekiq_method_call_timings_per_action_and_method FROM gitlab."default".sidekiq_method_calls GROUP BY time(1m), method, action END; -CREATE CONTINUOUS QUERY sidekiq_method_call_timings_per_method ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.sidekiq_method_call_timings_per_method FROM gitlab."default".sidekiq_method_calls GROUP BY time(1m), method END; -CREATE CONTINUOUS QUERY sidekiq_object_counts_overall ON gitlab BEGIN SELECT sum(count) AS count INTO gitlab.downsampled.sidekiq_object_counts_overall FROM gitlab."default".sidekiq_object_counts GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_object_counts_per_type ON gitlab BEGIN SELECT sum(count) AS count INTO gitlab.downsampled.sidekiq_object_counts_per_type FROM gitlab."default".sidekiq_object_counts GROUP BY time(1m), type END; -CREATE CONTINUOUS QUERY sidekiq_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.sidekiq_transaction_counts_overall FROM gitlab."default".sidekiq_transactions GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_transaction_counts_per_action ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.sidekiq_transaction_counts_per_action FROM gitlab."default".sidekiq_transactions GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY sidekiq_transaction_timings_overall ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.sidekiq_transaction_timings_overall FROM gitlab."default".sidekiq_transactions GROUP BY time(1m) END; -CREATE CONTINUOUS QUERY sidekiq_transaction_timings_per_action ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th, mean(sql_duration) AS sql_duration_mean, percentile(sql_duration, 95) AS sql_duration_95th, percentile(sql_duration, 99) AS sql_duration_99th, mean(view_duration) AS view_duration_mean, percentile(view_duration, 95) AS view_duration_95th, percentile(view_duration, 99) AS view_duration_99th, mean(cache_read_duration) AS cache_read_duration_mean, percentile(cache_read_duration, 99) AS cache_read_duration_99th, percentile(cache_read_duration, 95) AS cache_read_duration_95th, mean(cache_write_duration) AS cache_write_duration_mean, percentile(cache_write_duration, 99) AS cache_write_duration_99th, percentile(cache_write_duration, 95) AS cache_write_duration_95th, mean(cache_delete_duration) AS cache_delete_duration_mean, percentile(cache_delete_duration, 99) AS cache_delete_duration_99th, percentile(cache_delete_duration, 95) AS cache_delete_duration_95th, mean(cache_exists_duration) AS cache_exists_duration_mean, percentile(cache_exists_duration, 99) AS cache_exists_duration_99th, percentile(cache_exists_duration, 95) AS cache_exists_duration_95th, mean(cache_duration) AS cache_duration_mean, percentile(cache_duration, 99) AS cache_duration_99th, percentile(cache_duration, 95) AS cache_duration_95th, mean(method_duration) AS method_duration_mean, percentile(method_duration, 99) AS method_duration_99th, percentile(method_duration, 95) AS method_duration_95th INTO gitlab.downsampled.sidekiq_transaction_timings_per_action FROM gitlab."default".sidekiq_transactions GROUP BY time(1m), action END; -CREATE CONTINUOUS QUERY sidekiq_view_timings_per_action_and_view ON gitlab BEGIN SELECT mean("duration") AS duration_mean, percentile("duration", 95) AS duration_95th, percentile("duration", 99) AS duration_99th INTO gitlab.downsampled.sidekiq_view_timings_per_action_and_view FROM gitlab."default".sidekiq_views GROUP BY time(1m), action, view END; -CREATE CONTINUOUS QUERY web_transaction_counts_overall ON gitlab BEGIN SELECT count("duration") AS count INTO gitlab.downsampled.web_transaction_counts_overall FROM gitlab."default".rails_transactions GROUP BY time(1m) END; +gem install bundler +bundle install ``` +Now you must configure the repository by first copying `.env.example` to `.env` +and then editing the `.env` file to contain the correct InfluxDB settings. Once +configured you can simply run `bundle exec rake` and the InfluxDB database will +be configured for you. + +For more information see the [influxdb-management README](https://gitlab.com/gitlab-org/influxdb-management/blob/master/README.md). + ## Import Dashboards You can now import a set of default dashboards that will give you a good diff --git a/doc/update/2.6-to-3.0.md b/doc/update/2.6-to-3.0.md index 4827ef9501a..fb70eaacbc9 100644 --- a/doc/update/2.6-to-3.0.md +++ b/doc/update/2.6-to-3.0.md @@ -13,6 +13,10 @@ git fetch origin git checkout v3.0.3 +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile # Install libs sudo -u gitlab bundle install --without development test postgres diff --git a/doc/update/2.9-to-3.0.md b/doc/update/2.9-to-3.0.md index f4a997a8c5e..ce46b57c09a 100644 --- a/doc/update/2.9-to-3.0.md +++ b/doc/update/2.9-to-3.0.md @@ -13,6 +13,11 @@ sudo -u gitlab -H git fetch origin sudo -u gitlab -H git checkout v3.0.3 +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile + # Install gems sudo -u gitlab -H bundle install --without development test postgres diff --git a/doc/update/3.0-to-3.1.md b/doc/update/3.0-to-3.1.md index a30485c42f7..6ac83f3b60d 100644 --- a/doc/update/3.0-to-3.1.md +++ b/doc/update/3.0-to-3.1.md @@ -25,6 +25,11 @@ sudo -u gitlab -H git checkout v3.1.0 # Install new charlock_holmes sudo gem install charlock_holmes --version '0.6.9' +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile + # Install gems for MySQL sudo -u gitlab -H bundle install --without development test postgres sqlite diff --git a/doc/update/3.1-to-4.0.md b/doc/update/3.1-to-4.0.md index f1ef4df4744..df53ed6de83 100644 --- a/doc/update/3.1-to-4.0.md +++ b/doc/update/3.1-to-4.0.md @@ -26,6 +26,11 @@ I wrote a bash script which will do it automatically for you. Just make sure all sudo -u gitlab -H git fetch sudo -u gitlab -H git checkout 4-0-stable +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile + # Install gems for MySQL sudo -u gitlab -H bundle install --without development test postgres diff --git a/doc/update/4.0-to-4.1.md b/doc/update/4.0-to-4.1.md index d89d5235917..c163bfd348d 100644 --- a/doc/update/4.0-to-4.1.md +++ b/doc/update/4.0-to-4.1.md @@ -22,6 +22,11 @@ cd /home/gitlab/gitlab/ sudo -u gitlab -H git fetch sudo -u gitlab -H git checkout 4-1-stable +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile + # Install gems for MySQL sudo -u gitlab -H bundle install --without development test postgres diff --git a/doc/update/4.1-to-4.2.md b/doc/update/4.1-to-4.2.md index 6fe4412ff90..97367c5f347 100644 --- a/doc/update/4.1-to-4.2.md +++ b/doc/update/4.1-to-4.2.md @@ -17,7 +17,15 @@ sudo -u gitlab -H git fetch sudo -u gitlab -H git checkout 4-2-stable -# Install libs +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u gitlab -H vim Gemfile + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u gitlab -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u gitlab -H bundle install --without development test postgres --deployment # update db diff --git a/doc/update/4.2-to-5.0.md b/doc/update/4.2-to-5.0.md index f9faf65f952..ee6de51c923 100644 --- a/doc/update/4.2-to-5.0.md +++ b/doc/update/4.2-to-5.0.md @@ -85,8 +85,17 @@ sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml # edit it sudo -u git -H vim config/gitlab.yml +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment + sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:shell:build_missing_projects RAILS_ENV=production diff --git a/doc/update/5.0-to-5.1.md b/doc/update/5.0-to-5.1.md index 9fbd1f88515..f0fddcf83af 100644 --- a/doc/update/5.0-to-5.1.md +++ b/doc/update/5.0-to-5.1.md @@ -42,7 +42,17 @@ cd /home/git/gitlab sudo rm tmp/sockets/gitlab.socket sudo -u git -H cp config/puma.rb.example config/puma.rb +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment + sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/5.1-to-5.2.md b/doc/update/5.1-to-5.2.md index cf9c4e4f770..625fcc33852 100644 --- a/doc/update/5.1-to-5.2.md +++ b/doc/update/5.1-to-5.2.md @@ -40,12 +40,28 @@ sudo -u git -H git checkout v1.4.0 ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/5.1-to-5.4.md b/doc/update/5.1-to-5.4.md index 97a98ede070..547d453914c 100644 --- a/doc/update/5.1-to-5.4.md +++ b/doc/update/5.1-to-5.4.md @@ -37,12 +37,28 @@ sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulner ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/5.1-to-6.0.md b/doc/update/5.1-to-6.0.md index a3fdd92bd2f..c992c69678e 100644 --- a/doc/update/5.1-to-6.0.md +++ b/doc/update/5.1-to-6.0.md @@ -137,12 +137,28 @@ sudo apt-get install python-docutils ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production diff --git a/doc/update/5.2-to-5.3.md b/doc/update/5.2-to-5.3.md index 27613aeda07..c5254f6fb0c 100644 --- a/doc/update/5.2-to-5.3.md +++ b/doc/update/5.2-to-5.3.md @@ -31,12 +31,28 @@ sudo -u git -H git checkout 5-3-stable ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/5.3-to-5.4.md b/doc/update/5.3-to-5.4.md index 577b9a585ff..c4a6146dcda 100644 --- a/doc/update/5.3-to-5.4.md +++ b/doc/update/5.3-to-5.4.md @@ -35,12 +35,28 @@ sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulner ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index d9c6d9bfb91..f0fee634322 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -73,12 +73,28 @@ sudo apt-get install python-docutils ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment # PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production diff --git a/doc/update/6.0-to-6.1.md b/doc/update/6.0-to-6.1.md index c5eba1c01c4..409faf30902 100644 --- a/doc/update/6.0-to-6.1.md +++ b/doc/update/6.0-to-6.1.md @@ -50,13 +50,28 @@ sudo -u git -H git checkout v1.7.9 ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL -sudo -u git -H bundle install --without development test mysql --deployment +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production diff --git a/doc/update/6.1-to-6.2.md b/doc/update/6.1-to-6.2.md index a534528108a..150c7ae1c83 100644 --- a/doc/update/6.1-to-6.2.md +++ b/doc/update/6.1-to-6.2.md @@ -45,13 +45,28 @@ sudo apt-get install logrotate ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -#PostgreSQL -sudo -u git -H bundle install --without development test mysql --deployment +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production diff --git a/doc/update/6.2-to-6.3.md b/doc/update/6.2-to-6.3.md index b08ebde0808..b96dfb8add7 100644 --- a/doc/update/6.2-to-6.3.md +++ b/doc/update/6.2-to-6.3.md @@ -40,13 +40,28 @@ The gitlab-shell config changed recently, so check for config file changes and m ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment # PostgreSQL -sudo -u git -H bundle install --without development test mysql --deployment +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production diff --git a/doc/update/6.3-to-6.4.md b/doc/update/6.3-to-6.4.md index 951d92dfeb5..37028be055f 100644 --- a/doc/update/6.3-to-6.4.md +++ b/doc/update/6.3-to-6.4.md @@ -36,13 +36,28 @@ sudo -u git -H git checkout v1.8.0 ```bash cd /home/git/gitlab +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + # MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment # PostgreSQL -sudo -u git -H bundle install --without development test mysql --deployment +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production diff --git a/doc/update/6.4-to-6.5.md b/doc/update/6.4-to-6.5.md index 0dae9a9fe59..982381a4db0 100644 --- a/doc/update/6.4-to-6.5.md +++ b/doc/update/6.4-to-6.5.md @@ -46,13 +46,28 @@ sudo -u git -H git checkout v1.8.0 ```bash cd /home/git/gitlab -# MySQL installations (note: the line below states '--without ... postgres') +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + +# MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production diff --git a/doc/update/6.5-to-6.6.md b/doc/update/6.5-to-6.6.md index c24e83eb006..bbed2b30215 100644 --- a/doc/update/6.5-to-6.6.md +++ b/doc/update/6.5-to-6.6.md @@ -46,12 +46,28 @@ sudo -u git -H git checkout v1.8.0 ```bash cd /home/git/gitlab -# MySQL installations (note: the line below states '--without ... postgres') +# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 +# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to +# `gem "modernizr-rails", "2.7.1"`` +sudo -u git -H vim Gemfile + +# MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -# PostgreSQL installations (note: the line below states '--without ... mysql') +# PostgreSQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production diff --git a/doc/update/6.6-to-6.7.md b/doc/update/6.6-to-6.7.md index b4298c93429..8e82942a1a0 100644 --- a/doc/update/6.6-to-6.7.md +++ b/doc/update/6.6-to-6.7.md @@ -46,13 +46,23 @@ sudo -u git -H git checkout v1.9.1 ```bash cd /home/git/gitlab -# MySQL installations (note: the line below states '--without ... postgres') +# MySQL + +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test postgres --no-deployment + +# Install libs (with deployment this time) sudo -u git -H bundle install --without development test postgres --deployment -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment +# PostgreSQL +# Run a bundle install without deployment to generate the new Gemfile +sudo -u git -H bundle install --without development test mysql --no-deployment + +# Install libs (with deployment this time) +sudo -u git -H bundle install --without development test mysql --deployment +# Both MySQL and PostgreSQL # Run database migrations sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production diff --git a/doc/update/6.x-or-7.x-to-7.14.md b/doc/update/6.x-or-7.x-to-7.14.md index c45fc9340ea..f170a0021b7 100644 --- a/doc/update/6.x-or-7.x-to-7.14.md +++ b/doc/update/6.x-or-7.x-to-7.14.md @@ -147,12 +147,15 @@ sudo -u git -H bundle install --without development test postgres --deployment # PostgreSQL installations (note: the line below states '--without ... mysql') sudo -u git -H bundle install --without development test mysql --deployment -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production +# Run database migrations from 6.0 to 6.1 +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production VERSION=20130909132950 # Enable internal issue IDs (introduced in GitLab 6.1) sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production +# Run left database migrations +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production + # Clean up assets and cache sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production diff --git a/doc/user/project/img/labels_assign_label_in_new_issue.png b/doc/user/project/img/labels_assign_label_in_new_issue.png Binary files differnew file mode 100644 index 00000000000..e32a35f7cda --- /dev/null +++ b/doc/user/project/img/labels_assign_label_in_new_issue.png diff --git a/doc/user/project/img/labels_assign_label_sidebar.png b/doc/user/project/img/labels_assign_label_sidebar.png Binary files differnew file mode 100644 index 00000000000..799443af889 --- /dev/null +++ b/doc/user/project/img/labels_assign_label_sidebar.png diff --git a/doc/user/project/img/labels_assign_label_sidebar_saved.png b/doc/user/project/img/labels_assign_label_sidebar_saved.png Binary files differnew file mode 100644 index 00000000000..e7d8d69e60e --- /dev/null +++ b/doc/user/project/img/labels_assign_label_sidebar_saved.png diff --git a/doc/user/project/img/labels_default.png b/doc/user/project/img/labels_default.png Binary files differnew file mode 100644 index 00000000000..ee0c9f889ad --- /dev/null +++ b/doc/user/project/img/labels_default.png diff --git a/doc/user/project/img/labels_description_tooltip.png b/doc/user/project/img/labels_description_tooltip.png Binary files differnew file mode 100644 index 00000000000..0d1e3e091fb --- /dev/null +++ b/doc/user/project/img/labels_description_tooltip.png diff --git a/doc/user/project/img/labels_filter.png b/doc/user/project/img/labels_filter.png Binary files differnew file mode 100644 index 00000000000..ed622be2d93 --- /dev/null +++ b/doc/user/project/img/labels_filter.png diff --git a/doc/user/project/img/labels_filter_by_priority.png b/doc/user/project/img/labels_filter_by_priority.png Binary files differnew file mode 100644 index 00000000000..c5a9e20919b --- /dev/null +++ b/doc/user/project/img/labels_filter_by_priority.png diff --git a/doc/user/project/img/labels_generate.png b/doc/user/project/img/labels_generate.png Binary files differnew file mode 100644 index 00000000000..9579be4e231 --- /dev/null +++ b/doc/user/project/img/labels_generate.png diff --git a/doc/user/project/img/labels_new_label.png b/doc/user/project/img/labels_new_label.png Binary files differnew file mode 100644 index 00000000000..a916d3dceb5 --- /dev/null +++ b/doc/user/project/img/labels_new_label.png diff --git a/doc/user/project/img/labels_new_label_on_the_fly.png b/doc/user/project/img/labels_new_label_on_the_fly.png Binary files differnew file mode 100644 index 00000000000..80cc434239e --- /dev/null +++ b/doc/user/project/img/labels_new_label_on_the_fly.png diff --git a/doc/user/project/img/labels_new_label_on_the_fly_create.png b/doc/user/project/img/labels_new_label_on_the_fly_create.png Binary files differnew file mode 100644 index 00000000000..c41090945eb --- /dev/null +++ b/doc/user/project/img/labels_new_label_on_the_fly_create.png diff --git a/doc/user/project/img/labels_prioritize.png b/doc/user/project/img/labels_prioritize.png Binary files differnew file mode 100644 index 00000000000..8dfe72cf826 --- /dev/null +++ b/doc/user/project/img/labels_prioritize.png diff --git a/doc/user/project/img/labels_subscribe.png b/doc/user/project/img/labels_subscribe.png Binary files differnew file mode 100644 index 00000000000..ea3db2bc0cf --- /dev/null +++ b/doc/user/project/img/labels_subscribe.png diff --git a/doc/user/project/labels.md b/doc/user/project/labels.md new file mode 100644 index 00000000000..4258185b7d0 --- /dev/null +++ b/doc/user/project/labels.md @@ -0,0 +1,147 @@ +# Labels + +Labels provide an easy way to categorize the issues or merge requests based on +descriptive titles like `bug`, `documentation` or any other text you feel like +it. They can have different colors, a description, and are visible throughout +the issue tracker or inside each issue individually. + +With labels, you can navigate the issue tracker and filter any bloated +information to visualize only the issues you are interested in. Let's see how +that works. + +## Create new labels + +>**Note:** +A permission level of `Developer` or higher is required in order to manage +labels. + +Head over a single project and navigate to **Issues > Labels**. + +The first time you visit this page, you'll notice that there are no labels +created yet. + +![Generate new labels](img/labels_generate.png) + +--- + +You can skip that and create a new label or click that link and GitLab will +generate a set of predefined labels for you. There 8 default generated labels +in total and you can see them in the screenshot below. + +![Default generated labels](img/labels_default.png) + +--- + +You can see that from the labels page you can have an overview of the number of +issues and merge requests assigned to each label. + +Creating a new label from scratch is as easy as pressing the **New label** +button. From there on you can choose the name, give it an optional description, +a color and you are set. + +When you are ready press the **Create label** button to create the new label. + +![New label](img/labels_new_label.png) + +## Prioritize labels + +>**Notes:** + - This feature was introduced in GitLab 8.9. + - Priority sorting is based on the highest priority label only. This might + change in the future, follow the discussion in + https://gitlab.com/gitlab-org/gitlab-ce/issues/18554. + +Prioritized labels are like any other label, but sorted by priority. This allows +you to sort issues and merge requests by priority. + +To prioritize labels, navigate to your project's **Issues > Labels** and click +on the star icon next to them to put them in the priority list. Click on the +star icon again to remove them from the list. + +From there, you can drag them around to set the desired priority. Priority is +set from high to low with an ascending order. Labels with no priority, count as +having their priority set to null. + +![Prioritize labels](img/labels_prioritize.png) + +Now that you have labels prioritized, you can use the 'Priority' filter in the +issues or merge requests tracker. Those with the highest priority label, will +appear on top. + +![Filter labels by priority](img/labels_filter_by_priority.png) + +## Subscribe to labels + +If you don’t want to miss issues or merge requests that are important to you, +simply subscribe to a label. You’ll get notified whenever the label gets added +to an issue or merge request, making sure you don’t miss a thing. + +Go to your project's **Issues > Labels** area, find the label(s) you want to +subscribe to and click on the eye icon. Click again to unsubscribe. + +![Subscribe to labels](img/labels_subscribe.png) + +If you work on a large or popular project, try subscribing only to the labels +that are relevant to you. You’ll notice it’ll be much easier to focus on what’s +important. + +## Create a new label right from the issue tracker + +>**Note:** +This feature was introduced in GitLab 8.6. + +There are times when you are already in the issue tracker searching for a +label, only to realize it doesn't exist. Instead of going to the **Labels** +page and being distracted from your original purpose, you can create new +labels on the fly. + +Select **Create new** from the labels dropdown list, provide a name, pick a +color and hit **Create**. + +![Create new label on the fly](img/labels_new_label_on_the_fly_create.png) +![New label on the fly](img/labels_new_label_on_the_fly.png) + +## Assigning labels to issues and merge requests + +There are generally two ways to assign a label to an issue or merge request. + +You can assign a label when you first create or edit an issue or merge request. + +![Assign label in new issue](img/labels_assign_label_in_new_issue.png) + +--- + +The second way is by using the right sidebar when inside an issue or merge +request. Expand it and hit **Edit** in the labels area. Start typing the name +of the label you are looking for to narrow down the list, and select it. You +can add more than one labels at once. When done, click outside the sidebar area +for the changes to take effect. + +![Assign label in sidebar](img/labels_assign_label_sidebar.png) +![Save labels in sidebar](img/labels_assign_label_sidebar_saved.png) + +--- + +To remove labels, expand the left sidebar and unmark them from the labels list. +Simple as that. + +## Use labels to filter issues + +Once you start adding labels to your issues, you'll see the benefit of it. +Labels can have several uses, one of them being the quick filtering of issues +or merge requests. + +Pick an existing label from the dropdown _Label_ menu or click on an existing +label from the issue tracker. In the latter case, you also get to see the +label description like shown below. + +![Filter labels](img/labels_filter.png) + +--- + +And if you added a description to your label, you can see it by hovering your +mouse over the label in the issue tracker or wherever else the label is +rendered. + +![Label tooltips](img/labels_description_tooltip.png) + diff --git a/doc/user/project/settings/img/import_export_download_export.png b/doc/user/project/settings/img/import_export_download_export.png Binary files differnew file mode 100644 index 00000000000..a2f7f0085c1 --- /dev/null +++ b/doc/user/project/settings/img/import_export_download_export.png diff --git a/doc/user/project/settings/img/import_export_export_button.png b/doc/user/project/settings/img/import_export_export_button.png Binary files differnew file mode 100644 index 00000000000..1f7bdd21b0d --- /dev/null +++ b/doc/user/project/settings/img/import_export_export_button.png diff --git a/doc/user/project/settings/img/import_export_mail_link.png b/doc/user/project/settings/img/import_export_mail_link.png Binary files differnew file mode 100644 index 00000000000..c123f83eb8e --- /dev/null +++ b/doc/user/project/settings/img/import_export_mail_link.png diff --git a/doc/user/project/settings/img/import_export_new_project.png b/doc/user/project/settings/img/import_export_new_project.png Binary files differnew file mode 100644 index 00000000000..b3a7f201018 --- /dev/null +++ b/doc/user/project/settings/img/import_export_new_project.png diff --git a/doc/user/project/settings/img/import_export_select_file.png b/doc/user/project/settings/img/import_export_select_file.png Binary files differnew file mode 100644 index 00000000000..f31832af3e1 --- /dev/null +++ b/doc/user/project/settings/img/import_export_select_file.png diff --git a/doc/user/project/settings/img/settings_edit_button.png b/doc/user/project/settings/img/settings_edit_button.png Binary files differnew file mode 100644 index 00000000000..3c0cee536de --- /dev/null +++ b/doc/user/project/settings/img/settings_edit_button.png diff --git a/doc/user/project/settings/import_export.md b/doc/user/project/settings/import_export.md new file mode 100644 index 00000000000..38e9786123d --- /dev/null +++ b/doc/user/project/settings/import_export.md @@ -0,0 +1,73 @@ +# Project import/export + +>**Notes:** + - This feature was [introduced][ce-3050] in GitLab 8.9 + - Importing will not be possible if the import instance version is lower + than that of the exporter. + - For existing installations, the project import option has to be enabled in + application settings (`/admin/application_settings`) under 'Import sources'. + Ask your administrator if you don't see the **GitLab export** button when + creating a new project. + - You can find some useful raketasks if you are an administrator in the + [import_export](../../../administration/raketasks/project_import_export.md) + raketask. + - The exports are stored in a temporary [shared directory][tmp] and are deleted + every 24 hours by a specific worker. + +Existing projects running on any GitLab instance or GitLab.com can be exported +with all their related data and be moved into a new GitLab instance. + +## Exported contents + +The following items will be exported: + +- Project and wiki repositories +- Project uploads +- Project configuration including web hooks and services +- Issues with comments, merge requests with diffs and comments, labels, milestones, snippets, + and other project entities + +The following items will NOT be exported: + +- Build traces and artifacts +- LFS objects + +## Exporting a project and its data + +1. Go to the project settings page by clicking on **Edit Project**: + + ![Project settings button](img/settings_edit_button.png) + +1. Scroll down to find the **Export project** button: + + ![Export button](img/import_export_export_button.png) + +1. Once the export is generated, you should receive an e-mail with a link to + download the file: + + ![Email download link](img/import_export_mail_link.png) + +1. Alternatively, you can come back to the project settings and download the + file from there, or generate a new export. Once the file available, the page + should show the **Download export** button: + + ![Download export](img/import_export_download_export.png) + +## Importing the project + +1. The new GitLab project import feature is at the far right of the import + options when creating a New Project. Make sure you are in the right namespace + and you have entered a project name. Click on **GitLab export**: + + ![New project](img/import_export_new_project.png) + +1. You can see where the project will be imported to. You can now select file + exported previously: + + ![Select file](img/import_export_select_file.png) + +1. Click on **Import project** to begin importing. Your newly imported project + page will appear soon. + +[ce-3050]: https://gitlab.com/gitlab-org/gitlab-ce/issues/3050 +[tmp]: ../../../development/shared_files.md diff --git a/doc/workflow/README.md b/doc/workflow/README.md index 9efe41308dc..ddb2f7281b1 100644 --- a/doc/workflow/README.md +++ b/doc/workflow/README.md @@ -7,7 +7,7 @@ - [Groups](groups.md) - [Keyboard shortcuts](shortcuts.md) - [File finder](file_finder.md) -- [Labels](labels.md) +- [Labels](../user/project/labels.md) - [Notification emails](notifications.md) - [Project Features](project_features.md) - [Project forking workflow](forking_workflow.md) diff --git a/doc/workflow/award_emoji.md b/doc/workflow/award_emoji.md index 70b35c58be6..e6f8b792707 100644 --- a/doc/workflow/award_emoji.md +++ b/doc/workflow/award_emoji.md @@ -1,28 +1,26 @@ -# Award emojis +# Award emoji >**Note:** This feature was [introduced][1825] in GitLab 8.2. When you're collaborating online, you get fewer opportunities for high-fives -and thumbs-ups. In order to make virtual celebrations easier, you can now vote -on issues and merge requests using emoji! +and thumbs-ups. Emoji can be awarded to issues and merge requests, making +virtual celebrations easier. ![Award emoji](img/award_emoji_select.png) -This makes it much easier to give and receive feedback, without a long comment -thread. Any comment that contains only the thumbs up or down emojis is -converted to a vote and depicted in the emoji area. - -You can then use that functionality to sort issues and merge requests based on -popularity. +Award emoji make it much easier to give and receive feedback without a long +comment thread. Comments that are only emoji will automatically become +award emoji. ## Sort issues and merge requests on vote count >**Note:** This feature was [introduced][2871] in GitLab 8.5. -You can quickly sort the issues or merge requests by the number of votes they -have received. The sort option can be found in the right dropdown menu. +You can quickly sort issues and merge requests by the number of votes they +have received. The sort options can be found in the dropdown menu as "Most +popular" and "Least popular". ![Votes sort options](img/award_emoji_votes_sort_options.png) @@ -40,9 +38,28 @@ Sort by least popular issues/merge requests. --- -The number of upvotes and downvotes is not summed up. That means that an issue -with 18 upvotes and 5 downvotes is considered more popular than an issue with -17 upvotes and no downvotes. +The total number of votes is not summed up. An issue with 18 upvotes and 5 +downvotes is considered more popular than an issue with 17 upvotes and no +downvotes. + +## Award emoji for comments + +>**Note:** +This feature was [introduced][4291] in GitLab 8.9. + +Award emoji can also be applied to individual comments when you want to +celebrate an accomplishment or agree with an opinion. + +To add an award emoji, click the smile in the top right of the comment and pick +an emoji from the dropdown. + +![Picking an emoji for a comment](img/award_emoji_comment_picker.png) + +![An award emoji has been applied to a comment](img/award_emoji_comment_awarded.png) + +If you want to remove an award emoji, just click the emoji again and the vote +will be removed. [2871]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2781 [1825]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/1825 +[4291]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4291 diff --git a/doc/workflow/award_emoji.png b/doc/workflow/award_emoji.png Binary files differindex fb26ee04393..3408ed95841 100644 --- a/doc/workflow/award_emoji.png +++ b/doc/workflow/award_emoji.png diff --git a/doc/workflow/img/award_emoji_comment_awarded.png b/doc/workflow/img/award_emoji_comment_awarded.png Binary files differnew file mode 100644 index 00000000000..67697831869 --- /dev/null +++ b/doc/workflow/img/award_emoji_comment_awarded.png diff --git a/doc/workflow/img/award_emoji_comment_picker.png b/doc/workflow/img/award_emoji_comment_picker.png Binary files differnew file mode 100644 index 00000000000..d9c3faecdca --- /dev/null +++ b/doc/workflow/img/award_emoji_comment_picker.png diff --git a/doc/workflow/img/todo_list_item.png b/doc/workflow/img/todo_list_item.png Binary files differnew file mode 100644 index 00000000000..884ba1d22a3 --- /dev/null +++ b/doc/workflow/img/todo_list_item.png diff --git a/doc/workflow/img/todos_add_todo_sidebar.png b/doc/workflow/img/todos_add_todo_sidebar.png Binary files differnew file mode 100644 index 00000000000..126ecc2c82f --- /dev/null +++ b/doc/workflow/img/todos_add_todo_sidebar.png diff --git a/doc/workflow/img/todos_icon.png b/doc/workflow/img/todos_icon.png Binary files differindex 879b3b51c21..a63bad0c258 100644 --- a/doc/workflow/img/todos_icon.png +++ b/doc/workflow/img/todos_icon.png diff --git a/doc/workflow/img/todos_mark_done_sidebar.png b/doc/workflow/img/todos_mark_done_sidebar.png Binary files differnew file mode 100644 index 00000000000..f449f977dd6 --- /dev/null +++ b/doc/workflow/img/todos_mark_done_sidebar.png diff --git a/doc/workflow/labels.md b/doc/workflow/labels.md index 6e4840ca5ae..5c09891dfdd 100644 --- a/doc/workflow/labels.md +++ b/doc/workflow/labels.md @@ -1,18 +1,3 @@ # Labels -In GitLab, you can easily tag issues and Merge Requests. If you have permission level `Developer` or higher, you can manage labels. To create, edit or delete a label, go to a project and then to `Issues` and then `Labels`. - -Here you can create a new label. - -![new label](labels/label1.png) - -You can choose to set a color. - -![label color](labels/label2.png) - -If you want to change an existing label, press edit next to the listed label. -You will be presented with the same form as when creating a new label. - -![edit label](labels/label3.png) - -You can add labels to Merge Requests when you create or edit them. +This document was moved to [user/project/labels.md](../user/project/labels.md). diff --git a/doc/workflow/labels/label1.png b/doc/workflow/labels/label1.png Binary files differdeleted file mode 100644 index cac661a34c8..00000000000 --- a/doc/workflow/labels/label1.png +++ /dev/null diff --git a/doc/workflow/labels/label2.png b/doc/workflow/labels/label2.png Binary files differdeleted file mode 100644 index 44d9fef86d4..00000000000 --- a/doc/workflow/labels/label2.png +++ /dev/null diff --git a/doc/workflow/labels/label3.png b/doc/workflow/labels/label3.png Binary files differdeleted file mode 100644 index e2fce11b7a4..00000000000 --- a/doc/workflow/labels/label3.png +++ /dev/null diff --git a/doc/workflow/todos.md b/doc/workflow/todos.md index 5f440fdafdd..9524ffd5420 100644 --- a/doc/workflow/todos.md +++ b/doc/workflow/todos.md @@ -1,4 +1,4 @@ -# GitLab ToDos +# GitLab Todos >**Note:** This feature was [introduced][ce-2817] in GitLab 8.5. @@ -14,8 +14,9 @@ in a simple dashboard. --- -You can access quickly your Todos dashboard by clicking the round gray icon -next to the search bar in the upper right corner. +You can quickly access the Todos dashboard using the bell icon next to the +search bar in the upper right corner. The number in blue is the number of Todos +you still have open. ![Todos icon](img/todos_icon.png) @@ -29,45 +30,61 @@ A Todo appears in your Todos dashboard when: >**Note:** Commenting on a commit will _not_ trigger a Todo. -## How a Todo is marked as Done +### Manually creating a Todo + +You can also add an issue or merge request to your Todos dashboard by clicking +the "Add Todo" button in the issue or merge request sidebar. + +![Adding a Todo from the issuable sidebar](img/todos_add_todo_sidebar.png) + +## Marking a Todo as done Any action to the corresponding issue or merge request will mark your Todo as -**Done**. This action can include: +**Done**. Actions that dismiss Todos include: - changing the assignee - changing the milestone - adding/removing a label - commenting on the issue -In case where you think no action is needed, you can manually mark the todo as -done by clicking the corresponding **Done** button, and it will disappear from -your Todos list. If you want to mark all your Todos as done, just click on the -**Mark all as done** button. - --- -In order for a Todo to be marked as done, the action must be coming from you. -So, if you close the related issue or merge the merge request yourself, and you -had a Todo for that, it will automatically get marked as done. On the other -hand, if someone else closes, merges or takes action on the issue or merge -request, your Todo will remain pending. This makes sense because you may need -to give attention to an issue even if it has been resolved. +Todos are personal, and they're only marked as done if the action is coming from +you. If you close the issue or merge request, your Todo will automatically +be marked as done. + +If someone else closes, merges, or takes action on the issue or merge +request, your Todo will remain pending. This prevents other users from closing issues without you being notified. There is just one Todo per issue or merge request, so mentioning a user a hundred times in an issue will only trigger one Todo. +--- + +If no action is needed, you can manually mark the Todo as done by clicking the +corresponding **Done** button, and it will disappear from your Todo list. + +![A Todo in the Todos dashboard](img/todo_list_item.png) + +A Todo can also be marked as done from the issue or merge request sidebar using +the "Mark Done" button. + +![Mark Done from the issuable sidebar](img/todos_mark_done_sidebar.png) + +You can mark all your Todos as done at once by clicking on the **Mark all as +done** button. + ## Filtering your Todos -In general, there are four kinds of filters you can use on your Todos -dashboard: +There are four kinds of filters you can use on your Todos dashboard. -| Filter | Description | -| ------ | ----------- | +| Filter | Description | +| ------- | ----------- | | Project | Filter by project | | Author | Filter by the author that triggered the Todo | | Type | Filter by issue or merge request | | Action | Filter by the action that triggered the Todo (Assigned or Mentioned)| -You can choose more than one filters at the same time. +You can also filter by more than one of these at the same time. [ce-2817]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2817 diff --git a/lib/banzai/filter/issue_reference_filter.rb b/lib/banzai/filter/issue_reference_filter.rb index 2614261f9eb..5351272f42d 100644 --- a/lib/banzai/filter/issue_reference_filter.rb +++ b/lib/banzai/filter/issue_reference_filter.rb @@ -31,10 +31,14 @@ module Banzai projects_per_reference.each do |path, project| issue_ids = references_per_project[path] - next unless project.default_issues_tracker? + if project.default_issues_tracker? + issues = project.issues.where(iid: issue_ids.to_a) + else + issues = issue_ids.map { |id| ExternalIssue.new(id, project) } + end - project.issues.where(iid: issue_ids.to_a).each do |issue| - hash[project][issue.iid] = issue + issues.each do |issue| + hash[project][issue.iid.to_i] = issue end end diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index b872780f20a..92bf7e0a2fc 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -12,6 +12,8 @@ module Gitlab USER_REFERENCES = %w[author_id assignee_id updated_by_id user_id].freeze + BUILD_MODELS = %w[Ci::Build commit_status].freeze + def self.create(*args) new(*args).create end @@ -70,7 +72,7 @@ module Gitlab end def generate_imported_object - if @relation_sym == 'commit_status' # call #trace= method after assigning the other attributes + if BUILD_MODELS.include?(@relation_name) # call #trace= method after assigning the other attributes trace = @relation_hash.delete('trace') imported_object do |object| object.trace = trace diff --git a/lib/gitlab/metrics/sidekiq_middleware.rb b/lib/gitlab/metrics/sidekiq_middleware.rb index fd98aa3412e..a1240fd33ee 100644 --- a/lib/gitlab/metrics/sidekiq_middleware.rb +++ b/lib/gitlab/metrics/sidekiq_middleware.rb @@ -8,6 +8,8 @@ module Gitlab trans = Transaction.new("#{worker.class.name}#perform") begin + # Old gitlad-shell messages don't provide enqueued_at/created_at attributes + trans.set(:sidekiq_queue_duration, Time.now.to_f - (message['enqueued_at'] || message['created_at'] || 0)) trans.run { yield } ensure trans.finish diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index 78f3ecb4cb4..7af75a9cc4c 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -74,7 +74,7 @@ module Gitlab if user # Case when a LDAP user already exists in Gitlab. Add the OAuth identity to existing account. log.info "LDAP account found for user #{user.username}. Building new #{auth_hash.provider} identity." - user.identities.build(extern_uid: auth_hash.uid, provider: auth_hash.provider) + user.identities.find_or_initialize_by(extern_uid: auth_hash.uid, provider: auth_hash.provider) else log.info "No existing LDAP account was found in GitLab. Checking for #{auth_hash.provider} account." user = find_by_uid_and_provider diff --git a/lib/tasks/gitlab/import_export.rake b/lib/tasks/gitlab/import_export.rake new file mode 100644 index 00000000000..c2c6031db67 --- /dev/null +++ b/lib/tasks/gitlab/import_export.rake @@ -0,0 +1,13 @@ +namespace :gitlab do + namespace :import_export do + desc "GitLab | Show Import/Export version" + task version: :environment do + puts "Import/Export v#{Gitlab::ImportExport.version}" + end + + desc "GitLab | Display exported DB structure" + task data: :environment do + puts YAML.load_file(Gitlab::ImportExport.config_file)['project_tree'].to_yaml(:SortKeys => true) + end + end +end diff --git a/spec/features/security/project/internal_access_spec.rb b/spec/features/security/project/internal_access_spec.rb index 8625ea6bc10..13d980a326f 100644 --- a/spec/features/security/project/internal_access_spec.rb +++ b/spec/features/security/project/internal_access_spec.rb @@ -288,4 +288,142 @@ describe "Internal Project Access", feature: true do it { is_expected.to be_denied_for :external } it { is_expected.to be_denied_for :visitor } end + + describe "GET /:project_path/pipelines" do + subject { namespace_project_pipelines_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/pipelines/:id" do + let(:pipeline) { create(:ci_pipeline, project: project) } + subject { namespace_project_pipeline_path(project.namespace, project, pipeline) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/builds" do + subject { namespace_project_builds_path(project.namespace, project) } + + context "when allowed for public and internal" do + before { project.update(public_builds: true) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + context "when disallowed for public and internal" do + before { project.update(public_builds: false) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + end + + describe "GET /:project_path/builds/:id" do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + subject { namespace_project_build_path(project.namespace, project, build.id) } + + context "when allowed for public and internal" do + before { project.update(public_builds: true) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + context "when disallowed for public and internal" do + before { project.update(public_builds: false) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + end + + describe "GET /:project_path/environments" do + subject { namespace_project_environments_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/environments/:id" do + let(:environment) { create(:environment, project: project) } + subject { namespace_project_environment_path(project.namespace, project, environment) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/environments/new" do + subject { new_namespace_project_environment_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_denied_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end end diff --git a/spec/features/security/project/private_access_spec.rb b/spec/features/security/project/private_access_spec.rb index 544270b4037..ac9690cc127 100644 --- a/spec/features/security/project/private_access_spec.rb +++ b/spec/features/security/project/private_access_spec.rb @@ -260,4 +260,106 @@ describe "Private Project Access", feature: true do it { is_expected.to be_denied_for :external } it { is_expected.to be_denied_for :visitor } end + + describe "GET /:project_path/pipelines" do + subject { namespace_project_pipelines_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/pipelines/:id" do + let(:pipeline) { create(:ci_pipeline, project: project) } + subject { namespace_project_pipeline_path(project.namespace, project, pipeline) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/builds" do + subject { namespace_project_builds_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/builds/:id" do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:build) { create(:ci_build, pipeline: pipeline) } + subject { namespace_project_build_path(project.namespace, project, build.id) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/environments" do + subject { namespace_project_environments_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/environments/:id" do + let(:environment) { create(:environment, project: project) } + subject { namespace_project_environment_path(project.namespace, project, environment) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end + + describe "GET /:project_path/environments/new" do + subject { new_namespace_project_environment_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_denied_for reporter } + it { is_expected.to be_denied_for guest } + it { is_expected.to be_denied_for :user } + it { is_expected.to be_denied_for :external } + it { is_expected.to be_denied_for :visitor } + end end diff --git a/spec/features/security/project/public_access_spec.rb b/spec/features/security/project/public_access_spec.rb index f6c6687e162..737897de52b 100644 --- a/spec/features/security/project/public_access_spec.rb +++ b/spec/features/security/project/public_access_spec.rb @@ -109,6 +109,35 @@ describe "Public Project Access", feature: true do it { is_expected.to be_allowed_for :external } end + describe "GET /:project_path/pipelines" do + subject { namespace_project_pipelines_path(project.namespace, project) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_allowed_for :external } + it { is_expected.to be_allowed_for :visitor } + end + + describe "GET /:project_path/pipelines/:id" do + let(:pipeline) { create(:ci_pipeline, project: project) } + subject { namespace_project_pipeline_path(project.namespace, project, pipeline) } + + it { is_expected.to be_allowed_for :admin } + it { is_expected.to be_allowed_for owner } + it { is_expected.to be_allowed_for master } + it { is_expected.to be_allowed_for developer } + it { is_expected.to be_allowed_for reporter } + it { is_expected.to be_allowed_for guest } + it { is_expected.to be_allowed_for :user } + it { is_expected.to be_allowed_for :external } + it { is_expected.to be_allowed_for :visitor } + end + describe "GET /:project_path/builds" do subject { namespace_project_builds_path(project.namespace, project) } @@ -191,7 +220,7 @@ describe "Public Project Access", feature: true do describe "GET /:project_path/environments/:id" do let(:environment) { create(:environment, project: project) } - subject { namespace_project_environments_path(project.namespace, project, environment) } + subject { namespace_project_environment_path(project.namespace, project, environment) } it { is_expected.to be_allowed_for :admin } it { is_expected.to be_allowed_for owner } diff --git a/spec/lib/banzai/filter/issue_reference_filter_spec.rb b/spec/lib/banzai/filter/issue_reference_filter_spec.rb index 5b63c946114..8d6ce114aa9 100644 --- a/spec/lib/banzai/filter/issue_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/issue_reference_filter_spec.rb @@ -198,4 +198,40 @@ describe Banzai::Filter::IssueReferenceFilter, lib: true do expect(doc.to_html).to match(/\(<a.+>Reference<\/a>\.\)/) end end + + describe '#issues_per_Project' do + context 'using an internal issue tracker' do + it 'returns a Hash containing the issues per project' do + doc = Nokogiri::HTML.fragment('') + filter = described_class.new(doc, project: project) + + expect(filter).to receive(:projects_per_reference). + and_return({ project.path_with_namespace => project }) + + expect(filter).to receive(:references_per_project). + and_return({ project.path_with_namespace => Set.new([issue.iid]) }) + + expect(filter.issues_per_project). + to eq({ project => { issue.iid => issue } }) + end + end + + context 'using an external issue tracker' do + it 'returns a Hash containing the issues per project' do + doc = Nokogiri::HTML.fragment('') + filter = described_class.new(doc, project: project) + + expect(project).to receive(:default_issues_tracker?).and_return(false) + + expect(filter).to receive(:projects_per_reference). + and_return({ project.path_with_namespace => project }) + + expect(filter).to receive(:references_per_project). + and_return({ project.path_with_namespace => Set.new([1]) }) + + expect(filter.issues_per_project[project][1]). + to be_an_instance_of(ExternalIssue) + end + end + end end diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 400d44ac162..403bd582ef3 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -4894,6 +4894,29 @@ "started_at": null, "finished_at": null, "duration": null, + "notes": [ + { + "id": 999, + "note": "Natus rerum qui dolorem dolorum voluptas.", + "noteable_type": "Commit", + "author_id": 1, + "created_at": "2016-03-22T15:19:59.469Z", + "updated_at": "2016-03-22T15:19:59.469Z", + "project_id": 5, + "attachment": { + "url": null + }, + "line_code": null, + "commit_id": "be93687618e4b132087f430a4d8fc3a609c9b77c", + "noteable_id": 36, + "system": false, + "st_diff": null, + "updated_by_id": null, + "author": { + "name": "Administrator" + } + } + ], "statuses": [ { "id": 71, diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb index 7a40a43f8ae..23036ab8108 100644 --- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb @@ -18,6 +18,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do it 'restores models based on JSON' do expect(restored_project_json).to be true end + + it 'creates a valid pipeline note' do + restored_project_json + + expect(Ci::Pipeline.first.notes).not_to be_empty + end end end end diff --git a/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb b/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb index e520a968999..4d2aa03e722 100644 --- a/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb @@ -2,6 +2,7 @@ require 'spec_helper' describe Gitlab::Metrics::SidekiqMiddleware do let(:middleware) { described_class.new } + let(:message) { { 'args' => ['test'], 'enqueued_at' => Time.new(2016, 6, 23, 6, 59).to_f } } describe '#call' do it 'tracks the transaction' do @@ -11,9 +12,23 @@ describe Gitlab::Metrics::SidekiqMiddleware do with('TestWorker#perform'). and_call_original + expect_any_instance_of(Gitlab::Metrics::Transaction).to receive(:set).with(:sidekiq_queue_duration, instance_of(Float)) expect_any_instance_of(Gitlab::Metrics::Transaction).to receive(:finish) - middleware.call(worker, 'test', :test) { nil } + middleware.call(worker, message, :test) { nil } + end + + it 'tracks the transaction (for messages without `enqueued_at`)' do + worker = double(:worker, class: double(:class, name: 'TestWorker')) + + expect(Gitlab::Metrics::Transaction).to receive(:new). + with('TestWorker#perform'). + and_call_original + + expect_any_instance_of(Gitlab::Metrics::Transaction).to receive(:set).with(:sidekiq_queue_duration, instance_of(Float)) + expect_any_instance_of(Gitlab::Metrics::Transaction).to receive(:finish) + + middleware.call(worker, {}, :test) { nil } end end end diff --git a/spec/lib/gitlab/saml/user_spec.rb b/spec/lib/gitlab/saml/user_spec.rb index 84c21ceefd9..2753aecc1f4 100644 --- a/spec/lib/gitlab/saml/user_spec.rb +++ b/spec/lib/gitlab/saml/user_spec.rb @@ -164,7 +164,14 @@ describe Gitlab::Saml::User, lib: true do end context 'and LDAP user has an account already' do - let!(:existing_user) { create(:omniauth_user, email: 'john@mail.com', extern_uid: 'uid=user1,ou=People,dc=example', provider: 'ldapmain', username: 'john') } + before do + create(:omniauth_user, + email: 'john@mail.com', + extern_uid: 'uid=user1,ou=People,dc=example', + provider: 'ldapmain', + username: 'john') + end + it 'adds the omniauth identity to the LDAP account' do saml_user.save @@ -177,6 +184,15 @@ describe Gitlab::Saml::User, lib: true do { provider: 'saml', extern_uid: uid } ]) end + + it 'saves successfully on subsequent tries, when both identities are present' do + saml_user.save + local_saml_user = described_class.new(auth_hash) + local_saml_user.save + + expect(local_saml_user.gl_user).to be_valid + expect(local_saml_user.gl_user).to be_persisted + end end context 'user has SAML user, and wants to add their LDAP identity' do diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index efbcbf72f76..89730ab8eb8 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -154,6 +154,20 @@ describe Issue, "Issuable" do expect(issues).to match_array([issue1, issue2, issue, issue3]) end end + + context 'when all of the results are level on the sort key' do + let!(:issues) do + 10.times { create(:issue, project: project) } + end + + it 'has no duplicates across pages' do + sorted_issue_ids = 1.upto(10).map do |i| + project.issues.sort('milestone_due_desc').page(i).per(1).first.id + end + + expect(sorted_issue_ids).to eq(sorted_issue_ids.uniq) + end + end end |