diff options
34 files changed, 881 insertions, 290 deletions
diff --git a/app/assets/javascripts/locale/bg/app.js b/app/assets/javascripts/locale/bg/app.js new file mode 100644 index 00000000000..ba56c0bea25 --- /dev/null +++ b/app/assets/javascripts/locale/bg/app.js @@ -0,0 +1 @@ +var locales = locales || {}; locales['bg'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","POT-Creation-Date":"2017-05-04 19:24-0500","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","PO-Revision-Date":"2017-06-05 09:40-0400","Last-Translator":"Lyubomir Vasilev <lyubomirv@abv.bg>","Language-Team":"Bulgarian","Language":"bg","X-Generator":"Zanata 3.9.6","Plural-Forms":"nplurals=2; plural=(n != 1)","lang":"bg","domain":"app","plural_forms":"nplurals=2; plural=(n != 1)"},"ByAuthor|by":["от"],"Commit":["Подаване","Подавания"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["Анализът на циклите дава общ поглед върху това колко време е нужно на една идея да се превърне в завършена функционалност в проекта."],"CycleAnalyticsStage|Code":["Програмиране"],"CycleAnalyticsStage|Issue":["Проблем"],"CycleAnalyticsStage|Plan":["Планиране"],"CycleAnalyticsStage|Production":["Издаване"],"CycleAnalyticsStage|Review":["Преглед и одобрение"],"CycleAnalyticsStage|Staging":["Подготовка за издаване"],"CycleAnalyticsStage|Test":["Тестване"],"Deploy":["Внедряване","Внедрявания"],"FirstPushedBy|First":["Първо"],"FirstPushedBy|pushed by":["изпращане на промени от"],"From issue creation until deploy to production":["От създаването на проблема до внедряването в крайната версия"],"From merge request merge until deploy to production":["От прилагането на заявката за сливане до внедряването в крайната версия"],"Introducing Cycle Analytics":["Представяме Ви анализът на циклите"],"Last %d day":["Последния %d ден","Последните %d дни"],"Limited to showing %d event at most":["Ограничено до показване на последното %d събитие","Ограничено до показване на последните %d събития"],"Median":["Медиана"],"New Issue":["Нов проблем","Нови проблема"],"Not available":["Не е налично"],"Not enough data":["Няма достатъчно данни"],"OpenedNDaysAgo|Opened":["Отворен"],"Pipeline Health":["Състояние"],"ProjectLifecycle|Stage":["Етап"],"Read more":["Прочетете повече"],"Related Commits":["Свързани подавания"],"Related Deployed Jobs":["Свързани задачи за внедряване"],"Related Issues":["Свързани проблеми"],"Related Jobs":["Свързани задачи"],"Related Merge Requests":["Свързани заявки за сливане"],"Related Merged Requests":["Свързани приложени заявки за сливане"],"Showing %d event":["Показване на %d събитие","Показване на %d събития"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["Етапът на програмиране показва времето от първото подаване до създаването на заявката за сливане. Данните ще бъдат добавени тук автоматично след като бъде създадена първата заявка за сливане."],"The collection of events added to the data gathered for that stage.":["Съвкупността от събития добавени към данните събрани за този етап."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["Етапът на проблемите показва колко е времето от създаването на проблем до определянето на целеви етап на проекта за него, или до добавянето му в списък на дъската за проблеми. Започнете да добавяте проблеми, за да видите данните за този етап."],"The phase of the development lifecycle.":["Етапът от цикъла на разработка"],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["Етапът на планиране показва колко е времето от преходната стъпка до изпращането на първото подаване. Това време ще бъде добавено автоматично след като изпратите първото си подаване."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["Етапът на издаване показва общото време, което е нужно от създаването на проблем до внедряването на кода в крайната версия."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["Етапът на преглед и одобрение показва времето от създаването на заявката за сливане до прилагането ѝ. Данните ще бъдат добавени автоматично след като приложите първата си заявка за сливане."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["Етапът на подготовка за издаване показва времето между прилагането на заявката за сливане и внедряването на кода в средата на работещата крайна версия. Данните ще бъдат добавени автоматично след като направите първото си внедряване в крайната версия."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["Етапът на тестване показва времето, което е нужно на „Gitlab CI“ да изпълни всички задачи за свързаната заявка за сливане. Данните ще бъдат добавени автоматично след като приключи изпълнените на първата Ви такава задача."],"The time taken by each data entry gathered by that stage.":["Времето, което отнема всеки запис от данни за съответния етап."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["Стойността, която се намира в средата на последователността от наблюдавани данни. Например: медианата на 3, 5 и 9 е 5, а медианата на 3, 5, 7 и 8 е (5+7)/2 = 6."],"Time before an issue gets scheduled":["Време преди един проблем да бъде планиран за работа"],"Time before an issue starts implementation":["Време преди работата по проблем да започне"],"Time between merge request creation and merge/close":["Време между създаване на заявка за сливане и прилагането/отхвърлянето ѝ"],"Time until first merge request":["Време преди първата заявка за сливане"],"Time|hr":["час","часа"],"Time|min":["мин","мин"],"Time|s":["сек"],"Total Time":["Общо време"],"Total test time for all commits/merges":["Общо време за тестване на всички подавания/сливания"],"Want to see the data? Please ask an administrator for access.":["Искате ли да видите данните? Помолете администратор за достъп."],"We don't have enough data to show this stage.":["Няма достатъчно данни за този етап."],"You need permission.":["Нуждаете се от разрешение."],"day":["ден","дни"]}}};
\ No newline at end of file diff --git a/app/assets/javascripts/locale/pt_BR/app.js b/app/assets/javascripts/locale/pt_BR/app.js new file mode 100644 index 00000000000..f2eed3da064 --- /dev/null +++ b/app/assets/javascripts/locale/pt_BR/app.js @@ -0,0 +1 @@ +var locales = locales || {}; locales['pt_BR'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","POT-Creation-Date":"2017-05-04 19:24-0500","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","PO-Revision-Date":"2017-06-05 03:29-0400","Last-Translator":"Alexandre Alencar <alexandre.alencar@gmail.com>","Language-Team":"Portuguese (Brazil)","Language":"pt-BR","X-Generator":"Zanata 3.9.6","Plural-Forms":"nplurals=2; plural=(n != 1)","lang":"pt_BR","domain":"app","plural_forms":"nplurals=2; plural=(n != 1)"},"ByAuthor|by":["por"],"Commit":["Commit","Commits"],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":["A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora para ir para produção em seu projeto."],"CycleAnalyticsStage|Code":["Código"],"CycleAnalyticsStage|Issue":["Tarefa"],"CycleAnalyticsStage|Plan":["Plano"],"CycleAnalyticsStage|Production":["Produção"],"CycleAnalyticsStage|Review":["Revisão"],"CycleAnalyticsStage|Staging":["Homologação"],"CycleAnalyticsStage|Test":["Teste"],"Deploy":["Implantação","Implantações"],"FirstPushedBy|First":["Primeiro"],"FirstPushedBy|pushed by":["publicado por"],"From issue creation until deploy to production":["Da criação de tarefas até a implantação para a produção"],"From merge request merge until deploy to production":["Da incorporação do merge request até a implantação em produção"],"Introducing Cycle Analytics":["Apresentando a Análise de Ciclo"],"Last %d day":["Último %d dia","Últimos %d dias"],"Limited to showing %d event at most":["Limitado a mostrar %d evento no máximo","Limitado a mostrar %d eventos no máximo"],"Median":["Mediana"],"New Issue":["Nova Tarefa","Novas Tarefas"],"Not available":["Não disponível"],"Not enough data":["Dados insuficientes"],"OpenedNDaysAgo|Opened":["Aberto"],"Pipeline Health":["Saúde da Pipeline"],"ProjectLifecycle|Stage":["Etapa"],"Read more":["Ler mais"],"Related Commits":["Commits Relacionados"],"Related Deployed Jobs":["Jobs Relacionados Incorporados"],"Related Issues":["Tarefas Relacionadas"],"Related Jobs":["Jobs Relacionados"],"Related Merge Requests":["Merge Requests Relacionados"],"Related Merged Requests":["Merge Requests Relacionados"],"Showing %d event":["Mostrando %d evento","Mostrando %d eventos"],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":["O estágio de codificação mostra o tempo desde o primeiro commit até a criação do merge request. \\nOs dados serão automaticamente adicionados aqui uma vez que você tenha criado seu primeiro merge request."],"The collection of events added to the data gathered for that stage.":["A coleção de eventos adicionados aos dados coletados para esse estágio."],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":["O estágio em questão mostra o tempo que leva desde a criação de uma tarefa até a sua assinatura para um milestone, ou a sua adição para a lista no seu Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa."],"The phase of the development lifecycle.":["A fase do ciclo de vida do desenvolvimento."],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":["A fase de planejamento mostra o tempo do passo anterior até empurrar o seu primeiro commit. Este tempo será adicionado automaticamente assim que você realizar seu primeiro commit."],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":["O estágio de produção mostra o tempo total que leva entre criar uma tarefa e implantar o código na produção. Os dados serão adicionados automaticamente até que você complete todo o ciclo de produção."],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":["A etapa de revisão mostra o tempo de criação de um merge request até que o merge seja feito. Os dados serão automaticamente adicionados depois que você fizer seu primeiro merge request."],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":["O estágio de estágio mostra o tempo entre a fusão do MR e o código de implantação para o ambiente de produção. Os dados serão automaticamente adicionados depois de implantar na produção pela primeira vez."],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":["A fase de teste mostra o tempo que o GitLab CI leva para executar cada pipeline para o merge request relacionado. Os dados serão automaticamente adicionados após a conclusão do primeiro pipeline."],"The time taken by each data entry gathered by that stage.":["O tempo necessário para cada entrada de dados reunida por essa etapa."],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":["O valor situado no ponto médio de uma série de valores observados. Ex., entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6."],"Time before an issue gets scheduled":["Tempo até que uma tarefa seja planejada"],"Time before an issue starts implementation":["Tempo até que uma tarefa comece a ser implementada"],"Time between merge request creation and merge/close":["Tempo entre a criação do merge request e o merge/fechamento"],"Time until first merge request":["Tempo até o primeiro merge request"],"Time|hr":["h","hs"],"Time|min":["min","mins"],"Time|s":["s"],"Total Time":["Tempo Total"],"Total test time for all commits/merges":["Tempo de teste total para todos os commits/merges"],"Want to see the data? Please ask an administrator for access.":["Precisa visualizar os dados? Solicite acesso ao administrador."],"We don't have enough data to show this stage.":["Não temos dados suficientes para mostrar esta fase."],"You need permission.":["Você precisa de permissão."],"day":["dia","dias"]}}};
\ No newline at end of file diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 4f53929a308..d8d14ea1fed 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -93,9 +93,11 @@ class Projects::BlobController < Projects::ApplicationController def diff apply_diff_view_cookie! - @form = UnfoldForm.new(params) - @lines = Gitlab::Highlight.highlight_lines(repository, @ref, @path) - @lines = @lines[@form.since - 1..@form.to - 1] + @blob.load_all_data! + @lines = Gitlab::Highlight.highlight(@blob.path, @blob.data, repository: @repository).lines + + @form = UnfoldForm.new(params) + @lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe) if @form.bottom? @match_line = '' diff --git a/app/controllers/projects/labels_controller.rb b/app/controllers/projects/labels_controller.rb index ac151839f61..1beac202efe 100644 --- a/app/controllers/projects/labels_controller.rb +++ b/app/controllers/projects/labels_controller.rb @@ -8,7 +8,7 @@ class Projects::LabelsController < Projects::ApplicationController before_action :authorize_admin_labels!, only: [:new, :create, :edit, :update, :generate, :destroy, :remove_priority, :set_priorities] - before_action :authorize_admin_group!, only: [:promote] + before_action :authorize_admin_group_labels!, only: [:promote] respond_to :js, :html @@ -161,7 +161,7 @@ class Projects::LabelsController < Projects::ApplicationController return render_404 unless can?(current_user, :admin_label, @project) end - def authorize_admin_group! - return render_404 unless can?(current_user, :admin_group, @project.group) + def authorize_admin_group_labels! + return render_404 unless can?(current_user, :admin_label, @project.group) end end diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml index 59844bc00cd..ec1c434a4b8 100644 --- a/app/views/projects/diffs/_content.html.haml +++ b/app/views/projects/diffs/_content.html.haml @@ -6,7 +6,7 @@ - elsif blob.truncated? .nothing-here-block The file could not be displayed because it is too large. - elsif blob.readable_text? - - if !diff_file.repository.diffable?(blob) + - if !diff_file.diffable? .nothing-here-block This diff was suppressed by a .gitattributes entry. - elsif diff_file.collapsed? - url = url_for(params.merge(action: :diff_for_path, old_path: diff_file.old_path, new_path: diff_file.new_path, file_identifier: diff_file.file_identifier)) diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index bd994cdad01..c185e9b73ee 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -64,7 +64,7 @@ %a.js-subscribe-button{ data: { url: toggle_subscription_group_label_path(label.group, label) } } Group level - - if label.is_a?(ProjectLabel) && label.project.group && can?(current_user, :admin_group, label.project.group) + - if label.is_a?(ProjectLabel) && label.project.group && can?(current_user, :admin_label, label.project.group) = link_to promote_namespace_project_label_path(label.project.namespace, label.project, label), title: "Promote to Group Label", class: 'btn btn-transparent btn-action', data: {confirm: "Promoting this label will make this label available to all projects inside this group. Existing project labels with the same name will be merged. Are you sure?", toggle: "tooltip"}, method: :post do %span.sr-only Promote to Group = icon('level-up') diff --git a/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml new file mode 100644 index 00000000000..a0e0458da16 --- /dev/null +++ b/changelogs/unreleased/33334-portuguese_brazil_translation_of_cycle_analytics_page.yml @@ -0,0 +1,4 @@ +--- +title: Add Portuguese Brazil of Cycle Analytics Page to I18N +merge_request: 11920 +author:Huang Tao diff --git a/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml b/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml new file mode 100644 index 00000000000..71bd5505be7 --- /dev/null +++ b/changelogs/unreleased/33383-bulgarian_translation_of_cycle_analytics_page.yml @@ -0,0 +1,4 @@ +--- +title: add bulgarian translation of cycle analytics page to I18N +merge_request: 11958 +author: Lyubomir Vasilev diff --git a/changelogs/unreleased/allow-reporters-to-promote-group-labels.yml b/changelogs/unreleased/allow-reporters-to-promote-group-labels.yml new file mode 100644 index 00000000000..2364ce6d068 --- /dev/null +++ b/changelogs/unreleased/allow-reporters-to-promote-group-labels.yml @@ -0,0 +1,4 @@ +--- +title: Allow reporters to promote project labels to group labels +merge_request: +author: diff --git a/doc/ci/runners/README.md b/doc/ci/runners/README.md index 1bd1ee93ac5..73aee3c3f56 100644 --- a/doc/ci/runners/README.md +++ b/doc/ci/runners/README.md @@ -1,124 +1,168 @@ # Runners -In GitLab CI, Runners run your [yaml](../yaml/README.md). -A Runner is an isolated (virtual) machine that picks up jobs -through the coordinator API of GitLab CI. +In GitLab CI, Runners run the code defined in [`.gitlab-ci.yml`](../yaml/README.md). +They are isolated (virtual) machines that pick up jobs through the coordinator +API of GitLab CI. A Runner can be specific to a certain project or serve any project in GitLab CI. A Runner that serves all projects is called a shared Runner. -Ideally, GitLab Runner should not be installed on the same machine as GitLab. +Ideally, the GitLab Runner should not be installed on the same machine as GitLab. Read the [requirements documentation](../../install/requirements.md#gitlab-runner) for more information. -## Shared vs. Specific Runners - -A Runner that is specific only runs for the specified project. A shared Runner -can run jobs for every project that has enabled the option **Allow shared Runners**. - -**Shared Runners** are useful for jobs that have similar requirements, -between multiple projects. Rather than having multiple Runners idling for -many projects, you can have a single or a small number of Runners that handle -multiple projects. This makes it easier to maintain and update Runners. - -**Specific Runners** are useful for jobs that have special requirements or for -projects with a specific demand. If a job has certain requirements, you can set -up the specific Runner with this in mind, while not having to do this for all -Runners. For example, if you want to deploy a certain project, you can setup -a specific Runner to have the right credentials for this. - -Projects with high demand of CI activity can also benefit from using specific Runners. -By having dedicated Runners you are guaranteed that the Runner is not being held -up by another project's jobs. +## Shared vs specific Runners + +After [installing the Runner][install], you can either register it as shared or +specific. You can only register a shared Runner if you have admin access to +the GitLab instance. The main differences between a shared and a specific Runner +are: + +- **Shared Runners** are useful for jobs that have similar requirements, + between multiple projects. Rather than having multiple Runners idling for + many projects, you can have a single or a small number of Runners that handle + multiple projects. This makes it easier to maintain and update them. + Shared Runners process jobs using a [fair usage queue](#how-shared-runners-pick-jobs). + In contrast to specific Runners that use a FIFO queue, this prevents + cases where projects create hundreds of jobs which can lead to eating all + available shared Runners resources. +- **Specific Runners** are useful for jobs that have special requirements or for + projects with a specific demand. If a job has certain requirements, you can set + up the specific Runner with this in mind, while not having to do this for all + Runners. For example, if you want to deploy a certain project, you can setup + a specific Runner to have the right credentials for this. The [usage of tags](#using-tags) + may be useful in this case. Specific Runners process jobs using a [FIFO] queue. + +A Runner that is specific only runs for the specified project(s). A shared Runner +can run jobs for every project that has enabled the option **Allow shared Runners** +under **Settings ➔ Pipelines**. + +Projects with high demand of CI activity can also benefit from using specific +Runners. By having dedicated Runners you are guaranteed that the Runner is not +being held up by another project's jobs. You can set up a specific Runner to be used by multiple projects. The difference with a shared Runner is that you have to enable each project explicitly for the Runner to be able to run its jobs. Specific Runners do not get shared with forked projects automatically. -A fork does copy the CI settings (jobs, allow shared, etc) of the cloned repository. - -# Creating and Registering a Runner - -There are several ways to create a Runner. Only after creation, upon -registration its status as Shared or Specific is determined. - -[See the documentation for](https://docs.gitlab.com/runner/install) -the different methods of installing a Runner instance. +A fork does copy the CI settings (jobs, allow shared, etc) of the cloned +repository. -After installing the Runner, you can either register it as `Shared` or as `Specific`. -You can only register a Shared Runner if you have admin access to the GitLab instance. +## Registering a shared Runner -## Registering a Shared Runner +You can only register a shared Runner if you are an admin of the GitLab instance. -You can only register a shared Runner if you are an admin on the linked -GitLab instance. +1. Grab the shared-Runner token on the `admin/runners` page -Grab the shared-Runner token on the `admin/runners` page of your GitLab CI -instance. +  - +1. [Register the Runner][register] -Now simply register the Runner as any Runner: +Shared Runners are enabled by default as of GitLab 8.2, but can be disabled +with the **Disable shared Runners** button which is present under each project's +**Settings ➔ Pipelines** page. Previous versions of GitLab defaulted shared +Runners to disabled. -``` -sudo gitlab-ci-multi-runner register -``` - -Shared Runners are enabled by default as of GitLab 8.2, but can be disabled with the -`DISABLE SHARED RUNNERS` button. Previous versions of GitLab defaulted shared Runners to -disabled. - -## Registering a Specific Runner +## Registering a specific Runner Registering a specific can be done in two ways: 1. Creating a Runner with the project registration token 1. Converting a shared Runner into a specific Runner (one-way, admin only) -There are several ways to create a Runner instance. The steps below only -concern registering the Runner on GitLab CI. - -### Registering a Specific Runner with a Project Registration token +### Registering a specific Runner with a project registration token To create a specific Runner without having admin rights to the GitLab instance, -visit the project you want to make the Runner work for in GitLab CI. +visit the project you want to make the Runner work for in GitLab: -Click on the Runner tab and use the registration token you find there to -setup a specific Runner for this project. +1. Go to **Settings ➔ Pipelines** to obtain the token +1. [Register the Runner][register] - +### Making an existing shared Runner specific -To register the Runner, run the command below and follow instructions: +If you are an admin on your GitLab instance, you can turn any shared Runner into +a specific one, but not the other way around. Keep in mind that this is a one +way transition. -``` -sudo gitlab-ci-multi-runner register -``` +1. Go to the Runners in the admin area **Overview ➔ Runners** (`/admin/runners`) + and find your Runner +1. Enable any projects under **Restrict projects for this Runner** to be used + with the Runner -### Lock a specific Runner from being enabled for other projects +From now on, the shared Runner will be specific to those projects. + +## Locking a specific Runner from being enabled for other projects You can configure a Runner to assign it exclusively to a project. When a Runner is locked this way, it can no longer be enabled for other projects. -This setting is available on each Runner in *Project Settings* > *Runners*. +This setting can be enabled the first time you [register a Runner][register] and +can be changed afterwards under each Runner's settings. + +To lock/unlock a Runner: + +1. Visit your project's **Settings ➔ Pipelines** +1. Find the Runner you wish to lock/unlock and make sure it's enabled +1. Click the pencil button +1. Check the **Lock to current projects** option +1. Click **Save changes** for the changes to take effect -### Making an existing Shared Runner Specific +## How shared Runners pick jobs -If you are an admin on your GitLab instance, -you can make any shared Runner a specific Runner, _but you can not -make a specific Runner a shared Runner_. +Shared Runners abide to a process queue we call fair usage. The fair usage +algorithm tries to assign jobs to shared Runners from projects that have the +lowest number of jobs currently running on shared Runners. -To make a shared Runner specific, go to the Runner page (`/admin/runners`) -and find your Runner. Add any projects on the left to make this Runner -run exclusively for these projects, therefore making it a specific Runner. +**Example 1** - +We have following jobs in queue: -## Using Shared Runners Effectively +- job 1 for project 1 +- job 2 for project 1 +- job 3 for project 1 +- job 4 for project 2 +- job 5 for project 2 +- job 6 for project 3 + +With the fair usage algorithm jobs are assigned in following order: + +1. We choose job 1, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 4, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 6, because project 3 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 2, because project 1 as other it runs 1 job +1. We choose job 5, because project 2 runs 1 job, where project 1 runs 2 jobs now +1. We choose job 3, because project 1 and runs 2 jobs + +--- + +**Example 2** + +We have following jobs in queue: + +- job 1 for project 1 +- job 2 for project 1 +- job 3 for project 1 +- job 4 for project 2 +- job 5 for project 2 +- job 6 for project 3 + +With the fair usage algorithm jobs are assigned in following order: + +1. We choose job 1, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We finish job 1 +1. We choose job 2, because project 1 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 4, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We finish job 4 +1. We choose job 5, because project 2 doesn't run currently any jobs and has the lowest job number from projects that doesn't run jobs +1. We choose job 6, because project 3 doesn't run currently any jobs +1. We choose job 3, because project 1, 2 and 3 runs exactly one job now + +## Using shared Runners effectively If you are planning to use shared Runners, there are several things you should keep in mind. -### Use Tags +### Using tags You must setup a Runner to be able to run all the different types of jobs that it may encounter on the projects it's shared over. This would be @@ -130,17 +174,27 @@ shared Runners will only run the jobs they are equipped to run. For instance, at GitLab we have Runners tagged with "rails" if they contain the appropriate dependencies to run Rails test suites. -### Prevent Runner with tags from picking jobs without tags +### Preventing Runners with tags from picking jobs without tags You can configure a Runner to prevent it from picking jobs with tags when -the Runner does not have tags assigned. This setting is available on each -Runner in *Project Settings* > *Runners*. +the Runner does not have tags assigned. This setting can be enabled the first +time you [register a Runner][register] and can be changed afterwards under +each Runner's settings. + +To make a Runner pick tagged/untagged jobs: + +1. Visit your project's **Settings ➔ Pipelines** +1. Find the Runner you wish and make sure it's enabled +1. Click the pencil button +1. Check the **Run untagged jobs** option +1. Click **Save changes** for the changes to take effect ### Be careful with sensitive information If you can run a job on a Runner, you can get access to any code it runs and get the token of the Runner. With shared Runners, this means that anyone -that runs jobs on the Runner, can access anyone else's code that runs on the Runner. +that runs jobs on the Runner, can access anyone else's code that runs on the +Runner. In addition, because you can get access to the Runner token, it is possible to create a clone of a Runner and submit false jobs, for example. @@ -160,3 +214,7 @@ project. Mentioned briefly earlier, but the following things of Runners can be exploited. We're always looking for contributions that can mitigate these [Security Considerations](https://docs.gitlab.com/runner/security/). + +[install]: http://docs.gitlab.com/runner/install/ +[fifo]: https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics) +[register]: http://docs.gitlab.com/runner/register/ diff --git a/doc/ci/runners/img/shared_runners_admin.png b/doc/ci/runners/img/shared_runners_admin.png Binary files differnew file mode 100644 index 00000000000..e049b339b36 --- /dev/null +++ b/doc/ci/runners/img/shared_runners_admin.png diff --git a/doc/ci/runners/project_specific.png b/doc/ci/runners/project_specific.png Binary files differdeleted file mode 100644 index c812defa67b..00000000000 --- a/doc/ci/runners/project_specific.png +++ /dev/null diff --git a/doc/ci/runners/shared_runner.png b/doc/ci/runners/shared_runner.png Binary files differdeleted file mode 100644 index 31574a17764..00000000000 --- a/doc/ci/runners/shared_runner.png +++ /dev/null diff --git a/doc/ci/triggers/README.md b/doc/ci/triggers/README.md index cb646827fb4..7ec7136d8c6 100644 --- a/doc/ci/triggers/README.md +++ b/doc/ci/triggers/README.md @@ -4,15 +4,22 @@ - [Introduced][ci-229] in GitLab CE 7.14. - GitLab 8.12 has a completely redesigned job permissions system. Read all about the [new model and its implications](../../user/project/new_ci_build_permissions_model.md#job-triggers). -- GitLab 9.0 introduced a trigger ownership to solve permission problems. -Triggers can be used to force a rebuild of a specific `ref` (branch or tag) -with an API call. +Triggers can be used to force a pipeline rerun of a specific `ref` (branch or +tag) with an API call. -## Add a trigger +## Authentication tokens + +The following methods of authentication are supported. + +### Trigger token + +A unique trigger token can be obtained when [adding a new trigger](#adding-a-new-trigger). + +## Adding a new trigger You can add a new trigger by going to your project's -**Settings ➔ Pipelines ➔ Triggers**. The **Add trigger** button will +**Settings ➔ Pipelines** under **Triggers**. The **Add trigger** button will create a new token which you can then use to trigger a rerun of this particular project's pipeline. @@ -22,7 +29,10 @@ overview of the time the triggers were last used.  -## Take ownership +## Taking ownership of a trigger + +> **Note**: +GitLab 9.0 introduced a trigger ownership to solve permission problems. Each created trigger when run will impersonate their associated user including their access to projects and their project permissions. @@ -30,26 +40,20 @@ their access to projects and their project permissions. You can take ownership of existing triggers by clicking *Take ownership*. From now on the trigger will be run as you. -## Legacy triggers - -Old triggers, created before 9.0 will be marked as Legacy. Triggers with -the legacy label do not have an associated user and only have access -to the current project. - -Legacy trigger are considered deprecated and will be removed -with one of the future versions of GitLab. - -## Revoke a trigger +## Revoking a trigger You can revoke a trigger any time by going at your project's -**Settings > Triggers** and hitting the **Revoke** button. The action is -irreversible. +**Settings ➔ Pipelines** under **Triggers** and hitting the **Revoke** button. +The action is irreversible. -## Trigger a pipeline +## Triggering a pipeline -> **Note**: -Valid refs are only the branches and tags. If you pass a commit SHA as a ref, -it will not trigger a job. +> **Notes**: +- Valid refs are only the branches and tags. If you pass a commit SHA as a ref, + it will not trigger a job. +- If your project is public, passing the token in plain text is probably not the + wisest idea, so you might want to use a + [secret variable](../variables/README.md#secret-variables) for that purpose. To trigger a job you need to send a `POST` request to GitLab's API endpoint: @@ -57,11 +61,11 @@ To trigger a job you need to send a `POST` request to GitLab's API endpoint: POST /projects/:id/trigger/pipeline ``` -The required parameters are the trigger's `token` and the Git `ref` on which -the trigger will be performed. Valid refs are the branch and the tag. The `:id` -of a project can be found by [querying the API](../../api/projects.md) -or by visiting the **Pipelines** settings page which provides -self-explanatory examples. +The required parameters are the [trigger's `token`](#authentication-tokens) +and the Git `ref` on which the trigger will be performed. Valid refs are the +branch and the tag. The `:id` of a project can be found by +[querying the API](../../api/projects.md) or by visiting the **Pipelines** +settings page which provides self-explanatory examples. When a rerun of a pipeline is triggered, the information is exposed in GitLab's UI under the **Jobs** page and the jobs are marked as triggered 'by API'. @@ -78,46 +82,7 @@ below. --- -See the [Examples](#examples) section for more details on how to actually -trigger a rebuild. - -## Trigger a pipeline from webhook - -> Introduced in GitLab 8.14. - -To trigger a job from webhook of another project you need to add the following -webhook url for Push and Tag push events: - -``` -https://gitlab.example.com/api/v4/projects/:id/ref/:ref/trigger/pipeline?token=TOKEN -``` - -> **Note**: -- `ref` should be passed as part of url in order to take precedence over `ref` - from webhook body that designates the branchref that fired the trigger in the source repository. -- `ref` should be url encoded if contains slashes. - -## Pass job variables to a trigger - -You can pass any number of arbitrary variables in the trigger API call and they -will be available in GitLab CI so that they can be used in your `.gitlab-ci.yml` -file. The parameter is of the form: - -``` -variables[key]=value -``` - -This information is also exposed in the UI. - - - ---- - -See the [Examples](#examples) section below for more details. - -## Examples - -Using cURL you can trigger a rebuild with minimal effort, for example: +By using cURL you can trigger a pipeline rerun with minimal effort, for example: ```bash curl --request POST \ @@ -135,8 +100,6 @@ curl --request POST \ "https://gitlab.example.com/api/v4/projects/9/trigger/pipeline?token=TOKEN&ref=master" ``` -### Triggering a pipeline within `.gitlab-ci.yml` - You can also benefit by using triggers in your `.gitlab-ci.yml`. Let's say that you have two projects, A and B, and you want to trigger a rebuild on the `master` branch of project B whenever a tag on project A is created. This is the job you @@ -156,14 +119,37 @@ Now, whenever a new tag is pushed on project A, the job will run and the `stage: deploy` ensures that this job will run only after all jobs with `stage: test` complete successfully. -_**Note:** If your project is public, passing the token in plain text is -probably not the wisest idea, so you might want to use a -[secure variable](../variables/README.md#user-defined-variables-secure-variables) -for that purpose._ +## Triggering a pipeline from a webhook -### Making use of trigger variables +> **Notes**: +- Introduced in GitLab 8.14. +- `ref` should be passed as part of the URL in order to take precedence over + `ref` from the webhook body that designates the branch ref that fired the + trigger in the source repository. +- `ref` should be URL-encoded if it contains slashes. -Using trigger variables can be proven useful for a variety of reasons. +To trigger a job from a webhook of another project you need to add the following +webhook URL for Push and Tag events (change the project ID, ref and token): + +``` +https://gitlab.example.com/api/v4/projects/9/ref/master/trigger/pipeline?token=TOKEN +``` + +## Making use of trigger variables + +You can pass any number of arbitrary variables in the trigger API call and they +will be available in GitLab CI so that they can be used in your `.gitlab-ci.yml` +file. The parameter is of the form: + +``` +variables[key]=value +``` + +This information is also exposed in the UI. + + + +Using trigger variables can be proven useful for a variety of reasons: * Identifiable jobs. Since the variable is exposed in the UI you can know why the rebuild was triggered if you pass a variable that explains the @@ -208,15 +194,7 @@ curl --request POST \ https://gitlab.example.com/api/v4/projects/9/trigger/pipeline ``` -### Using a webhook to trigger a pipeline - -You can add the following webhook to another project in order to trigger a job: - -``` -https://gitlab.example.com/api/v4/projects/9/ref/master/trigger/pipeline?token=TOKEN&variables[UPLOAD_TO_S3]=true -``` - -### Using cron to trigger nightly pipelines +## Using cron to trigger nightly pipelines >**Note:** The following behavior can also be achieved through GitLab's UI with @@ -230,4 +208,18 @@ branch of project with ID `9` every night at `00:30`: 30 0 * * * curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v4/projects/9/trigger/pipeline ``` +## Legacy triggers + +Old triggers, created before GitLab 9.0 will be marked as legacy. + +Triggers with the legacy label do not have an associated user and only have +access to the current project. They are considered deprecated and will be +removed with one of the future versions of GitLab. You are advised to +[take ownership](#taking-ownership) of any legacy triggers. + +[ee-2017]: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2017 [ci-229]: https://gitlab.com/gitlab-org/gitlab-ci/merge_requests/229 +[ee]: https://about.gitlab.com/gitlab-ee/ +[variables]: ../variables/README.md +[predef]: ../variables/README.md#predefined-variables-environment-variables +[registry]: ../../user/project/container_registry.md diff --git a/doc/ci/triggers/img/triggers_page.png b/doc/ci/triggers/img/triggers_page.png Binary files differindex eafd8519a23..7dc8f91cf7e 100644 --- a/doc/ci/triggers/img/triggers_page.png +++ b/doc/ci/triggers/img/triggers_page.png diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index 76ba78ea7be..d1f9881e51b 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -431,3 +431,4 @@ export CI_REGISTRY_PASSWORD="longalfanumstring" [protected branches]: ../../user/project/protected_branches.md [protected tags]: ../../user/project/protected_tags.md [shellexecutors]: https://docs.gitlab.com/runner/executors/ +[eep]: https://about.gitlab.com/gitlab-ee/ "Available only in GitLab Enterprise Edition Premium" diff --git a/doc/user/project/img/protected_branches_delete.png b/doc/user/project/img/protected_branches_delete.png Binary files differnew file mode 100644 index 00000000000..cfdfe6c6c29 --- /dev/null +++ b/doc/user/project/img/protected_branches_delete.png diff --git a/doc/user/project/protected_branches.md b/doc/user/project/protected_branches.md index 7650020b37e..0570d9f471f 100644 --- a/doc/user/project/protected_branches.md +++ b/doc/user/project/protected_branches.md @@ -94,8 +94,33 @@ all matching branches:  +## Deleting a protected branch + +> [Introduced][ce-21393] in GitLab 9.3. + +From time to time, it may be required to delete or clean up branches that are +protected. + +User with [Master permissions][perm] and up can manually delete protected +branches via GitLab's web interface: + +1. Visit **Repository > Branches** +1. Click on the delete icon next to the branch you wish to delete +1. In order to prevent accidental deletion, an additional confirmation is + required + +  + +Deleting a protected branch is only allowed via the web interface, not via Git. +This means that you can't accidentally delete a protected branch from your +command line or a Git client application. + ## Changelog +**9.2** + +- Allow deletion of protected branches via the web interface [gitlab-org/gitlab-ce#21393][ce-21393] + **8.11** - Allow creating protected branches that can't be pushed to [gitlab-org/gitlab-ce!5081][ce-5081] @@ -110,4 +135,6 @@ all matching branches: [ce-4665]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4665 "Allow specifying protected branches using wildcards" [ce-4892]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4892 "Allow developers to merge into a protected branch without having push access" [ce-5081]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5081 "Allow creating protected branches that can't be pushed to" +[ce-21393]: https://gitlab.com/gitlab-org/gitlab-ce/issues/21393 [ee-restrict]: http://docs.gitlab.com/ee/user/project/protected_branches.html#restricting-push-and-merge-access-to-certain-users +[perm]: ../permissions.md diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index 2aef7fdaa35..4212a0dbe2e 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -58,19 +58,19 @@ module Gitlab diff_refs&.head_sha end - def content_sha - return old_content_sha if deleted_file? - return @content_sha if defined?(@content_sha) + def new_content_sha + return if deleted_file? + return @new_content_sha if defined?(@new_content_sha) refs = diff_refs || fallback_diff_refs - @content_sha = refs&.head_sha + @new_content_sha = refs&.head_sha end - def content_commit - return @content_commit if defined?(@content_commit) + def new_content_commit + return @new_content_commit if defined?(@new_content_commit) - sha = content_sha - @content_commit = repository.commit(sha) if sha + sha = new_content_commit + @new_content_commit = repository.commit(sha) if sha end def old_content_sha @@ -88,13 +88,13 @@ module Gitlab @old_content_commit = repository.commit(sha) if sha end - def blob - return @blob if defined?(@blob) + def new_blob + return @new_blob if defined?(@new_blob) - sha = content_sha - return @blob = nil unless sha + sha = new_content_sha + return @new_blob = nil unless sha - repository.blob_at(sha, file_path) + @new_blob = repository.blob_at(sha, file_path) end def old_blob @@ -106,6 +106,18 @@ module Gitlab @old_blob = repository.blob_at(sha, old_path) end + def content_sha + new_content_sha || old_content_sha + end + + def content_commit + new_content_commit || old_content_commit + end + + def blob + new_blob || old_blob + end + attr_writer :highlighted_diff_lines # Array of Gitlab::Diff::Line objects @@ -153,6 +165,18 @@ module Gitlab def file_identifier "#{file_path}-#{new_file?}-#{deleted_file?}-#{renamed_file?}" end + + def diffable? + repository.attributes(file_path).fetch('diff') { true } + end + + def binary? + old_blob&.binary? || new_blob&.binary? + end + + def text? + !binary? + end end end end diff --git a/lib/gitlab/diff/file_collection/merge_request_diff.rb b/lib/gitlab/diff/file_collection/merge_request_diff.rb index 9a58b500a2c..fcda1fe2233 100644 --- a/lib/gitlab/diff/file_collection/merge_request_diff.rb +++ b/lib/gitlab/diff/file_collection/merge_request_diff.rb @@ -66,10 +66,7 @@ module Gitlab end def cacheable?(diff_file) - @merge_request_diff.present? && - diff_file.blob && - diff_file.blob.text? && - @project.repository.diffable?(diff_file.blob) + @merge_request_diff.present? && diff_file.text? && diff_file.diffable? end def cache_key diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb index ed2f541977a..b669ee5b799 100644 --- a/lib/gitlab/diff/highlight.rb +++ b/lib/gitlab/diff/highlight.rb @@ -42,9 +42,9 @@ module Gitlab rich_line = if diff_line.unchanged? || diff_line.added? - new_lines[diff_line.new_pos - 1] + new_lines[diff_line.new_pos - 1]&.html_safe elsif diff_line.removed? - old_lines[diff_line.old_pos - 1] + old_lines[diff_line.old_pos - 1]&.html_safe end # Only update text if line is found. This will prevent @@ -60,13 +60,18 @@ module Gitlab end def old_lines - return unless diff_file - @old_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_old_sha, diff_old_path) + @old_lines ||= highlighted_blob_lines(diff_file.old_blob) end def new_lines - return unless diff_file - @new_lines ||= Gitlab::Highlight.highlight_lines(self.repository, diff_new_sha, diff_new_path) + @new_lines ||= highlighted_blob_lines(diff_file.new_blob) + end + + def highlighted_blob_lines(blob) + return [] unless blob + + blob.load_all_data! + Gitlab::Highlight.highlight(blob.path, blob.data, repository: repository).lines end end end diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 9d6adbdb4ac..85695d0a4df 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -962,11 +962,6 @@ module Gitlab end end - # Checks if the blob should be diffable according to its attributes - def diffable?(blob) - attributes(blob.path).fetch('diff') { blob.text? } - end - # Returns the Git attributes for the given file path. # # See `Gitlab::Git::Attributes` for more information. diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb index 23bc2f63c8e..6b24da030df 100644 --- a/lib/gitlab/highlight.rb +++ b/lib/gitlab/highlight.rb @@ -5,14 +5,6 @@ module Gitlab highlight(blob_content, continue: false, plain: plain) end - def self.highlight_lines(repository, ref, file_name) - blob = repository.blob_at(ref, file_name) - return [] unless blob - - blob.load_all_data! - highlight(file_name, blob.data, repository: repository).lines.map!(&:html_safe) - end - attr_reader :blob_name def initialize(blob_name, blob_content, repository: nil) diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index f7ac48f7dbd..328dd17e452 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -6,9 +6,11 @@ module Gitlab 'en' => 'English', 'es' => 'Español', 'de' => 'Deutsch', + 'pt_BR' => 'Português(Brasil)', 'zh_CN' => '简体中文', 'zh_HK' => '繁體中文(香港)', - 'zh_TW' => '繁體中文(臺灣)' + 'zh_TW' => '繁體中文(臺灣)', + 'bg' => 'български' }.freeze def available_locales diff --git a/locale/bg/gitlab.po b/locale/bg/gitlab.po new file mode 100644 index 00000000000..e6caf83252d --- /dev/null +++ b/locale/bg/gitlab.po @@ -0,0 +1,260 @@ +# Lyubomir Vasilev <lyubomirv@abv.bg>, 2017. #zanata +msgid "" +msgstr "" +"Project-Id-Version: gitlab 1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-04 19:24-0500\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-05 09:40-0400\n" +"Last-Translator: Lyubomir Vasilev <lyubomirv@abv.bg>\n" +"Language-Team: Bulgarian\n" +"Language: bg\n" +"X-Generator: Zanata 3.9.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "ByAuthor|by" +msgstr "от" + +msgid "Commit" +msgid_plural "Commits" +msgstr[0] "Подаване" +msgstr[1] "Подавания" + +msgid "" +"Cycle Analytics gives an overview of how much time it takes to go from idea " +"to production in your project." +msgstr "" +"Анализът на циклите дава общ поглед върху това колко време е нужно на една " +"идея да се превърне в завършена функционалност в проекта." + +msgid "CycleAnalyticsStage|Code" +msgstr "Програмиране" + +msgid "CycleAnalyticsStage|Issue" +msgstr "Проблем" + +msgid "CycleAnalyticsStage|Plan" +msgstr "Планиране" + +msgid "CycleAnalyticsStage|Production" +msgstr "Издаване" + +msgid "CycleAnalyticsStage|Review" +msgstr "Преглед и одобрение" + +msgid "CycleAnalyticsStage|Staging" +msgstr "Подготовка за издаване" + +msgid "CycleAnalyticsStage|Test" +msgstr "Тестване" + +msgid "Deploy" +msgid_plural "Deploys" +msgstr[0] "Внедряване" +msgstr[1] "Внедрявания" + +msgid "FirstPushedBy|First" +msgstr "Първо" + +msgid "FirstPushedBy|pushed by" +msgstr "изпращане на промени от" + +msgid "From issue creation until deploy to production" +msgstr "От създаването на проблема до внедряването в крайната версия" + +msgid "From merge request merge until deploy to production" +msgstr "" +"От прилагането на заявката за сливане до внедряването в крайната версия" + +msgid "Introducing Cycle Analytics" +msgstr "Представяме Ви анализът на циклите" + +msgid "Last %d day" +msgid_plural "Last %d days" +msgstr[0] "Последния %d ден" +msgstr[1] "Последните %d дни" + +msgid "Limited to showing %d event at most" +msgid_plural "Limited to showing %d events at most" +msgstr[0] "Ограничено до показване на последното %d събитие" +msgstr[1] "Ограничено до показване на последните %d събития" + +msgid "Median" +msgstr "Медиана" + +msgid "New Issue" +msgid_plural "New Issues" +msgstr[0] "Нов проблем" +msgstr[1] "Нови проблема" + +msgid "Not available" +msgstr "Не е налично" + +msgid "Not enough data" +msgstr "Няма достатъчно данни" + +msgid "OpenedNDaysAgo|Opened" +msgstr "Отворен" + +msgid "Pipeline Health" +msgstr "Състояние" + +msgid "ProjectLifecycle|Stage" +msgstr "Етап" + +msgid "Read more" +msgstr "Прочетете повече" + +msgid "Related Commits" +msgstr "Свързани подавания" + +msgid "Related Deployed Jobs" +msgstr "Свързани задачи за внедряване" + +msgid "Related Issues" +msgstr "Свързани проблеми" + +msgid "Related Jobs" +msgstr "Свързани задачи" + +msgid "Related Merge Requests" +msgstr "Свързани заявки за сливане" + +msgid "Related Merged Requests" +msgstr "Свързани приложени заявки за сливане" + +msgid "Showing %d event" +msgid_plural "Showing %d events" +msgstr[0] "Показване на %d събитие" +msgstr[1] "Показване на %d събития" + +msgid "" +"The coding stage shows the time from the first commit to creating the merge " +"request. The data will automatically be added here once you create your " +"first merge request." +msgstr "" +"Етапът на програмиране показва времето от първото подаване до създаването на " +"заявката за сливане. Данните ще бъдат добавени тук автоматично след като " +"бъде създадена първата заявка за сливане." + +msgid "The collection of events added to the data gathered for that stage." +msgstr "Съвкупността от събития добавени към данните събрани за този етап." + +msgid "" +"The issue stage shows the time it takes from creating an issue to assigning " +"the issue to a milestone, or add the issue to a list on your Issue Board. " +"Begin creating issues to see data for this stage." +msgstr "" +"Етапът на проблемите показва колко е времето от създаването на проблем до " +"определянето на целеви етап на проекта за него, или до добавянето му в " +"списък на дъската за проблеми. Започнете да добавяте проблеми, за да видите " +"данните за този етап." + +msgid "The phase of the development lifecycle." +msgstr "Етапът от цикъла на разработка" + +msgid "" +"The planning stage shows the time from the previous step to pushing your " +"first commit. This time will be added automatically once you push your first " +"commit." +msgstr "" +"Етапът на планиране показва колко е времето от преходната стъпка до " +"изпращането на първото подаване. Това време ще бъде добавено автоматично " +"след като изпратите първото си подаване." + +msgid "" +"The production stage shows the total time it takes between creating an issue " +"and deploying the code to production. The data will be automatically added " +"once you have completed the full idea to production cycle." +msgstr "" +"Етапът на издаване показва общото време, което е нужно от създаването на " +"проблем до внедряването на кода в крайната версия." + +msgid "" +"The review stage shows the time from creating the merge request to merging " +"it. The data will automatically be added after you merge your first merge " +"request." +msgstr "" +"Етапът на преглед и одобрение показва времето от създаването на заявката за " +"сливане до прилагането ѝ. Данните ще бъдат добавени автоматично след като " +"приложите първата си заявка за сливане." + +msgid "" +"The staging stage shows the time between merging the MR and deploying code " +"to the production environment. The data will be automatically added once you " +"deploy to production for the first time." +msgstr "" +"Етапът на подготовка за издаване показва времето между прилагането на " +"заявката за сливане и внедряването на кода в средата на работещата крайна " +"версия. Данните ще бъдат добавени автоматично след като направите първото си " +"внедряване в крайната версия." + +msgid "" +"The testing stage shows the time GitLab CI takes to run every pipeline for " +"the related merge request. The data will automatically be added after your " +"first pipeline finishes running." +msgstr "" +"Етапът на тестване показва времето, което е нужно на „Gitlab CI“ да изпълни " +"всички задачи за свързаната заявка за сливане. Данните ще бъдат добавени " +"автоматично след като приключи изпълнените на първата Ви такава задача." + +msgid "The time taken by each data entry gathered by that stage." +msgstr "Времето, което отнема всеки запис от данни за съответния етап." + +msgid "" +"The value lying at the midpoint of a series of observed values. E.g., " +"between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 =" +" 6." +msgstr "" +"Стойността, която се намира в средата на последователността от наблюдавани " +"данни. Например: медианата на 3, 5 и 9 е 5, а медианата на 3, 5, 7 и 8 е " +"(5+7)/2 = 6." + +msgid "Time before an issue gets scheduled" +msgstr "Време преди един проблем да бъде планиран за работа" + +msgid "Time before an issue starts implementation" +msgstr "Време преди работата по проблем да започне" + +msgid "Time between merge request creation and merge/close" +msgstr "" +"Време между създаване на заявка за сливане и прилагането/отхвърлянето ѝ" + +msgid "Time until first merge request" +msgstr "Време преди първата заявка за сливане" + +msgid "Time|hr" +msgid_plural "Time|hrs" +msgstr[0] "час" +msgstr[1] "часа" + +msgid "Time|min" +msgid_plural "Time|mins" +msgstr[0] "мин" +msgstr[1] "мин" + +msgid "Time|s" +msgstr "сек" + +msgid "Total Time" +msgstr "Общо време" + +msgid "Total test time for all commits/merges" +msgstr "Общо време за тестване на всички подавания/сливания" + +msgid "Want to see the data? Please ask an administrator for access." +msgstr "Искате ли да видите данните? Помолете администратор за достъп." + +msgid "We don't have enough data to show this stage." +msgstr "Няма достатъчно данни за този етап." + +msgid "You need permission." +msgstr "Нуждаете се от разрешение." + +msgid "day" +msgid_plural "days" +msgstr[0] "ден" +msgstr[1] "дни" + diff --git a/locale/bg/gitlab.po.time_stamp b/locale/bg/gitlab.po.time_stamp new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/locale/bg/gitlab.po.time_stamp diff --git a/locale/pt_BR/gitlab.po b/locale/pt_BR/gitlab.po new file mode 100644 index 00000000000..5ad41f92b64 --- /dev/null +++ b/locale/pt_BR/gitlab.po @@ -0,0 +1,260 @@ +# Alexandre Alencar <alexandre.alencar@gmail.com>, 2017. #zanata +# Fabio Beneditto <fabiobeneditto@gmail.com>, 2017. #zanata +# Leandro Nunes dos Santos <leandronunes@gmail.com>, 2017. #zanata +msgid "" +msgstr "" +"Project-Id-Version: gitlab 1.0.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-04 19:24-0500\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-06-05 03:29-0400\n" +"Last-Translator: Alexandre Alencar <alexandre.alencar@gmail.com>\n" +"Language-Team: Portuguese (Brazil)\n" +"Language: pt-BR\n" +"X-Generator: Zanata 3.9.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +msgid "ByAuthor|by" +msgstr "por" + +msgid "Commit" +msgid_plural "Commits" +msgstr[0] "Commit" +msgstr[1] "Commits" + +msgid "" +"Cycle Analytics gives an overview of how much time it takes to go from idea " +"to production in your project." +msgstr "" +"A Análise de Ciclo fornece uma visão geral de quanto tempo uma ideia demora " +"para ir para produção em seu projeto." + +msgid "CycleAnalyticsStage|Code" +msgstr "Código" + +msgid "CycleAnalyticsStage|Issue" +msgstr "Tarefa" + +msgid "CycleAnalyticsStage|Plan" +msgstr "Plano" + +msgid "CycleAnalyticsStage|Production" +msgstr "Produção" + +msgid "CycleAnalyticsStage|Review" +msgstr "Revisão" + +msgid "CycleAnalyticsStage|Staging" +msgstr "Homologação" + +msgid "CycleAnalyticsStage|Test" +msgstr "Teste" + +msgid "Deploy" +msgid_plural "Deploys" +msgstr[0] "Implantação" +msgstr[1] "Implantações" + +msgid "FirstPushedBy|First" +msgstr "Primeiro" + +msgid "FirstPushedBy|pushed by" +msgstr "publicado por" + +msgid "From issue creation until deploy to production" +msgstr "Da criação de tarefas até a implantação para a produção" + +msgid "From merge request merge until deploy to production" +msgstr "Da incorporação do merge request até a implantação em produção" + +msgid "Introducing Cycle Analytics" +msgstr "Apresentando a Análise de Ciclo" + +msgid "Last %d day" +msgid_plural "Last %d days" +msgstr[0] "Último %d dia" +msgstr[1] "Últimos %d dias" + +msgid "Limited to showing %d event at most" +msgid_plural "Limited to showing %d events at most" +msgstr[0] "Limitado a mostrar %d evento no máximo" +msgstr[1] "Limitado a mostrar %d eventos no máximo" + +msgid "Median" +msgstr "Mediana" + +msgid "New Issue" +msgid_plural "New Issues" +msgstr[0] "Nova Tarefa" +msgstr[1] "Novas Tarefas" + +msgid "Not available" +msgstr "Não disponível" + +msgid "Not enough data" +msgstr "Dados insuficientes" + +msgid "OpenedNDaysAgo|Opened" +msgstr "Aberto" + +msgid "Pipeline Health" +msgstr "Saúde da Pipeline" + +msgid "ProjectLifecycle|Stage" +msgstr "Etapa" + +msgid "Read more" +msgstr "Ler mais" + +msgid "Related Commits" +msgstr "Commits Relacionados" + +msgid "Related Deployed Jobs" +msgstr "Jobs Relacionados Incorporados" + +msgid "Related Issues" +msgstr "Tarefas Relacionadas" + +msgid "Related Jobs" +msgstr "Jobs Relacionados" + +msgid "Related Merge Requests" +msgstr "Merge Requests Relacionados" + +msgid "Related Merged Requests" +msgstr "Merge Requests Relacionados" + +msgid "Showing %d event" +msgid_plural "Showing %d events" +msgstr[0] "Mostrando %d evento" +msgstr[1] "Mostrando %d eventos" + +msgid "" +"The coding stage shows the time from the first commit to creating the merge " +"request. The data will automatically be added here once you create your " +"first merge request." +msgstr "" +"O estágio de codificação mostra o tempo desde o primeiro commit até a " +"criação do merge request. \n" +"Os dados serão automaticamente adicionados aqui uma vez que você tenha " +"criado seu primeiro merge request." + +msgid "The collection of events added to the data gathered for that stage." +msgstr "" +"A coleção de eventos adicionados aos dados coletados para esse estágio." + +msgid "" +"The issue stage shows the time it takes from creating an issue to assigning " +"the issue to a milestone, or add the issue to a list on your Issue Board. " +"Begin creating issues to see data for this stage." +msgstr "" +"O estágio em questão mostra o tempo que leva desde a criação de uma tarefa " +"até a sua assinatura para um milestone, ou a sua adição para a lista no seu " +"Painel de Tarefas. Comece a criar tarefas para ver dados para esta etapa." + +msgid "The phase of the development lifecycle." +msgstr "A fase do ciclo de vida do desenvolvimento." + +msgid "" +"The planning stage shows the time from the previous step to pushing your " +"first commit. This time will be added automatically once you push your first " +"commit." +msgstr "" +"A fase de planejamento mostra o tempo do passo anterior até empurrar o seu " +"primeiro commit. Este tempo será adicionado automaticamente assim que você " +"realizar seu primeiro commit." + +msgid "" +"The production stage shows the total time it takes between creating an issue " +"and deploying the code to production. The data will be automatically added " +"once you have completed the full idea to production cycle." +msgstr "" +"O estágio de produção mostra o tempo total que leva entre criar uma tarefa e " +"implantar o código na produção. Os dados serão adicionados automaticamente " +"até que você complete todo o ciclo de produção." + +msgid "" +"The review stage shows the time from creating the merge request to merging " +"it. The data will automatically be added after you merge your first merge " +"request." +msgstr "" +"A etapa de revisão mostra o tempo de criação de um merge request até que o " +"merge seja feito. Os dados serão automaticamente adicionados depois que você " +"fizer seu primeiro merge request." + +msgid "" +"The staging stage shows the time between merging the MR and deploying code " +"to the production environment. The data will be automatically added once you " +"deploy to production for the first time." +msgstr "" +"O estágio de estágio mostra o tempo entre a fusão do MR e o código de " +"implantação para o ambiente de produção. Os dados serão automaticamente " +"adicionados depois de implantar na produção pela primeira vez." + +msgid "" +"The testing stage shows the time GitLab CI takes to run every pipeline for " +"the related merge request. The data will automatically be added after your " +"first pipeline finishes running." +msgstr "" +"A fase de teste mostra o tempo que o GitLab CI leva para executar cada " +"pipeline para o merge request relacionado. Os dados serão automaticamente " +"adicionados após a conclusão do primeiro pipeline." + +msgid "The time taken by each data entry gathered by that stage." +msgstr "O tempo necessário para cada entrada de dados reunida por essa etapa." + +msgid "" +"The value lying at the midpoint of a series of observed values. E.g., " +"between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 =" +" 6." +msgstr "" +"O valor situado no ponto médio de uma série de valores observados. Ex., " +"entre 3, 5, 9, a mediana é 5. Entre 3, 5, 7, 8, a mediana é (5 + 7) / 2 = 6." + +msgid "Time before an issue gets scheduled" +msgstr "Tempo até que uma tarefa seja planejada" + +msgid "Time before an issue starts implementation" +msgstr "Tempo até que uma tarefa comece a ser implementada" + +msgid "Time between merge request creation and merge/close" +msgstr "Tempo entre a criação do merge request e o merge/fechamento" + +msgid "Time until first merge request" +msgstr "Tempo até o primeiro merge request" + +msgid "Time|hr" +msgid_plural "Time|hrs" +msgstr[0] "h" +msgstr[1] "hs" + +msgid "Time|min" +msgid_plural "Time|mins" +msgstr[0] "min" +msgstr[1] "mins" + +msgid "Time|s" +msgstr "s" + +msgid "Total Time" +msgstr "Tempo Total" + +msgid "Total test time for all commits/merges" +msgstr "Tempo de teste total para todos os commits/merges" + +msgid "Want to see the data? Please ask an administrator for access." +msgstr "Precisa visualizar os dados? Solicite acesso ao administrador." + +msgid "We don't have enough data to show this stage." +msgstr "Não temos dados suficientes para mostrar esta fase." + +msgid "You need permission." +msgstr "Você precisa de permissão." + +msgid "day" +msgid_plural "days" +msgstr[0] "dia" +msgstr[1] "dias" + diff --git a/locale/pt_BR/gitlab.po.time_stamp b/locale/pt_BR/gitlab.po.time_stamp new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/locale/pt_BR/gitlab.po.time_stamp diff --git a/spec/controllers/projects/labels_controller_spec.rb b/spec/controllers/projects/labels_controller_spec.rb index 130b0b744b5..bf1776eb320 100644 --- a/spec/controllers/projects/labels_controller_spec.rb +++ b/spec/controllers/projects/labels_controller_spec.rb @@ -117,7 +117,7 @@ describe Projects::LabelsController do let!(:promoted_label_name) { "Promoted Label" } let!(:label_1) { create(:label, title: promoted_label_name, project: project) } - context 'not group owner' do + context 'not group reporters' do it 'denies access' do post :promote, namespace_id: project.namespace.to_param, project_id: project, id: label_1.to_param @@ -125,9 +125,9 @@ describe Projects::LabelsController do end end - context 'group owner' do + context 'group reporter' do before do - GroupMember.add_users(group, [user], :owner) + group.add_reporter(user) end it 'gives access' do diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb index f2bc15d39d7..d81774c8b8f 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb @@ -5,15 +5,7 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do let(:diff_files) { described_class.new(merge_request.merge_request_diff, diff_options: nil).diff_files } it 'does not highlight binary files' do - allow_any_instance_of(Gitlab::Diff::File).to receive(:blob).and_return(double("text?" => false)) - - expect_any_instance_of(Gitlab::Diff::File).not_to receive(:highlighted_diff_lines) - - diff_files - end - - it 'does not highlight file if blob is not accessable' do - allow_any_instance_of(Gitlab::Diff::File).to receive(:blob).and_return(nil) + allow_any_instance_of(Gitlab::Diff::File).to receive(:text?).and_return(false) expect_any_instance_of(Gitlab::Diff::File).not_to receive(:highlighted_diff_lines) @@ -21,7 +13,7 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do end it 'does not files marked as undiffable in .gitattributes' do - allow_any_instance_of(Repository).to receive(:diffable?).and_return(false) + allow_any_instance_of(Gitlab::Diff::File).to receive(:diffable?).and_return(false) expect_any_instance_of(Gitlab::Diff::File).not_to receive(:highlighted_diff_lines) diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 050689b7c9a..a9953bb0d01 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -6,7 +6,7 @@ describe Gitlab::Diff::File, lib: true do let(:project) { create(:project, :repository) } let(:commit) { project.commit(sample_commit.id) } let(:diff) { commit.raw_diffs.first } - let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: commit.diff_refs, repository: project.repository) } + let(:diff_file) { described_class.new(diff, diff_refs: commit.diff_refs, repository: project.repository) } describe '#diff_lines' do let(:diff_lines) { diff_file.diff_lines } @@ -63,11 +63,33 @@ describe Gitlab::Diff::File, lib: true do end end - describe '#blob' do + describe '#new_blob' do it 'returns blob of new commit' do - data = diff_file.blob.data + data = diff_file.new_blob.data expect(data).to include('raise RuntimeError, "System commands must be given as an array of strings"') end end + + describe '#diffable?' do + let(:commit) { project.commit('1a0b36b3cdad1d2ee32457c102a8c0b7056fa863') } + let(:diffs) { commit.diffs } + + before do + info_dir_path = File.join(project.repository.path_to_repo, 'info') + + FileUtils.mkdir(info_dir_path) unless File.exist?(info_dir_path) + File.write(File.join(info_dir_path, 'attributes'), "*.md -diff\n") + end + + it "returns true for files that do not have attributes" do + diff_file = diffs.diff_file_with_new_path('LICENSE') + expect(diff_file.diffable?).to be_truthy + end + + it "returns false for files that have been marked as not being diffable in attributes" do + diff_file = diffs.diff_file_with_new_path('README.md') + expect(diff_file.diffable?).to be_falsey + end + end end diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 26215381cc4..e1e4aa9fde9 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1235,47 +1235,6 @@ describe Gitlab::Git::Repository, seed_helper: true do end end - describe '#diffable' do - info_dir_path = attributes_path = File.join(SEED_STORAGE_PATH, TEST_REPO_PATH, 'info') - attributes_path = File.join(info_dir_path, 'attributes') - - before(:all) do - FileUtils.mkdir(info_dir_path) unless File.exist?(info_dir_path) - File.write(attributes_path, "*.md -diff\n") - end - - it "should return true for files which are text and do not have attributes" do - blob = Gitlab::Git::Blob.find( - repository, - '33bcff41c232a11727ac6d660bd4b0c2ba86d63d', - 'LICENSE' - ) - expect(repository.diffable?(blob)).to be_truthy - end - - it "should return false for binary files which do not have attributes" do - blob = Gitlab::Git::Blob.find( - repository, - '33bcff41c232a11727ac6d660bd4b0c2ba86d63d', - 'files/images/logo-white.png' - ) - expect(repository.diffable?(blob)).to be_falsey - end - - it "should return false for text files which have been marked as not being diffable in attributes" do - blob = Gitlab::Git::Blob.find( - repository, - '33bcff41c232a11727ac6d660bd4b0c2ba86d63d', - 'README.md' - ) - expect(repository.diffable?(blob)).to be_falsey - end - - after(:all) do - FileUtils.rm_rf(info_dir_path) - end - end - describe '#tag_exists?' do it 'returns true for an existing tag' do tag = repository.tag_names.first diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb index a20cef3b000..c2bb9f9a166 100644 --- a/spec/lib/gitlab/highlight_spec.rb +++ b/spec/lib/gitlab/highlight_spec.rb @@ -7,30 +7,6 @@ describe Gitlab::Highlight, lib: true do let(:repository) { project.repository } let(:commit) { project.commit(sample_commit.id) } - describe '.highlight_lines' do - let(:lines) do - Gitlab::Highlight.highlight_lines(project.repository, commit.id, 'files/ruby/popen.rb') - end - - it 'highlights all the lines properly' do - expect(lines[4]).to eq(%Q{<span id="LC5" class="line" lang="ruby"> <span class="kp">extend</span> <span class="nb">self</span></span>\n}) - expect(lines[21]).to eq(%Q{<span id="LC22" class="line" lang="ruby"> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">directory?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></span>\n}) - expect(lines[26]).to eq(%Q{<span id="LC27" class="line" lang="ruby"> <span class="vi">@cmd_status</span> <span class="o">=</span> <span class="mi">0</span></span>\n}) - end - - describe 'with CRLF' do - let(:branch) { 'crlf-diff' } - let(:blob) { repository.blob_at_branch(branch, path) } - let(:lines) do - Gitlab::Highlight.highlight_lines(project.repository, 'crlf-diff', 'files/whitespace') - end - - it 'strips extra LFs' do - expect(lines[0]).to eq("<span id=\"LC1\" class=\"line\" lang=\"plaintext\">test </span>") - end - end - end - describe 'custom highlighting from .gitattributes' do let(:branch) { 'gitattributes' } let(:blob) { repository.blob_at_branch(branch, path) } @@ -59,6 +35,19 @@ describe Gitlab::Highlight, lib: true do end describe '#highlight' do + describe 'with CRLF' do + let(:branch) { 'crlf-diff' } + let(:path) { 'files/whitespace' } + let(:blob) { repository.blob_at_branch(branch, path) } + let(:lines) do + Gitlab::Highlight.highlight(blob.path, blob.data, repository: repository).lines + end + + it 'strips extra LFs' do + expect(lines[0]).to eq("<span id=\"LC1\" class=\"line\" lang=\"plaintext\">test </span>") + end + end + it 'links dependencies via DependencyLinker' do expect(Gitlab::DependencyLinker).to receive(:link). with('file.name', 'Contents', anything).and_call_original diff --git a/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb b/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb index 935f4710851..bb46e1dd9ab 100644 --- a/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb +++ b/spec/services/merge_requests/merge_request_diff_cache_service_spec.rb @@ -10,8 +10,8 @@ describe MergeRequests::MergeRequestDiffCacheService do expect(Rails.cache).to receive(:read).with(cache_key).and_return({}) expect(Rails.cache).to receive(:write).with(cache_key, anything) - allow_any_instance_of(Gitlab::Diff::File).to receive(:blob).and_return(double("text?" => true)) - allow_any_instance_of(Repository).to receive(:diffable?).and_return(true) + allow_any_instance_of(Gitlab::Diff::File).to receive(:text?).and_return(true) + allow_any_instance_of(Gitlab::Diff::File).to receive(:diffable?).and_return(true) subject.execute(merge_request) end |