Commit Graph

16644 Commits

Author SHA1 Message Date
George Koltsov 23dfc5d606 Add code review suggestions 2019-08-12 15:05:49 +01:00
Thong Kuah b577825e54 Bump Helm to 2.14.3 and kubectl to 1.11.10 2019-08-13 00:07:27 +12:00
Aleksei Lipniagov 35fb27db27 Remove worker label from puma terminations metric 2019-08-12 13:52:15 +03:00
George Koltsov 91353779bf Add changelog entry 2019-08-12 11:16:17 +01:00
George Koltsov 1c2554bfd3 Add BitBucketServerImport project filtering 2019-08-12 11:16:17 +01:00
Stan Hu 26107e9354 Properly save suggestions in project exports
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
2019-08-10 18:50:42 -07:00
Armin Hohenegger 20ac5e6d4b fix handling of empty ref_name parameter string in commits api
when params[:ref_name] is set to "" by passing an empty query parameter
to the api it is evaluated as false by the || operator.
The use of active support core extensions presence method fixes the original
implemantation.

https://guides.rubyonrails.org/active_support_core_extensions.html#presence
2019-08-10 19:11:20 +02:00
Stan Hu afe867921c Rename branches_exist? -> includes_branches? 2019-08-09 15:41:07 -07:00
Igor b99011af62 Split MR widget into cached and non-cached serializers
Splits auto-refreshing of MR widget into 2 requests:

- the one which uses etag-caching and invalidates the fields on change
- the one without caching

The idea is to gradually move all the fields to etag-cached endpoint
2019-08-09 21:01:55 +00:00
Robert Speicher 4b10592b81 Merge branch 'issue_58494' into 'master'
Prevent rewritting plain links as embedded

Closes #58494

See merge request gitlab-org/gitlab-ce!31489
2019-08-09 20:41:12 +00:00
Tristan Read 5e6a58040b Remove gfm_embed_metrics flag from BE
Removes the feature flag that controls whether
metrics dashboard urls unfurl the metrics dashboard
charts.
2019-08-09 20:35:43 +00:00
Bob Van Landuyt e0e6e9e7db Merge branch 'revert-d61dab91' into 'master'
Revert "Merge branch '65152-selective-highlight' into 'master'"

See merge request gitlab-org/gitlab-ce!31643
2019-08-09 16:29:13 +00:00
Rémy Coutable 39f9f0bdbb Merge branch 'lib-differences' into 'master'
Resolve EE differences in the lib/ directory

See merge request gitlab-org/gitlab-ce!31582
2019-08-09 14:34:45 +00:00
Thong Kuah 9e19125f39 Merge branch 'sh-fix-sidekiq-scheduling-latency' into 'master'
Fix Sidekiq scheduling_latency_s

Closes #65748

See merge request gitlab-org/gitlab-ce!31650
2019-08-09 11:59:44 +00:00
Patrick Bajao d96c24d815 Invalidate branches cache on PostReceive
Whenever `PostReceive` is enqueued, `UpdateMergeRequestsWorker`
is enqueued and `MergeRequests::RefreshService` is called, it'll
check if the source branch of each MR asssociated to the push exists
or not via `MergeRequest#source_branch_exists?`. The said method will
call `Repository#branch_exists?` which is cached in `Rails.cache`.

When the cache contains outdated data and the source branch actually
exists, the `MergeRequests#RefreshService` job will close associated
MRs which is not correct.

The fix is to expire the branches cache of the project so we have
updated data during the post receive hook which will help in the
accuracy of the check if we need to close associated MRs or not.
2019-08-09 18:09:06 +08:00
Stan Hu a74396dcc5 Add Gitaly and Rugged call timing in Sidekiq logs
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.
2019-08-09 01:08:32 -07:00
James Lopez bbf639c43d Merge branch '39217-remove-kubernetes-service-integration' into 'master'
Remove KubernetesService integration

See merge request gitlab-org/gitlab-ce!31365
2019-08-09 07:10:26 +00:00
Rémy Coutable 44065b0138 Merge branch 'speed-up-labels-api' into 'master'
Remove label issue and MR counts from default API responses

See merge request gitlab-org/gitlab-ce!31543
2019-08-09 06:25:29 +00:00
Stan Hu 7ccbb562b1 Fix Sidekiq scheduling_latency_s
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
2019-08-08 20:51:40 -07:00
Patrick Bajao 6d318af5f9 Revert "Merge branch '65152-selective-highlight' into 'master'"
This reverts merge request !31361
2019-08-09 00:13:09 +00:00
Cindy Pallares 🦉 2b30423935 Add a field for released_at to GH importer 2019-08-09 00:06:21 +00:00
Stan Hu 0324028a3f Rename githost.log -> git_json.log
The githost.log name was often confused with GitHost.io. Rename this to
git_json.log to make it clear it's coming from Git and that it's JSON
data.
2019-08-08 13:39:11 -07:00
Hordur Freyr Yngvason 5f82ff1469 Bring scoped environment variables to core
As decided in https://gitlab.com/gitlab-org/gitlab-ce/issues/53593
2019-08-08 18:51:52 +00:00
Sean McGivern e6dc5168b8 Remove label issue and MR counts from default API responses
These counts significantly increase the load time for these
requests. Users can now opt in to receiving the counts by setting
`with_counts=true` in requests. This is a breaking change, but hopefully
a fairly minor one.
2019-08-08 17:10:41 +01:00
Robert Speicher 79bff3ee7a Merge branch '12026-use-notes-finder-target-for-epics-ce' into 'master'
Use NotesFinder#target to find Epics

See merge request gitlab-org/gitlab-ce!31408
2019-08-08 15:39:13 +00:00
Felipe Artur 492a7e753d Fix DNS rebind vulnerability for JIRA integration
Uses Gitlab::HTTP for JIRA requests instead of Net::Http.
Gitlab::Http comes with some built in SSRF protections.
2019-08-08 10:24:43 -03:00
Mark Chao 4a6f959ab8 Record usage on snippet usage
Generalize wiki page counter for other page types to extend to.
2019-08-08 13:18:57 +00:00
George Koltsov ba429a6e20 Apply code review feedback 2019-08-08 13:16:33 +01:00
Yorick Peterse a4e13a5966
Backport EE changes to ProjectSearchResults
EE made some changes to the project_ids_relation method, but these were
not backported to CE.
2019-08-08 13:34:07 +02:00
Yorick Peterse 4c53b3945c
Backport EE changes to the project import API
EE added a single line to this file that can easily be backported to CE,
but it appears this was overlooked. The method called is a noop in CE,
so no additional changes are necessary.
2019-08-08 13:34:07 +02:00
Kushal Pandya 8505049e1f Merge branch '63181-collapsible-line' into 'master'
Makes section title clickable and collapsible

Closes #63181

See merge request gitlab-org/gitlab-ce!31571
2019-08-08 09:04:29 +00:00
Grzegorz Bizon 400da76d5e Merge branch 'patch-71' into 'master'
Remove duplicated line from Maven CI template

See merge request gitlab-org/gitlab-ce!31440
2019-08-08 08:42:03 +00:00
Stan Hu 3ad34c3a24 Merge branch '20137-starrers' into 'master'
Add possibilty to view starrers ("stargazers") of a repository & any user's starred repositories

Closes #20137

See merge request gitlab-org/gitlab-ce!24690
2019-08-08 04:40:55 +00:00
Tiger e3696bf20e Final removal of KubernetesService
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
2019-08-08 09:47:07 +10:00
Mayra Cabrera eec1ed522d Merge branch 'sh-add-missing-csp-report-uri' into 'master'
Add missing report-uri to CSP config

