Commit Graph

6333 Commits

Author SHA1 Message Date
Andrew Newdigate 790f64561a Allow measurement for Sidekiq jobs taking > 2.5s
Fix for https://gitlab.com/gitlab-org/gitlab-ce/issues/66319.
2019-08-20 13:52:25 +00:00
Alex Kalderimis 2cbcab4679 Add support for sentry_extra_data in exceptions
This allows exceptions to advertise their support for sentry
and provide structured data.
2019-08-19 23:06:21 +00:00
Robert Speicher 9295cc6f2a Merge branch '64251-branch-name-set-cache' into 'master'
Cache branch and tag names as Redis sets

See merge request gitlab-org/gitlab-ce!30476
2019-08-19 20:26:02 +00:00
Nick Thomas 3028cd687a Merge branch '39-count-unique-users-for-more-accurate-smau-reporting' into 'master'
Allow UsageData.count to use count_by:

See merge request gitlab-org/gitlab-ce!30770
2019-08-19 14:45:24 +00:00
Michael Kozono 9eabc0d6fc Merge branch 'legacy-attachments-migrate-fix' into 'master'
Migrate legacy uploads rake tasks

See merge request gitlab-org/gitlab-ce!29409
2019-08-16 22:07:56 +00:00
Stan Hu f14647fdae Expire project caches once per push instead of once per ref
Previously `ProjectCacheWorker` would be scheduled once per ref, which
would generate unnecessary I/O and load on Sidekiq, especially if many
tags or branches were pushed at once. `ProjectCacheWorker` would expire
three items:

1. Repository size: This only needs to be updated once per push.
2. Commit count: This only needs to be updated if the default branch
   is updated.
3. Project method caches: This only needs to be updated if the default
   branch changes, but only if certain files change (e.g. README,
   CHANGELOG, etc.).

Because the third item requires looking at the actual changes in the
commit deltas, we schedule one `ProjectCacheWorker` to handle the first
two cases, and schedule a separate `ProjectCacheWorker` for the third
case if it is needed. As a result, this brings down the number of
`ProjectCacheWorker` jobs from N to 2.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52046
2019-08-16 19:53:56 +00:00
rossfuhrman 3fbc51d333 Remove Security Dashboard feature flag
This removes the group_overview_security_dashboard feature flag
2019-08-16 17:40:33 +00:00
Kamil Trzciński 535c2d3c71 Merge branch 'mc/feature/pipeline-tracking-config-ce' into 'master'
Add `needs:` CI config option CE

Closes gitlab-ee#12334

See merge request gitlab-org/gitlab-ce!31346
2019-08-16 14:47:05 +00:00
Nick Thomas 0eff75fa2b
Cache branch and tag names as Redis sets
This allows us to check inclusion for the *_exists? methods without
downloading the full list of branch names, which is over 100KiB in size
for gitlab-ce at the moment.
2019-08-16 15:41:29 +01:00
Jarka Košanová 19db315734 Add rake tasks for migrating leacy uploads
- move uploads created by AttachmentUploader
- handle also files created for legacy_diff_notes
2019-08-16 07:52:30 +02:00
Sarah Yasonik caa361b703 Support query parameters in metrics embeds
https://gitlab.com/gitlab-org/gitlab-ce/issues/62971

Adds support for embedding specific charts from the
metrics dashboard. Expected parameters are dashboard,
title, group, and y_label.
2019-08-15 21:38:29 +00:00
Hordur Freyr Yngvason d3c5ff7b72 Squash project templates on update
As per https://gitlab.com/gitlab-org/gitlab-ce/issues/46043, project
templates should be squashed before updating, so that repositories
created from these templates don't include the full history of the
backing repository.
2019-08-15 20:20:08 +00:00
Adam Hegyi ca6cfde588 Migrations for Cycle Analytics backend
This change lays the foundation for customizable cycle analytics stages.
The main reason for the change is to extract the event definitions to
separate objects (start_event, end_event) so that it could be easily
customized later on.
2019-08-15 19:19:37 +00:00
Mayra Cabrera 157b047e9d Removes db/fixtures from database files
This will avoid Danger to suggest a database review for files inside
db/fixtures
2019-08-15 17:42:13 +00:00
Kamil Trzciński 2c71a94744 Merge branch '65278-livesum-puma-phase' into 'master'
Remove :puma_phase metrics

See merge request gitlab-org/gitlab-ce!31773
2019-08-15 11:41:06 +00:00
João Cunha f8821f828e Make use of Gitlab::Kubernetes
- refactor Knative and Prometheus
2019-08-14 20:02:37 +00:00
Jeremy Jackson 5d9d5e6031 Migrates Snowplow backend from EE to CE
This introduces several changes, but these are all just ported from the
EE project.
2019-08-14 19:21:58 +00:00
Adam Hegyi c5cb5da4ac Track page views for cycle analytics show page
This change adds a new counter 'cycle_analytics_views' to the usage data
metrics to count the page views for cycle analytics show page.
2019-08-14 16:12:12 +00:00
Grzegorz Bizon 8fc2fbb6f2 Merge branch 'limit-amount-of-needs' into 'master'
Add `ci_dag_limit_needs`

See merge request gitlab-org/gitlab-ce!31803
2019-08-14 15:05:51 +00:00
Aleksei Lipniagov 6fc7033725 Remove :puma_phase metrics
We don't use phase restarts, as we use `preload_app`:
https://github.com/puma/puma/blob/master/README.md#clustered-mode
`:puma_phase` values will always be zero.
2019-08-14 17:46:40 +03:00
Nick Thomas 3cd40c4a80 Merge branch 'sh-optimize-commit-deltas-post-receive' into 'master'
Reduce Gitaly calls in PostReceive

