summaryrefslogtreecommitdiff
path: root/spec/lib
Commit message (Collapse)AuthorAgeFilesLines
* Properly save suggestions in project exportssh-fix-import-export-suggestionsStan Hu2019-08-102-1/+22
| | | | | | | | | | | | | | | | | | | Previously imports would fail if a merge request note included a suggestion with an `ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection` exception. This was happening because suggestions were listed as a descendant of merge requests, but this doesn't work because suggestions are directly associated with notes, not merge requests, and that association is lost. Rails also disallows creating intializing a has_many association through a different object. We fix this by making `suggestions` a child of `notes` within a merge request. This doesn't fix previously broken exported project exports, but new exports will work. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65880
* Merge branch 'issue_58494' into 'master'Robert Speicher2019-08-091-0/+11
|\ | | | | | | | | | | | | Prevent rewritting plain links as embedded Closes #58494 See merge request gitlab-org/gitlab-ce!31489
| * Prevent rewritting plain links as embeddedissue_58494Felipe Artur2019-08-071-0/+11
| | | | | | | | | | Prevents rewritting plain image/video links as embedded when moving issues.
* | Remove gfm_embed_metrics flag from BETristan Read2019-08-092-20/+0
| | | | | | | | | | | | Removes the feature flag that controls whether metrics dashboard urls unfurl the metrics dashboard charts.
* | Merge branch 'revert-d61dab91' into 'master'Bob Van Landuyt2019-08-091-8/+0
|\ \ | | | | | | | | | | | | Revert "Merge branch '65152-selective-highlight' into 'master'" See merge request gitlab-org/gitlab-ce!31643
| * | Revert "Merge branch '65152-selective-highlight' into 'master'"revert-d61dab91Patrick Bajao2019-08-091-8/+0
| | | | | | | | | This reverts merge request !31361
* | | Merge branch 'sh-fix-sidekiq-scheduling-latency' into 'master'Thong Kuah2019-08-091-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix Sidekiq scheduling_latency_s Closes #65748 See merge request gitlab-org/gitlab-ce!31650
| * | | Fix Sidekiq scheduling_latency_ssh-fix-sidekiq-scheduling-latencyStan Hu2019-08-081-2/+2
| |/ / | | | | | | | | | | | | | | | | | | This number was reporting a negative number because `current_time` was a monotonic counter, not an absolute time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65748
* | | Add Gitaly and Rugged call timing in Sidekiq logsStan Hu2019-08-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will help identify Sidekiq jobs that invoke excessive number of filesystem access. The timing data is stored in `RequestStore`, but this is only active within the middleware and is not directly accessible to the Sidekiq logger. However, it is possible for the middleware to modify the job hash to pass this data along to the logger.
* | | Merge branch '39217-remove-kubernetes-service-integration' into 'master'James Lopez2019-08-091-1/+0
|\ \ \ | |/ / |/| | | | | | | | Remove KubernetesService integration See merge request gitlab-org/gitlab-ce!31365
| * | Final removal of KubernetesService39217-remove-kubernetes-service-integrationTiger2019-08-081-1/+0
| | | | | | | | | | | | | | | | | | Creating new records has been disabled, and all existing records been migrated to clusters as of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28534
* | | Add a field for released_at to GH importerCindy Pallares 🦉2019-08-091-2/+5
| | |
* | | Bring scoped environment variables to coreHordur Freyr Yngvason2019-08-082-0/+41
| | | | | | | | | | | | As decided in https://gitlab.com/gitlab-org/gitlab-ce/issues/53593
* | | Record usage on snippet usageMark Chao2019-08-083-0/+93
| | | | | | | | | | | | Generalize wiki page counter for other page types to extend to.
* | | Merge branch '63181-collapsible-line' into 'master'Kushal Pandya2019-08-081-3/+3
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Makes section title clickable and collapsible Closes #63181 See merge request gitlab-org/gitlab-ce!31571
| * | Makes title section collapsible63181-collapsible-lineFilipa Lacerda2019-08-071-3/+3
| | | | | | | | | | | | | | | In the job log, if the user clicks the section title the job log section will be collapsed
* | | Merge branch 'sh-add-missing-csp-report-uri' into 'master'Mayra Cabrera2019-08-071-1/+3
|\ \ \ | | | | | | | | | | | | | | | | Add missing report-uri to CSP config See merge request gitlab-org/gitlab-ce!31593
| * | | Add missing report-uri to CSP configsh-add-missing-csp-report-uriStan Hu2019-08-071-1/+3
| | | | | | | | | | | | | | | | | | | | This is supported in Rails 5.2, although it may be deprecated in the future by reports-to.
* | | | Save instance administration project id in DBReuben Pereira2019-08-071-0/+10
| | | | | | | | | | | | | | | | | | | | - This will make it easy to identify the project even if admins change the name of the project or move it.
* | | | Support dashboard params for metrics dashboardSarah Yasonik2019-08-073-3/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/62971 Adds support to EnvironmentsController#metrics_dashboard for the following params: group, title, y_label These params are used to uniquely identify a panel on the metrics dashboard. Metrics are stored in several places, so this adds utilities to find a specific panel from the database or filesystem depending on the metric specified. Also moves some shared utilities into separate classes, notably default values and errors.
* | | | Initial commit of WIP code for considerationKerri Miller2019-08-071-0/+11
|/ / / | | | | | | | | | Squash this commit and reword before merging..
* | | Merge branch 'sh-support-csp-nonce' into 'master'Ash McKenzie2019-08-071-0/+59
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add support for Content-Security-Policy Closes #65330 See merge request gitlab-org/gitlab-ce!31402
| * | | Add support for Content-Security-PolicyStan Hu2019-08-071-0/+59
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A nonce-based Content-Security-Policy thwarts XSS attacks by allowing inline JavaScript to execute if the script nonce matches the header value. Rails 5.2 supports nonce-based Content-Security-Policy headers, so provide configuration to enable this and make it work. To support this, we need to change all `:javascript` HAML filters to the following form: ``` = javascript_tag nonce: true do :plain ... ``` We use `%script` throughout our HAML to store JSON and other text, but since this doesn't execute, browsers don't appear to block this content from being used and require the nonce value to be present.
* | | Use separate Kubernetes namespaces per environmentTiger Watson2019-08-073-19/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kubernetes deployments on new clusters will now have a separate namespace per project environment, instead of sharing a single namespace for the project. Behaviour of existing clusters is unchanged. All new functionality is controlled by the :kubernetes_namespace_per_environment feature flag, which is safe to enable/disable at any time.
* | | Convert RestClient to Gitlab::HTTP for Prometheus MonitorDavid Wilkins2019-08-073-13/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Closes #60024 - Change PrometheusClient.new to accept a base url instead of an already created RestClient - Use Gitlab::HTTP in PrometheusClient instead of creating RestClient in PrometheusService - Move http_options from PrometheusService to PrometheusClient (follow_redirects: false) - ensure that base urls don't have the trailing slash - Created a `PrometheusClient#url` method that might not be strictly required - Change rescued exceptions from RestClient::* to HTTParty::ResponseError where possible and StandardError for the rest
* | | Merge branch '65152-selective-highlight' into 'master'Bob Van Landuyt2019-08-061-0/+8
|\ \ \ | |_|/ |/| | | | | | | | Support selective highlighting of lines See merge request gitlab-org/gitlab-ce!31361
| * | Support selective highlighting of lines65152-selective-highlightPatrick Bajao2019-08-061-0/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | Instead of highlighting all lines when not all of them are needed, only highlight specific lines. The `BlobPresenter#highlight` method has been updated to support `since` and `to` params. These params will be used to limit the content to be highlighted. Modify `Gitlab::Highlight` to support `since` param which will then be used to determine the starting line number.
* | Merge branch 'make-issue-boards-importable' into 'master'Sean McGivern2019-08-065-1/+109
|\ \ | | | | | | | | | | | | Make issue boards importable See merge request gitlab-org/gitlab-ce!31434
| * | Make issue boards importableJason Colyer2019-08-025-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added Importable to models/list.rb - Did unless: :importable? on board validation - Created changelog - Modified haml to show issue boards are importable - Added needed spec tests - Modified project.json to include board information - Added relevant models to all_models - Added relevant models to import_export - Added relevant models to safe_model_attributes
* | | Add MergeRequestDiff#lines_count convenience methodbackport-productivty-analytics-migrationsPavel Shutsin2019-08-061-0/+6
| |/ |/|
* | Merge branch 'georgekoltsov/55474-outbound-setting-system-hooks' into 'master'Rémy Coutable2019-08-053-8/+8
|\ \ | |/ |/| | | | | Add outbound setting for system hooks See merge request gitlab-org/gitlab-ce!31177
| * Refactor SystemHookUrlValidator and specsGeorge Koltsov2019-08-021-4/+4
| | | | | | | | | | | | Simplify SystemHookUrlValidator to inherit from PublicUrlValidator Refactor specs to move out shared examples to be used in both system hooks and public url validators.
| * Add outbound requests setting for system hooksGeorge Koltsov2019-08-022-4/+4
| | | | | | | | | | | | | | This MR adds new application setting to network section `allow_local_requests_from_system_hooks`. Prior to this change system hooks were allowed to do local network requests by default and we are adding an ability for admins to control it.
* | Implement Helm ResetCommand for removing TillerDylan Griffith2019-08-021-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | Also creates specs Only allow Helm to be uninstalled if it's the only app - Remove Tiller leftovers after reser command - Fixes specs and offenses Adds changelog file Fix reset_command specs
* | Make needs: to require previous jobsmake-needs-strong-connectionKamil Trzciński2019-08-023-6/+54
|/ | | | | | | | | This changes `needs:` from weak reference to have a strong reference. This means that job will not be created unless all needs are present as part of a pipeline.
* Prevent empty classes in ansi2html conversionLukas '+ alert('Eipi') + ' Eipert2019-08-022-31/+28
| | | | | | | Currently we write out empty CSS classes (`class=""`) every time we create a new tag. This adds 9 unnecessary bytes per span element. In a recent trace, I have counted 11950 span elements. So we transported 105 unnecessary kilobytes!
* Call `GC::Profiler.clear` only in one placeAleksei Lipniagov2019-08-022-24/+16
| | | | | | | | | | | | | | | Previously, both InfluxSampler and RubySampler were relying on the `GC::Profiler.total_time` data which is the sum over the list of captured GC events. Also, both samplers asynchronously called `GC::Profiler.clear` which led to incorrect metric data because each sampler has the wrong assumption it is the only object who calls `GC::Profiler.clear` and thus could rely on the gathered results between such calls. We should ensure that `GC::Profiler.total_time` is called only in one place making it possible to rely on accumulated data between such wipes. Also, we need to track the amount of profiler reports we lost.
* Merge branch 'osw-avoid-errors-due-to-concurrent-calls' into 'master'Douwe Maan2019-08-011-4/+13
|\ | | | | | | | | Add exclusive lease to mergeability check process See merge request gitlab-org/gitlab-ce!31082
| * Add exclusive lease to mergeability check processosw-avoid-errors-due-to-concurrent-callsOswaldo Ferreira2019-07-311-4/+13
| | | | | | | | | | | | | | | | Concurrent calls to UserMergeToRef RPC updating a single ref can lead to an opaque fail that is being rescued at Gitaly. So this commit adds an exclusive lease to the mergeability check process with the key as the current MR ID.
* | Add support for DAGKamil Trzciński2019-08-013-26/+166
| | | | | | | | | | | | This implements the support for `needs:` keyword as part of GitLab CI. That makes some of the jobs to be run out of order.
* | Merge branch 'sh-fix-infite-loop-peek-bar' into 'master'Sean McGivern2019-08-011-3/+7
|\ \ | | | | | | | | | | | | | | | | | | Fix SystemStackError when Peek bar is active with Rugged calls Closes #65404 See merge request gitlab-org/gitlab-ce!31357
| * | Fix SystemStackError when Peek bar is active with Rugged callssh-fix-infite-loop-peek-barStan Hu2019-07-311-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Peek attempts to serialize results with `to_json`, which calls `ActiveSupport::JSON`. If an object is passed to `to_json` that contains instance variables, `ActiveSupport` will attempt to recursively traverse all variables. The problem is that we can get into an infinite loop if the instance references to an instance that references to something else that points back to the same instance. To avoid this mess, we just call `to_s` on the object. It appears only `Gitlab::Git::Repository` and `::Repository` are the culprits here. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65404
* | | Merge branch '65363-add-feature-remove' into 'master'Stan Hu2019-08-011-0/+16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Add Feature.remove Closes #65363 See merge request gitlab-org/gitlab-ce!31315
| * | | Add new Feature.remove method65363-add-feature-removeAsh McKenzie2019-08-011-0/+16
| | |/ | |/|
* | | Merge branch '65297-fix-typo-on-clusters_applications_cert_managers-factory' ↵Thong Kuah2019-07-311-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | into 'master' Resolve "Fix typo on clusters_applications_cert_managers factory" Closes #65297 See merge request gitlab-org/gitlab-ce!31278
| * | Remove typo from factory name65297-fix-typo-on-clusters_applications_cert_managers-factoryJoão Cunha2019-07-301-1/+1
| | | | | | | | | | | | | | | - the typo in this factory name was precluding us from properly creating dynamic code to remove duplciation.
* | | Merge branch 'fix-sidekiq-memory-killer-warn-message' into 'master'Stan Hu2019-07-311-2/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix sidekiq memory killer warning message Closes gitlab-com/gl-infra/infrastructure#7371 See merge request gitlab-org/gitlab-ce!31264
| * | | Fix sidekiq memory killer warning messagefix-sidekiq-memory-killer-warn-messageShinya Maeda2019-07-301-2/+5
| | | |
* | | | Adds Sidekiq scheduling latency structured logging fieldAndrew Newdigate2019-07-311-5/+39
| | | |
* | | | Default dependency job stage index to Infinity, and correctly report it as ↵drew2019-07-311-0/+25
| | | | | | | | | | | | | | | | undefined in prior stages