See merge request gitlab-org/gitlab-ce!31593
2019-08-07 21:07:06 +00:00
Philippe Lafoucrière e5a830bac1 Checksum clair executable 2019-08-07 19:05:56 +00:00
Camil Staps 99bb207ef1
Fix tests 2019-08-07 20:49:16 +02:00
Camil Staps e8bdcdf0f8
Expose time since starring on project/:id/starrers API endpoint; exclude private profiles here as well 2019-08-07 20:49:16 +02:00
Camil Staps 1ec8c0e837
Fix API endpoint for starred projects of a user; add info about starred projects on profile to documentation 2019-08-07 20:49:16 +02:00
Camil Staps e7c34c37c8
Add documentation and changelog for !24690 2019-08-07 20:49:15 +02:00
Camil Staps d03a4c9a07
Add users/:user_id/starred_projects API endpoint for projects starred by a user 2019-08-07 20:49:14 +02:00
Camil Staps 5b20df0a92
Add projects/:id/starrers API endpoint for users who starred a repository 2019-08-07 20:49:13 +02:00
Reuben Pereira af4a597d3f Save instance administration project id in DB
- This will make it easy to identify the project even if admins change
the name of the project or move it.
2019-08-07 18:40:36 +00:00
Felipe Artur 831ceea924 Prevent rewritting plain links as embedded
Prevents rewritting plain image/video links as embedded when moving
issues.
2019-08-07 15:39:48 -03:00
Stan Hu d265408c26 Add missing report-uri to CSP config
This is supported in Rails 5.2, although it may be
deprecated in the future by reports-to.
2019-08-07 11:21:08 -07:00
Sarah Yasonik bf918b68f6 Support dashboard params for metrics dashboard
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.
2019-08-07 16:17:35 +00:00
Filipa Lacerda 85e0eb472d Makes title section collapsible
In the job log, if the user clicks the section title
the job log section will be collapsed
2019-08-07 16:42:17 +01:00
Kerri Miller 336d3ccc65 Initial commit of WIP code for consideration
Squash this commit and reword before merging..
2019-08-07 15:13:13 +00:00
George Koltsov 5ba77a4999 Add author lines to project import comments 2019-08-07 14:01:40 +01:00
Zeger-Jan van de Weg 3ace5766e9
Use Git 2.22 for GitLab
Part of: https://gitlab.com/gitlab-org/gitaly/issues/1715
2019-08-07 14:25:58 +02:00
Ash McKenzie 6cafa70027 Merge branch 'sh-support-csp-nonce' into 'master'
Add support for Content-Security-Policy

Closes #65330

See merge request gitlab-org/gitlab-ce!31402
2019-08-07 05:03:05 +00:00
Tiger Watson 36a01a88ce Use separate Kubernetes namespaces per environment
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.
2019-08-07 04:40:29 +00:00
David Wilkins 467a411e88 Convert RestClient to Gitlab::HTTP for Prometheus Monitor
- 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
2019-08-07 02:42:20 +00:00
Stan Hu 5fbbd3dd6e
Add support for Content-Security-Policy
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.
2019-08-07 12:37:31 +10:00
Kelly Hair 4b91047c22 Update Packer.gitlab-ci.yml to use latest image 2019-08-06 13:00:55 -04:00
Bob Van Landuyt d61dab9147 Merge branch '65152-selective-highlight' into 'master'
Support selective highlighting of lines

See merge request gitlab-org/gitlab-ce!31361
2019-08-06 16:42:14 +00:00
Sean McGivern 2608732271 Merge branch 'make-issue-boards-importable' into 'master'
Make issue boards importable

See merge request gitlab-org/gitlab-ce!31434
2019-08-06 12:40:33 +00:00
Patrick Bajao 46631e1023 Support selective highlighting of lines
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.
2019-08-06 09:32:29 +08:00
Gosia Ksionek 6c5e948013 Fix error on project name
Add project path to sql query to build proper path
2019-08-05 21:15:00 +00:00
Steve Abrams 3dbf3997bb Add group level container repository endpoints
API endpoints for requesting container repositories
and container repositories with their tag information
are enabled for users that want to specify the group
containing the repository rather than the specific project.
2019-08-05 20:00:50 +00:00
Douglas Barbosa Alexandre e9918b1a94 Merge branch 'sh-disable-redis-peek' into 'master'
Only track Redis calls if Peek is enabled

See merge request gitlab-org/gitlab-ce!31438
2019-08-05 19:09:48 +00:00
Stan Hu c368bae5b7 Merge branch 'add-missing-timezone-legacy-artifacts' into 'master'
Add missing timezone when copying legacy artifacts (ci_builds)

See merge request gitlab-org/gitlab-ce!31447
2019-08-05 17:33:39 +00:00
Jason Colyer f4ceff6e0c Make Issue boards importable
- Added space to li definiton
- Remove milestone from import_export.yml
2019-08-05 08:28:39 -05:00
Rémy Coutable f74387d298 Merge branch 'georgekoltsov/55474-outbound-setting-system-hooks' into 'master'
Add outbound setting for system hooks

See merge request gitlab-org/gitlab-ce!31177
2019-08-05 08:55:16 +00:00
Sean McGivern 5e20689d89 Merge branch 'GL-12757' into 'master'
Increase clair scanner from v11 to v12

See merge request gitlab-org/gitlab-ce!30809
2019-08-05 07:56:09 +00:00
Cameron Boulton 4b76d631e4 Set DOCKER_TLS_CERTDIR in CI job templates 2019-08-05 03:47:24 +00:00
Patrick Derichs c69a47049c Use NotesFinder#target to find Epics 2019-08-04 21:04:31 +02:00
Matija Čupić 16084ee9d3
Port changes from EE
Ports changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/12343
2019-08-04 19:42:29 +02:00
David H. Wilkins afb3c3c1fb Add missing timezone to legacy artifacts (ci_builds)
- ci_builds.artifacts_expire_at are copied to
  ci_job_artifacts.expire_at with incorrect timestamps when the
  database timezone is NOT utc

- ci_builds.artifacts_expire_at is `timestamp without time zone` and
  ci_job_artifacts.expire_at is `timestamp with time zone` on
  postgresql

- Tests fail locally for `rspec
  ./spec/lib/gitlab/import_export/import_export_spec.rb` without this
  change
2019-08-04 12:33:37 -05:00
Zsolt Kovari ccb46f6f4d Remove duplicated line from Maven CI template 2019-08-03 11:22:11 +00:00
Stan Hu a43c84e6ab Only track Redis calls if Peek is enabled
In dev environments, Sidekiq was encountering the message:

Circular dependency detected while autoloading constant Gitlab::Profiler

This saves some overhead during normal usage.
2019-08-02 23:48:14 -07:00
mo 6a6be879e0
increase clair local scan version 2019-08-02 14:01:53 -06:00
mo e0d7df6561
increase clair from v11 to v12 2019-08-02 14:01:51 -06:00
Jason Colyer 87235d009c Make issue boards importable
- 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
2019-08-02 14:35:10 -05:00
Dylan Griffith 5027979b9b Implement Helm ResetCommand for removing Tiller
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
2019-08-02 19:02:57 +00:00
Sean McGivern c7de5403bd Merge branch 'make-needs-strong-connection' into 'master'
Make `needs:` to require a strong reference

Closes #65512