Closes #65878

See merge request gitlab-org/gitlab-ce!31741
2019-08-14 14:38:28 +00:00
Kamil Trzciński fcc20fde83 Add `ci_dag_limit_needs` feature flag
This makes to limit `needs:` to 5 by default.
Allow to increase the limit to 50 with disable of FF.
2019-08-14 15:48:16 +02:00
Grzegorz Bizon d1e80af603 Merge branch 'require-needs-to-be-present' into 'master'
Require `needs:` to be present

Closes #65839

See merge request gitlab-org/gitlab-ce!31761
2019-08-14 08:37:16 +00:00
Igor 04598039a5 Add usage pings for source code pushes
Source Code Usage Ping for Create SMAU
2019-08-13 22:33:16 +00:00
Douglas Barbosa Alexandre 383a18403f Merge branch 'bump_helm_kubectl_gitlab' into 'master'
Bump Helm to 2.14.3 and kubectl to 1.11.10

See merge request gitlab-org/gitlab-ce!31716
2019-08-13 21:57:14 +00:00
Stan Hu e658f9603c Only expire tag cache once per push
Previously each tag in a push would invoke the Gitaly `FindAllTags` RPC
since the tag cache would be invalidated with every tag.

We can eliminate those extraneous calls by expiring the tag cache once
in `PostReceive` and taking advantage of the cached tags.

Relates to https://gitlab.com/gitlab-org/gitlab-ce/issues/65795
2019-08-13 09:04:30 -07:00
Bob Van Landuyt 3702ab7317 Merge branch '65803-invalidate-branches-cache-on-refresh' into 'master'
Only expire branch cache once per push

See merge request gitlab-org/gitlab-ce!31653
2019-08-13 15:41:25 +00:00
Kamil Trzciński 93e9518215 Require `needs:` to be present
This changes the `needs:` logic to require
that all jobs to be present. Instead of skipping
do fail the pipeline creation if `needs:` dependency
is not found.
2019-08-13 15:07:21 +02:00
Kamil Trzciński 583544d089 Require `stage:` to be set with `needs:`
Since we are unsure what would be the behavior of `stage:`
when we work on DAG. Let's make `stage:` to be required
today with `needs:`.
2019-08-13 11:47:30 +02:00
Stan Hu 4e2bb4e5e7 Reduce Gitaly calls in PostReceive
This commit reduces I/O load and memory utilization during PostReceive
for the common case when no project hooks or services are set up.

We saw a Gitaly N+1 issue in `CommitDelta` when many tags or branches
are pushed. We can reduce this overhead in the common case because we
observe that most new projects do not have any Web hooks or services,
especially when they are first created. Previously, `BaseHooksService`
unconditionally iterated through the last 20 commits of each ref to
build the `push_data` structure. The `push_data` structured was used in
numerous places:

1. Building the push payload in `EventCreateService`
2. Creating a CI pipeline
3. Executing project Web or system hooks
4. Executing project services
5. As the return value of `BaseHooksService#execute`
6. `BranchHooksService#invalidated_file_types`

We only need to generate the full `push_data` for items 3, 4, and 6.

Item 1: `EventCreateService` only needs the last commit and doesn't
actually need the commit deltas.

Item 2: In addition, `Ci::CreatePipelineService` only needed a subset of
the parameters.

Item 5: The return value of `BaseHooksService#execute` also wasn't being
used anywhere.

Item 6: This is only used when pushing to the default branch, so if
many tags are pushed we can save significant I/O here.

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

Fic
2019-08-12 22:28:49 -07:00
Michael Kozono 4254f5dc0e Merge branch 'ce-12547-load-search-counts-async' into 'master'
Load search result counts asynchronously (CE)

See merge request gitlab-org/gitlab-ce!31663
2019-08-12 22:02:28 +00:00
Michael Kozono 4ce6d2b9db Merge branch 'sh-fix-import-export-suggestions' into 'master'
Properly save suggestions in project exports

Closes #65880

See merge request gitlab-org/gitlab-ce!31690
2019-08-12 22:00:49 +00:00
Markus Koller 49c83155cc
Load search result counts asynchronously
Querying all counts for the different search results in the same request
led to timeouts, so we now only calculate the count for the *current*
search results, and request the others in separate asynchronous calls.
2019-08-12 22:01:15 +02:00
Annabel Dunstone Gray 22f3142b83 Merge branch '65790-highlight' into 'master'
Adds highlight to collapsible line in job log

Closes #65790

See merge request gitlab-org/gitlab-ce!31665
2019-08-12 19:01:24 +00:00
Filipa Lacerda 3e2f2b8071 Adds highlight to collapsible line
In the job log adds a highlight when hovering
the collapsible line
2019-08-12 17:24:42 +01:00
Stan Hu 5971cd1508 Merge branch '65278-fix-puma-master-counter-wipe' into 'master'
Fix active metric files being wiped after the app starts

See merge request gitlab-org/gitlab-ce!31668
2019-08-12 16:20:31 +00:00
Jacob Vosmaer f3e0ec7b4a Update Gitaly server and gem to 1.58.0 2019-08-12 15:50:30 +00:00
Grzegorz Bizon 37496d5916 Merge branch 'georgekoltsov/63408-user-mapping' into 'master'
Add author lines to project import comments

See merge request gitlab-org/gitlab-ce!31579
2019-08-12 15:27:14 +00: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
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
Stan Hu afe867921c Rename branches_exist? -> includes_branches? 2019-08-09 15:41:07 -07: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
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
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
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