See merge request gitlab-org/gitlab-ce!31419
2019-08-02 18:48:52 +00:00
Kamil Trzciński 684751d3c2 Make needs: to require previous jobs
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.
2019-08-02 18:41:40 +02:00
Robert Speicher 1bc2ac330e Merge branch '17276-breakage-in-displaying-svg-in-the-same-repository' into 'master'
Resolve "Breakage in displaying SVG in the same repository"

See merge request gitlab-org/gitlab-ce!31352
2019-08-02 16:32:40 +00:00
George Koltsov 5e3a208f58 Add backwards compatibility for legacy setting
`allow_local_requests_for_hooks_and_services` was renamed to
`allow_local_requests_for_web_hooks_and_services`.
2019-08-02 15:39:18 +01:00
George Koltsov 8abf920d1f Refactor SystemHookUrlValidator and specs
Simplify SystemHookUrlValidator to inherit from PublicUrlValidator
Refactor specs to move out shared examples to be used in both
system hooks and public url validators.
2019-08-02 15:39:18 +01:00
George Koltsov e5e1c907c0 Add outbound requests setting for system hooks
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.
2019-08-02 15:39:18 +01:00
Lukas '+ alert('Eipi') + ' Eipert fc9f099884 Prevent empty classes in ansi2html conversion
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!
2019-08-02 14:38:50 +00:00
Aleksei Lipniagov 1f9edb7c4a Call `GC::Profiler.clear` only in one place
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.
2019-08-02 09:04:32 +00:00
Marcel Amirault 98d6db4b43 Update regex for docs branches in ci
Changes * to + to be more precise with acceptable branch names
2019-08-02 06:24:07 +00:00
Heinrich Lee Yu 3b1da9be25 Fix inline rendering of SVGs from current repo
Changes generated URL to raw instead of blob
2019-08-02 06:34:20 +08:00
Stan Hu dbc6c24403 Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'
Use NotesFinder to fetch notes on API and Controllers

Closes #52123

See merge request gitlab-org/gitlab-ce!31300
2019-08-01 16:27:02 +00:00
Douwe Maan c017dc578d Merge branch 'osw-avoid-errors-due-to-concurrent-calls' into 'master'
Add exclusive lease to mergeability check process

See merge request gitlab-org/gitlab-ce!31082
2019-08-01 14:58:14 +00:00
Kamil Trzciński e7ee84aad4 Add support for DAG
This implements the support for `needs:` keyword
as part of GitLab CI. That makes some of the jobs
to be run out of order.
2019-08-01 14:26:49 +00:00
Sean McGivern 4072c8e1bc Merge branch 'sh-backtrace-clean-sidekiq' into 'master'
Add additional paths to clean from backtrace

See merge request gitlab-org/gitlab-ce!31363
2019-08-01 09:44:06 +00:00
Sean McGivern 3186a3bfe3 Merge branch 'sh-fix-infite-loop-peek-bar' into 'master'
Fix SystemStackError when Peek bar is active with Rugged calls

Closes #65404

See merge request gitlab-org/gitlab-ce!31357
2019-08-01 09:42:28 +00:00
Patrick Derichs 0e99daae4a Use NotesFinder in IssuableActions module
Remove project from NotesFinder constructor

Add project parameter to specs

Also look for methods in private scope

Fix specs to match new NotesFinder constructor
2019-08-01 10:42:42 +02:00
Stan Hu 9225eb13ca Add additional paths to clean from backtrace
`Gitlab::Profiler` can also be used to profile Sidekiq jobs.
Add some call traces that can be omitted from the backtrace.
2019-07-31 23:07:42 -07:00
Stan Hu cfb7f11644 Merge branch '65363-add-feature-remove' into 'master'
Add Feature.remove

Closes #65363

See merge request gitlab-org/gitlab-ce!31315
2019-08-01 00:02:07 +00:00
Oswaldo Ferreira f4cd926cf3 Add exclusive lease to mergeability check process
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.
2019-07-31 19:58:43 -03:00
Stan Hu 7a5c4cd0ca Fix SystemStackError when Peek bar is active with Rugged calls
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
2019-07-31 15:47:19 -07:00
Ash McKenzie 31e419e945
Add new Feature.remove method 2019-08-01 08:29:14 +10:00
Lin Jen-Shin bea3d730c2 Merge branch 'add-project-scope-to-live-trace-feature-flag' into 'master'
Add project scope to live trace feature flag

See merge request gitlab-org/gitlab-ce!31325
2019-07-31 13:30:06 +00:00
Stan Hu 7bab7b6993 Merge branch 'fix-sidekiq-memory-killer-warn-message' into 'master'
Fix sidekiq memory killer warning message

Closes gitlab-com/gl-infra/infrastructure#7371

See merge request gitlab-org/gitlab-ce!31264
2019-07-31 13:04:46 +00:00
Andrew Newdigate ee828f09bf Adds Sidekiq scheduling latency structured logging field 2019-07-31 12:07:47 +00:00
drew 5eb3c4af38 Default dependency job stage index to Infinity, and correctly report it as undefined in prior stages 2019-07-31 12:06:01 +00:00
João Cunha d7c7ebf50a Allow knative do be uninstalled:
- After uninstalling the knative helm chart it's necessary to also
remove some leftover resources to allow the cluster to be clean
and knative to be reinstalleable.
- Adds knative uninstall disclaimer
- Uninstall ksvc before uninstalling knative

Make list of Knative and Ingres resources explicit

- To avoid deleting unwanted resources we are listing exact
which resources will be deleted rather than simply deleting any
resource that contains istio or knative words.
2019-07-31 11:58:38 +00:00
Sean McGivern fff0fc7b4c Merge branch '65317-adapt-tae-role-name-change' into 'master'
Fix Danger finding a test reviewer

Closes #65317

See merge request gitlab-org/gitlab-ce!31292
2019-07-31 11:32:13 +00:00
Małgorzata Ksionek dfcf4cf5f1 Add captcha if there are multiple failed login attempts
Add method to store session ids by ip

Add new specs for storing session ids

Add cleaning up records after login

Add retrieving anonymous sessions

Add login recaptcha setting

Add new setting to sessions controller

Add conditions for showing captcha

Add sessions controller specs

Add admin settings specs for login protection

Add new settings to api

Add stub to devise spec

Add new translation key

Add cr remarks

Rename class call

Add cr remarks

Change if-clause for consistency

Add cr remarks

Add code review remarks

Refactor AnonymousSession class

Add changelog entry

Move AnonymousSession class to lib

Move store unauthenticated sessions to sessions controller

Move link to recaptcha info

Regenerate text file

Improve copy on the spam page

Change action filter for storing anonymous sessions

Fix rubocop offences

Add code review remarks
2019-07-31 11:47:55 +02:00
Shinya Maeda 759a3484ca Add project scope to live trace feature flag
Add project scope
2019-07-31 15:43:52 +07:00
Diego Louzán e20538088b Add support page link in help menu
Creates a new item in help dropdown to show configured support page link
2019-07-30 17:03:17 +00:00
Giorgenes Gelatti c2d1fbe507
Validates tag names and tags#bulk_destroy 2019-07-30 13:49:48 -03:00
Douglas Barbosa Alexandre d92a8c1a5f Merge branch 'sh-fix-gitaly-access-control' into 'master'
Fix exception handling in Gitaly autodetection

Closes #65328

See merge request gitlab-org/gitlab-ce!31285
2019-07-30 15:32:59 +00:00
Lin Jen-Shin 0c7e13f912
Update regular expression to extract stage name
Since now the role name can be:

"<a href=\"/job-families/engineering/test-automation-engineer/\">Senior Test Automation Engineer</a>, Create:Source Code"

We need to cope with </a> in the middle.
2019-07-30 22:29:02 +08:00
Stan Hu 3b76d2982f Fix exception handling in Gitaly autodetection
In SELinux, the file cannot be written, and `Errno::EACCES`, not
`Errno::ACCESS` is thrown.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/65328
2019-07-30 07:03:45 -07:00
Hordur Freyr Yngvason 012fe3141e Fix broken update_project_templates rake task
This rake task had been broken for a while. This fixes the breakages,
adds a test to help avoid future breakages, and adds a few ergonomic
improvements to the task itself.
2019-07-30 13:52:28 +00:00
Sean McGivern 18cdc5ba6c Remove line profiler from performance bar
1. The output isn't great. It can be hard to find hotspots and, even
   when you do find them, to find why those are hotspots.
2. It uses some jQuery-specific frontend code which we can remove now
   that we don't have this any more.
3. It's only possible to profile the initial request, not any subsequent
   AJAX requests.
2019-07-30 10:00:52 +01:00
Shinya Maeda 8f14d3c140 Fix sidekiq memory killer warning message 2019-07-30 13:47:13 +07:00
Douglas Barbosa Alexandre 534f8fc797 Merge branch 'determinstic_dns_specs' into 'master'
Have deterministic DNS for specs

See merge request gitlab-org/gitlab-ce!31086
2019-07-30 01:27:52 +00:00
Robert Speicher 2f680d6481 Merge branch '63547-add-system-notes-for-when-a-zoom-call-was-added-removed-from-an-issue' into 'master'
Resolve "Add system notes for when a zoom call was added/removed from an issue"

Closes #63547

See merge request gitlab-org/gitlab-ce!30857
2019-07-29 23:14:38 +00:00
Sarah Yasonik dfe13131d7 Move BaseService to Services directory
In preparation for embedding specific metrics in issues
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971,
this commit moves the BaseService for metrics dashboards
to a new services subdirectory. This is purely for the sake
of organization and maintainability.
2019-07-29 23:03:59 +00:00
🙈 jacopo beschi 🙉 c96e125700 Make quick action "commands applied" banner more useful
Extends the quick actions "commands applied" banner to show
the quick action preview text, but with everything in past tense.
2019-07-29 22:35:29 +00:00
Thong Kuah d6a7408fd3
Explicitly reject non http(s) schemes
Rather than relying on NoMethodError deep inside faraday
2019-07-29 19:20:30 -03:00
Francisco Javier López 5738171aef Fix broken master because of security merge 2019-07-29 20:58:44 +00:00
Jacopo 6613a57772 Add system notes for when a zoom call was added/removed from an issue
Add a zoom link added / removed system note when a zoom link is being
added / removed to the issue description.
2019-07-29 21:51:16 +02:00
Robert Speicher fe22704a20
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-07-29 13:19:50 -05:00
Stan Hu 7064d48e2b Merge branch 'remove-peek-pg' into 'master'
Replace peek-pg with our own implementation

Closes #44441

See merge request gitlab-org/gitlab-ce!31187
2019-07-29 16:27:57 +00:00
Lin Jen-Shin dbe3b9848b Merge branch 'resolve-scripts-differences' into 'master'
Backport EE changes made to the scripts/ directory

See merge request gitlab-org/gitlab-ce!31015
2019-07-29 15:15:46 +00:00
Stan Hu 914bfabba6 Merge branch 'ce-port-4550-add-project-download-export-audit-event' into 'master'
CE: Add project download & project export audit event

See merge request gitlab-org/gitlab-ce!31103
2019-07-29 13:10:16 +00:00
Nick Thomas f7641d848d Merge branch 'ab-remove-postgresql-switches' into 'master'
Further remove `if postgresql?` branches

Closes #65054

See merge request gitlab-org/gitlab-ce!31102
2019-07-29 12:55:11 +00:00
Yorick Peterse d7a4c1d2a5
Backport EE changes made to the scripts/ directory
This backport changes made by EE to the files in the scripts/ directory.
This comes with a few changes to some scripts to make them work in the
single codebase setup.
2019-07-29 13:53:20 +02:00
Ryan Cobb cfea48dffd Adds direct monitoring for sidekiq metrics
This adds diirect monitoring for sidekiq metrics. This is done via
sidekiq middleware and a sampler to pull from sidekiqs api.
2019-07-29 11:53:12 +00:00
Nick Thomas 3bb3ac3d53 Merge branch 'add-git-blame-api' into 'master'
Expose git blame in api

Closes #51345

See merge request gitlab-org/gitlab-ce!30675
2019-07-29 11:41:44 +00:00
Andreas Brandl 988dc80585
Further remove code branches by database type
We dropped MySQL support and a lot of mysql specific code has been
removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608.

This comes in from the other direction and removes any `if postgresql?`
branches.
2019-07-29 12:47:06 +02:00
Francisco Javier López 26e9efc011 Added navbar searches usage ping counter
Added usage ping counter when the user makes
a search through the navbar search component.
2019-07-29 09:58:58 +00:00
Matija Čupić a5aa40c5fe Add Job specific variables
Adds Job specific variables to facilitate specifying variables when
running manual jobs.
2019-07-29 07:43:10 +00:00
Stan Hu 2219b140b6 Merge branch '19186-redirect-wiki-git-route-to-wiki' into 'master'
Redirect project.wiki.git to project wiki home

See merge request gitlab-org/gitlab-ce!31085
2019-07-26 21:01:41 +00:00
Oleg Zubchenko 5a8eaef42e Add git blame api 2019-07-26 19:27:32 +03:00
Aleksei Lipniagov 13676e021c Fix pid discovery for Unicorn in PidProvider 2019-07-26 15:02:21 +00:00
Lin Jen-Shin bd1a5a9f42 Merge branch 'remove-nested-groups-checks' into 'master'
Remove code related to object hierarchy and MySQL

Closes #65056 and #65055

See merge request gitlab-org/gitlab-ce!31095
2019-07-26 14:57:12 +00:00
Robert Speicher 900ef6fc31 Merge branch 'mc/feature/find-all-artifacts-for-sha' into 'master'
Find build by sha from ref

Closes #64534 and #45697

See merge request gitlab-org/gitlab-ce!30843
2019-07-26 14:32:20 +00:00
Kerri Miller acc694ead6 Extract SanitizeNodeLink and apply to WikiLinkFilter
The SanitizationFilter was running before the WikiFilter. Since
WikiFilter can modify links, we could see links that _should_ be stopped
by SanatizationFilter being rendered on the page. I (kerrizor) had
previously addressed the bug in: 7bc971915b
However, an additional exploit was discovered after that was merged.
Working through the issue, we couldn't simply shuffle the order of
filters, due to some implicit assumptions about the order of filters, so
instead we've extracted the logic that sanitizes a Nokogiri-generated
Node object, and applied it to the WikiLinkFilter as well.

On moving filters around:
Once we start moving around filters, we get cascading failures; fix one,
another one crops up. Many of the existing filters in the WikiPipeline
chain seem to assume that other filters have already done their work,
and thus operate on a "transform anything that's left" basis;
WikiFilter, for instance, assumes any link it finds in the markdown
should be prepended with the wiki_base_path.. but if it does that, it
also turns `href="@user"` into `href="/path/to/wiki/@user"`, which the
UserReferenceFilter doesn't see as a user reference it needs to
transform into a user profile link. This is true for all the reference
filters in the WikiPipeline.
2019-07-26 13:41:11 +00:00
GitLab Release Tools Bot c4bc5dffa4 Merge branch 'security-github-ssrf-redirect' into 'master'
Do not allow localhost url redirection in GitHub Integration

See merge request gitlab/gitlabhq!3188
2019-07-26 13:41:05 +00:00
GitLab Release Tools Bot 890c1421a4 Merge branch 'security-remove-take-trigger-ownership-feature' into 'master'
Drop feature to take ownership of a trigger token

Closes #2868

See merge request gitlab/gitlabhq!3198
2019-07-26 13:41:02 +00:00
GitLab Release Tools Bot f65ed87489 Merge branch 'security-dns-ssrf-bypass' into 'master'
Server Side Request Forgery mitigation bypass

Closes #2872

See merge request gitlab/gitlabhq!3205
2019-07-26 13:40:57 +00:00
Sean McGivern ad1c71663f Replace peek-pg with our own implementation
This uses an ActiveRecord subscriber to get queries and calculate the
total query time from that. This means that the total will always be
consistent with the queries in the table. It does however mean that we
could potentially miss some queries that don't go through ActiveRecord.

Making this change also allows us to unify the response JSON a little
bit, making the frontend slightly simpler as a result.
2019-07-26 14:37:26 +01:00
Nick Thomas 55f99e930e Merge branch 'dm-submodule-links-nil' into 'master'
Fix error rendering submodules in MR diffs when there is no .gitmodules

See merge request gitlab-org/gitlab-ce!31162
2019-07-26 11:27:00 +00:00
Peter Leitzen 8136fac26c Prefer `flat_map` over `map` + `flatten`
Convert several occurrences of `map` + `flatten` to
`flat_map` where applicable.
2019-07-26 10:44:13 +00:00
Douwe Maan cfef1e8e99
Fix error rendering submodules in MR diffs when there is no .gitmodules
Without this change, we get a NoMethodError on nil
2019-07-26 11:05:56 +01:00
Dmitriy Zaporozhets f2b6c6ca0d Merge branch 'extract_auto_deploy_into_base_image' into 'master'
Extract Auto DevOps deploy functions in a base image

Closes #50286

See merge request gitlab-org/gitlab-ce!30404
2019-07-26 08:47:10 +00:00
Imre Farkas 929b403d21 Ensure Warden triggers after_authentication callback
By not triggering the callback:
- ActiveSession lookup keys are not cleaned
- Devise also misses its hook related to session cleanup
2019-07-26 07:05:50 +00:00
manojmj 6cfd13726f CE: Add project download & project export audit event
This change adds audit events for
download of repository and export of
project.
2019-07-26 12:25:56 +05:30
Luke Duncalfe 634a03bf60 Redirect project.wiki.git to project wiki home
https://gitlab.com/gitlab-org/gitlab-ce/issues/19186
2019-07-26 11:49:36 +12:00
Matija Čupić 38ab1ae2f2
Rename latest_successful to be more explicit
* Reword Project#latest_successful_build_for to
Project#latest_successful_build_for_ref
* Reword Ci::Pipeline#latest_successful_for to
Ci::Pipeline#latest_successful_build_for_ref
2019-07-26 00:17:52 +02:00
Stan Hu 3736e1de27 Merge branch 'print-sidekiq-class-name-in-memory-killer' into 'master'
Logging sidekiq worker class name in SidekiqMemoryKiller

See merge request gitlab-org/gitlab-ce!30996
2019-07-25 21:32:39 +00:00
Douwe Maan 9eea3623fa Merge branch 'frozen_string_spec_support' into 'master'
Add frozen_string_literal to spec/support

See merge request gitlab-org/gitlab-ce!31132
2019-07-25 17:23:50 +00:00
Lin Jen-Shin 767c5f6388 Merge branch 'label-descr-push-opts' into 'master'
Support title and desc on merge w/ push option

See merge request gitlab-org/gitlab-ce!31068
2019-07-25 16:37:05 +00:00
Douglas Barbosa Alexandre aa9db9c869 Merge branch '54478-table_exists-not-compatible-with-rails-5-1' into 'master'
Resolve "table_exists? not compatible with Rails 5.1"

Closes #54478

See merge request gitlab-org/gitlab-ce!30832
2019-07-25 15:05:07 +00:00
Dmitriy Zaporozhets 29f2903d16 Merge branch 'sh-support-docker-oci-images' into 'master'
Support Docker OCI images

Closes gitlab-ee#12877 and #58685

See merge request gitlab-org/gitlab-ce!31127
2019-07-25 13:12:24 +00:00
Thong Kuah d4ef3be35b Frozen string cannot change encoding
This was shown in specs but surely this will be happening in application
code as well if this method is passes a frozen string.

We were also trying to force_encode a OmniAuth::AuthHash which had the
very confusing behaviour of returning nil when it was sent a method that
it did not define. Fix that by only force_encoding a String.
2019-07-26 00:13:25 +12:00
Sean McGivern 2dd33c0812 Merge branch '9643-jira-api-serializer-ce' into 'master'
[CE] Create serializer for Jira API JSON payload

See merge request gitlab-org/gitlab-ce!31139
2019-07-25 11:18:00 +00:00
Stan Hu a40116065e Support Docker OCI images
Docker Distribution v2.7.0 shipped with OCI support, but our container
registry client was not updated to handle the manifest format in the
HTTP `Accept` header.  As a result, API calls to retrieve a manifest
would return with an error, "OCI manifest found, but accept header does
not support OCI manifests". This would result in blank fields in the
container registry page and prevent tags from being deleted.

To fix this, we just need to add
`application/vnd.oci.image.manifest.v1+json` to the `Accept` header and
configure Faraday to parse the response as JSON. The response structure
is the same as the standard Docker Distribution V2 manifest.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58685

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/12877
2019-07-25 04:11:38 -07:00
Andreas Brandl cb41470cdd Merge branch 'tc-revert-rails5-workaround' into 'master'
Revert "Workaround for Rails 5, where LIMIT..."

See merge request gitlab-org/gitlab-ce!30780
2019-07-25 11:03:43 +00:00
Shinya Maeda ad7acfaad0 Logging sidekiq worker class name in SidekiqMemoryKiller
Currently, SidekiqMemoryKiller does not feed worker class name in the
json structured logging. This commit extends the json parameter.
2019-07-25 17:49:10 +07:00
Heinrich Lee Yu d19717cba6 Backport Jira issue key regex 2019-07-25 17:29:51 +08:00
Heinrich Lee Yu 1ce5bcacdb Remove code related to object hierarchy in MySQL
These are not required because MySQL is not
supported anymore
2019-07-25 15:35:06 +08:00
Heinrich Lee Yu 2b3d00a778 Remove unneeded monkey-patch
Changes all calls to data_source_exists? to table_exists?
since that is the intent of these calls
2019-07-25 12:21:38 +08:00
Thong Kuah b297cdcbdf Extract deploy functions in a base image
https://gitlab.com/gitlab-org/cluster-integration/auto-deploy-image
2019-07-25 14:27:14 +12:00
Stan Hu 07a308ad1b Enable Rubocop Performance/ReverseEach
`Array.reverse_each` is faster than `Array.reverse.each` because:

* reverse.each creates a new array then loops each element
* reverse_each loops in reverse order (no intermediate array created)
2019-07-24 14:08:25 -07:00
Mayra Cabrera 3cefc5d7df Add RateLimiter to RawController
* Limits raw requests to 300 per minute and per raw path.
* Add a new attribute to ApplicationSettings so user can change this
value on their instance.
* Uses Gitlab::ActionRateLimiter to limit the raw requests.
* Add a new method into ActionRateLimiter to log the event into auth.log

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/48717
2019-07-24 19:49:31 +00:00
Douwe Maan 50ab880f80 Merge branch 'cleanup/spec-tasks' into 'master'
Resolves confusion within spec rake tasks.

See merge request gitlab-org/gitlab-ce!31073
2019-07-24 18:47:23 +00:00
Stan Hu 0d538e44af Merge branch 'optimise-import-performance' into 'master'
Optimise import performance

Closes #64924

See merge request gitlab-org/gitlab-ce!31045
2019-07-24 18:01:44 +00:00
Reuben Pereira e5bdcfbc9b [ADD] outbound requests whitelist
Signed-off-by: Istvan szalai <istvan.szalai@savoirfairelinux.com>
2019-07-24 17:59:38 +00:00
Douglas Barbosa Alexandre 6a5d2df3ee Merge branch 'sh-peek-cleanup' into 'master'
Use a base class for Peek views

See merge request gitlab-org/gitlab-ce!31108
2019-07-24 17:45:01 +00:00
Andreas Brandl 259493bb4c Enable tablesample count strategy by default
https://gitlab.com/gitlab-org/gitlab-ce/issues/58792
2019-07-24 17:00:34 +00:00
Stan Hu d7eadcc0f3 Use a base class for Peek views
Introduce a `DetailedView` base class, which is inherited by
the Gitaly, Redis, and Rugged views. This reduces code duplication.
2019-07-24 08:57:42 -07:00
Kamil Trzciński 8d1e97fc3b Optimise import performance
- Fix `O(n)` complexity of `append_or_update_attribute`,
  we append objects to an array and re-save project
- Remove the usage of `keys.include?` as it performs `O(n)`
  search, instead use `.has_key?`
- Remove the usage of `.keys.first` as it performs a copy
  of all keys, instead use `.first.first`
2019-07-24 16:24:28 +02:00
Sean McGivern 562db3a36e Merge branch 'sh-add-rugged-to-peek' into 'master'
Add Rugged calls to performance bar

See merge request gitlab-org/gitlab-ce!30983
2019-07-24 12:24:12 +00:00
Luke Duncalfe d18ee3faad LFS export records repository_type data
A project can have the same `LfsObject` linked with up to three
`LfsObjectsProject` records. Each of these records would be for a
different repository, recorded in the `repository_type` property. The
different repositories at time of writing are "project", "wiki", and
"design". See https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894

This change exports the list of `repository_type`s as a JSON mapping of
oid => repository_types, which are imported to recreate the correct
`LfsObjectsProject` records.

https://gitlab.com/gitlab-org/gitlab-ee/issues/11090
2019-07-24 11:23:51 +00:00
Christian Couder 7cf4bf848f Support title and desc on merge w/ push option
MergeRequests::PushOptionsHandlerService has been updated to allow
creating and updating merge requests with the `title` and
`description` set using git push options.

To create a new merge request and set its title and description:

      git push -u origin -o merge_request.create \
        -o merge_request.title="My title" \
        -o merge_request.description="My description"

To update an existing merge request and set its title and
description:

      git push -u origin -o merge_request.title="My title" \
        -o merge_request.description="My description"

Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/64320
2019-07-24 11:04:49 +02:00
Mohammad Alhashash 2bc43c4471 Fix incorrect web server parameter in init.d script
Environment variable USE_WEB_SERVER should have the value of the selected webserver when calling bin/web startup script.

Fixes #65008
2019-07-24 08:48:49 +00:00
Stan Hu 02a2793725 Hide Rugged data if it doesn't exist 2019-07-23 22:12:42 -07:00
Stan Hu 291df05e43 Add Rugged calls to performance bar
This will help diagnose the source of excessive I/O from Rugged
calls. To implement this, we need to obtain the full list of arguments
sent to each request method.
2019-07-23 21:38:05 -07:00
Thong Kuah 8768e295c3 Merge branch '65019-job-templates-dind-tls-fix' into 'master'
Set DOCKER_TLS_CERTDIR in CI job templates

See merge request gitlab-org/gitlab-ce!31080
2019-07-24 02:29:06 +00:00
Jeremy Jackson 271a6d1b8f Resolves confusion within spec rake tasks 2019-07-23 18:34:50 -06:00
Tiger c472bec5c2 Set DOCKER_TLS_CERTDIR in CI job templates
https://gitlab.com/gitlab-org/gitlab-ce/issues/65019
2019-07-24 10:25:46 +10:00
Tiger af88ccfae8 Set DOCKER_TLS_CERTDIR in Auto Dev-Ops CI template
https://gitlab.com/gitlab-org/gitlab-ce/issues/65019
2019-07-24 09:57:49 +10:00
Robert Speicher 43626526aa Merge branch '52442-initial-mysql-support-removal' into 'master'
Remove dead mysql code

Closes #63191

See merge request gitlab-org/gitlab-ce!29608
2019-07-23 21:44:53 +00:00
James Keogh a71da850d9 Rename changelog to correct issue number, be more explicit that we're talking about Auto DevOps projects 2019-07-23 21:32:10 +00:00
Stan Hu 5032df86ce Merge branch 'adjust-group-level-analytics-to-accept-multiple-project-ids' into 'master'
Adjust group level analytics to accept multiple projects ids

See merge request gitlab-org/gitlab-ce!30744
2019-07-23 21:00:39 +00:00
Małgorzata Ksionek 822129b6b7 Change sql query 2019-07-23 22:00:50 +02:00
mo khan 0a93fea3f6 Add PIP_DEPENDENCY_PATH to dependency scanning template 2019-07-23 19:40:39 +00:00
Nick Thomas 4aa76dddec
Remove dead MySQL code
None of this code can be reached any more, so it can all be removed
2019-07-23 16:53:03 +01:00
Kamil Trzciński 4435cdde49 Merge branch 'safe-archiving-for-traces' into 'master'
Extra logging for new live trace architecture

See merge request gitlab-org/gitlab-ce!30892
2019-07-23 14:17:05 +00:00
Kamil Trzciński 995e5b5210 Merge branch 'sh-use-shared-state-cluster-pubsub' into 'master'
Use persistent Redis cluster for Workhorse pub/sub notifications

See merge request gitlab-org/gitlab-ce!30990
2019-07-23 14:15:09 +00:00
Kamil Trzciński 6ee5f089a7 Merge branch '64974-remove-livesum-from-ruby-sampler-metrics' into 'master'
Remove :livesum from RubySampler metrics

See merge request gitlab-org/gitlab-ce!31047
2019-07-23 14:06:03 +00:00
Bob Van Landuyt 825e5c2c1b Merge branch 'if-64257-active_session_lookup_key_cleanup' into 'master'
Rake task to cleanup expired ActiveSession lookup keys

See merge request gitlab-org/gitlab-ce!30668
2019-07-23 12:39:26 +00:00
Aleksei Lipniagov 911c0f61b3 Remove :livesum from RubySampler metrics 2019-07-23 15:26:52 +03:00
Sean McGivern b2e4a7957a Merge branch 'gsemet/gitlab-ce-gsemet-master-patch-33258' into 'master'
Multiple pipeline support for Build status

See merge request gitlab-org/gitlab-ce!30828
2019-07-23 11:57:30 +00:00
Ash McKenzie 69adeb3718 Merge branch 'georgekoltsov/64377-add-better-log-msg-to-members-mapper' into 'master'
Add better error message to MembersMapper#ensure_default_member!

See merge request gitlab-org/gitlab-ce!30838
2019-07-23 11:48:33 +00:00
Shinya Maeda c2e0e689f3 Validate the existence of archived traces before removing live trace
Often live traces are removed even though the archived trace
doesn't exist. This commit checkes the existence strictly.
2019-07-23 17:26:08 +07:00
Matija Čupić 41b8dca877
Add specs for specifying pipeline behavior
Adds specs for testing the new behavior of specifying a pipeline when
POSTing a status.
2019-07-23 12:02:07 +02:00
Małgorzata Ksionek 5ce4236b66 Add code review remarks
Add cr remarks

Improve specs according to the review

Fix schema

Add cr remarks

Fix naming

Add cr remarks
2019-07-23 12:01:39 +02:00
Małgorzata Ksionek 1b102f5d11 Add basic project extraction
To allow project filtering

Prepare summary for accepting multiple groups

Modify deploys group summary class

Add filtering by project name in issues summary

Fix rubocop offences

Add changelog entry

Change name to id in project filtering

Fix rebase problem

Add project extraction
2019-07-23 12:01:39 +02:00
Grzegorz Bizon f4101aeac7 Merge branch 'rm-src-branch' into 'master'
Support remove source branch on merge w/ push options

See merge request gitlab-org/gitlab-ce!30728
2019-07-23 09:41:23 +00:00
Kamil Trzciński 3a4cb6d675 Bring backward compatibility for request profiles
It seems that we missed the backward compatibility support
for profiles in the existing folder.

This commit also fixes some specs to be idempotent
and work in a temporary directory which not always
seems to be the case.

This commit also brings the profile_spec.rb which seems
to be missing.
2019-07-23 09:30:00 +00:00
George Koltsov 3463c24d40 Add changelog entry 2019-07-23 09:23:50 +01:00
Stan Hu 71045b89f6 Convert githost.log to JSON format
This will make it easier to parse this in production and adds the
`correlation_id` if available.
2019-07-22 14:56:03 -05:00
Stan Hu 583c12acf4 Use persistent Redis cluster for Workhorse pub/sub notifications
Previously, in Omnibus, Workhorse expected to listen via the Redis
shared state cluster for the `workhorse:notifications` publish/subscribe
channel, but the Rails code was using the Sidekiq queue cluster for
this. To fix this inconsistency, we make the Rails code use the
persistent cluster, since we don't want Workhorse to be looking at
anything Sidekiq-related.
2019-07-22 10:23:07 -07:00
Sean McGivern e48851de62 Merge branch 'maintainers-can-create-subgroup' into 'master'
Add a group setting to allow Maintainers to create sub-groups

See merge request gitlab-org/gitlab-ce!29718
2019-07-22 15:17:23 +00:00
Imre Farkas 313f145b55
Rake task to cleanup expired ActiveSession lookup keys
In some cases ActiveSession.cleanup was not called after authentication,
so for some user ActiveSession lookup keys grew without ever cleaning
up. This Rake task manually iterates over the lookup keys and removes
ones without existing ActiveSession.
2019-07-22 17:15:57 +02:00
Steve Abrams aba93fe2d5 OAuth2 support for GitLab personal access tokens
PATs are accepted using the OAuth2 compliant header
"Authorization: Bearer {token}" in order to allow for
OAuth requests while 2FA is enabled.
2019-07-22 08:50:25 +00:00
Alex Kalderimis 7320758611 Count wiki page creation
This adds a counter to count page creation, which is reflected in the
usage-data we collect.

The number created is stored in Redis, avoiding DB access.
2019-07-21 01:26:19 +00:00
Fabio Papa 9dc5c2ef73 Add "allowed to create subgroups" dropdown to group settings form 2019-07-19 11:55:46 -07:00
Fabio Papa 99e6c08436 Add constants representing Owner and Maintainer group access levels 2019-07-19 11:55:46 -07:00
Mayra Cabrera eb3f465e75 Merge branch 'sh-fix-gitaly-server-info-cache' into 'master'
Fix Gitaly auto-detection caching

Closes #64802

See merge request gitlab-org/gitlab-ce!30954
2019-07-19 18:23:27 +00:00
Toon Claes 34a5f77e77 Document database review process
See https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6069
2019-07-19 17:33:48 +00:00
Kamil Trzciński 3253604442 Merge branch '30939-remove-worker-label-from-ruby-sampler-metrics' into 'master'
Get rid of `worker_label` in RubySampler

See merge request gitlab-org/gitlab-ce!30942
2019-07-19 17:16:54 +00:00
Francisco Javier López 351bc078ca Avoid increasing redis counters when usage_ping is disabled 2019-07-19 17:04:33 +00:00
Stan Hu ec5ceae623 Fix Gitaly auto-detection caching
If `GitalyClient#can_use_disk?` returned `false`, it was never cached
properly and led to excessive number of Gitaly calls. Instead of using
`cached_value.present?`, we need to check `cached_value.nil?`.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64802
2019-07-19 10:03:41 -07:00
Phil Hughes b83a4f8327 Merge branch '64722-mg-export-frontend-fixtures' into 'master'
Resolve "Export frontend fixtures as pipeline artifact"

Closes #64722 and #59166

See merge request gitlab-org/gitlab-ce!30917
2019-07-19 14:23:41 +00:00
Aleksei Lipniagov 4029d8b41c Get rid of `worker_label` in RubySampler
We have Prometheus::PidProvider which sets correct worker id for a
process, so such implementation of `worker_label` in the sampler is
obsolete.
2019-07-19 16:55:32 +03:00
Ben Kochie 442f599177 Adjust redis cache metrics
* Remove `controller` and `action` labels from duration histogram.
* Create a new simple counter for `controller` and `action`.
* Adjust histogram buckets to observe smaller response times.
2019-07-19 13:34:04 +00:00
Francisco Javier López 01685eed76 Added Usage Data for some Web IDE actions
The actions tracked in the web IDE are:
- creation of commits
- creation of merge requests
- projects loaded
2019-07-19 11:11:27 +00:00
Lin Jen-Shin f3ce7a37a4 Merge branch '64295-predictable-environment-slugs' into 'master'
Use predictable environment slugs

See merge request gitlab-org/gitlab-ce!30551
2019-07-19 08:37:57 +00:00
Mike Greiling 97b8f85e03
Move frontend fixtures into spec/frontend
Moves every fixture source file from
spec/javascripts to spec/frontend
2019-07-19 02:27:15 -05:00
Mike Greiling faa17d5263
Rename the karma:fixtures task
Introduces frontend:fixtures rake task to replace
karma:fixtures and update documentation and CI scripts
to match
2019-07-19 02:27:14 -05:00
George Koltsov 9ef196b7a7 Set Private visibility for restricted Internal imported projects
With https://gitlab.com/gitlab-org/gitlab-ee/issues/12388 change going
live there is potential risk of breaking imports of 'Internal' projects.
This change makes sure if 'Internal' visibility level is restricted
all 'Internal' projects will be marked as 'Private'

See: https://gitlab.com/gitlab-org/gitlab-ce/issues/64311
2019-07-19 03:00:23 +00:00
Tiger 41fc4d1e44 Introduce predictable environment slugs
If an environment slug is predictable given only the environment
name, we can use the environment slug earlier in the CI variable
evaluation process as we don't have to wait for the environment
record itself to be persisted.
2019-07-19 11:33:07 +10:00
Lin Jen-Shin 5db5e50927 Merge branch 'an-sidekiq-chaos' into 'master'
Adds chaos endpoints to Sidekiq

Closes #64663

See merge request gitlab-org/gitlab-ce!30814
2019-07-18 20:43:49 +00:00
Andrew Newdigate dc14c91d06 Adds chaos endpoints to Sidekiq
This allows the chaos endpoints to be invoked in Sidekiq so that this
environment can be tested for resilience.
2019-07-18 19:04:12 +02:00
Alex Kalderimis eda789c3c2 Improves add_timestamps_with_timezone helper
This improves the `add_timestamps_with_timezone` helper by allowing the
column names to be configured. This has the advantage that unnecessary
columns can be avoided, saving space.

A helper for removing the columns is also provided, to be used in the
`down` method of migrations.
2019-07-18 15:47:01 +00:00
Douglas Barbosa Alexandre 090ca4f7e3 Merge branch 'sh-add-rugged-logs' into 'master'
Add Rugged calls and duration to API and Rails logs

Closes #64676

See merge request gitlab-org/gitlab-ce!30871
2019-07-18 15:43:37 +00:00
Kamil Trzciński 2044473dad Merge branch 'add-profile-mode-to-extend-request-profiling' into 'master'
Add profile mode to extend request profiling

See merge request gitlab-org/gitlab-ce!30126
2019-07-18 15:22:38 +00:00
Aleksei Lipniagov 22e2917b18 Fix pid providing for Prometheus
Use relative worker identifier for metrics (instead of Process.pid) and
identify when Unicorn/Puma/Sidekiq is used.
Previously, it was assumed that all metrics are gathered from Unicorn
due to hardcoded implementation which was incorrect.
2019-07-18 13:54:11 +00:00
Stan Hu 1136c0c8e9 Add Rugged calls and duration to API and Rails logs
This adds `rugged_duration_ms` and `rugged_calls` fields to
`api_json.log` and `production_json.log`. This will make it easier to
identify performance issues caused by excessive I/O.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64676
2019-07-18 06:53:39 -07:00
Mayra Cabrera 91903d3a9e Merge branch 'sh-fix-redis-performance-bar' into 'master'
Fix inconsistency in Redis performance bar stats

Closes #64707

See merge request gitlab-org/gitlab-ce!30866
2019-07-18 13:45:00 +00:00
Qingyu Zhao 10e51ac5f7 Add profile mode to extend request profiling
Extend the support for "X-Profile-Token: <token>" to have an additional
header that defines type of profile we are looking for, like:
  X-Profile-Mode: execution
  X-Profile-Mode: memory
2019-07-18 23:11:08 +10:00
Douglas Barbosa Alexandre 0854f18352 Merge branch 'ci_default_git_depth_only' into 'master'
API: Allow changing only ci_default_git_depth

See merge request gitlab-org/gitlab-ce!30888
2019-07-18 12:31:12 +00:00
Nick Thomas 3069cb2545 Merge branch 'webide-commit-use-correct-parent' into 'master'
Use correct parent when committing in WebIDE

See merge request gitlab-org/gitlab-ce!29598
2019-07-18 10:47:35 +00:00
Thong Kuah 69c113fc8c Merge branch 'feature/gb/serverless-app-deployment-template' into 'master'
Deploy serverless apps with `gitlabktl`

Closes #64494

See merge request gitlab-org/gitlab-ce!30740
2019-07-18 10:27:54 +00:00
Sean McGivern 0d1adc9f7f Merge branch 'adjust-cycle-analytics-to-group-level' into 'master'
Adjust cycle analytics to group level

See merge request gitlab-org/gitlab-ce!30391
2019-07-18 09:23:54 +00:00
Mathieu Parent 0f585d0de8 API: Allow changing only ci_default_git_depth 2019-07-18 10:18:23 +02:00
Markus Koller f8cecafb07
Add start_sha to commits API
When passing start_branch on committing from the WebIDE, it's possible
that the branch has changed since editing started, which results in the
change being applied on top of the latest commit in the branch and
overwriting the new changes.

By passing the start_sha instead we can make sure that the change is
applied on top of the commit which the user started editing from.
2019-07-18 09:19:18 +02:00
Ash McKenzie d00d60a66d
Allow UsageData.count to use count_by: 2019-07-18 12:13:19 +10:00
Francisco Javier López bcd2458076 Refactor RedisCounter and WebIdeCommitsCounter
This MR refactor RedisCounter and WebIdeCommitsCounter
to be reused by other components.
2019-07-17 23:45:35 +00:00
Stan Hu ddf2dcf7fd Merge branch 'jc-wrap-rugged-calls-with-disk-access' into 'master'
Wrap rugged calls with access disk block

See merge request gitlab-org/gitlab-ce!30592
2019-07-17 22:23:20 +00:00
Stan Hu 9dd59df699 Fix inconsistency in Redis performance bar stats
peek-redis resets its counters at the start of an ActionController
notification (`start_processing.action_controller`), which causes it to
miss some Redis queries that precede it, such as the database load
balancer and Rack Attack queries. This produces inconsistencies in the
performance bar between the number of calls and their durations with the
actual calls in the detailed view.

We fix this by getting rid of peek-redis in favor of consolidating all
logic into the `RedisDetailed` view, which tracks Redis queries using
`RequestStore`. This has the nice property of removing thread-specific
counters as well.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/64707
2019-07-17 15:11:01 -07:00
Nick Thomas 2860cfaaff Merge branch 'issue-64645-asciidoctor-footnote-links' into 'master'
Preserve footnote link ids

Closes #64645

See merge request gitlab-org/gitlab-ce!30790
2019-07-17 15:19:07 +00:00
Igor 0f46886880 Added submodule links to Submodule type in GraphQL API
This is part of migration of Folder View to Vue
2019-07-17 13:06:19 +00:00
Vladimir Shushlin 6796dcf277 Fix wrong pages access level default
- Set access level in before_validation hook
- Add post migration for updating existing project_features
2019-07-17 12:56:58 +00:00
Gaetan Semet 4e814c257b
Multiple pipeline support for Build status
This allows user to specify the pipeline ID
when several pipelines has been triggered
on the same branch and commit.

Signed-off-by: Gaetan Semet <gaetan.semet@renault.com>
2019-07-17 14:43:15 +02:00
Christian Couder 8256d4075d Support rm src branch on merge w/ push option
MergeRequests::PushOptionsHandlerService has been updated to allow
creating and updating merge requests with the
`remove_source_branch` set using git push options.

To create a new merge request and set it to remove the source branch
when it is merged:

  git push -u origin -o merge_request.create \
    -o merge_request.remove_source_branch

To update an existing merge request and set it to remove the source
branch when it is merged:

  git push -u origin -o merge_request.remove_source_branch

Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/64320
2019-07-17 13:32:41 +02:00
George Koltsov 8e6af8c59f Add better error message MembersMapper#ensure_default_member!
More details in: https://gitlab.com/gitlab-org/gitlab-ce/issues/64377
2019-07-17 11:30:31 +01:00
Imre Farkas 7aa1d17475 CE port of "Move external authorization service API management to EE"
EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14598
2019-07-17 07:20:17 +00:00
Rajendra kadam f8afb3805c Fetch latest link in the description for zoom link, add more tests and remove frontend spec unnecessary tests 2019-07-17 06:41:26 +00:00