Commit Graph

6601 Commits

Author SHA1 Message Date
Robert Speicher 18b4c66dc6 Merge branch 'group_level_jupyterhub' into 'master'
Group level JupyterHub

See merge request gitlab-org/gitlab-ce!32512
2019-09-05 20:25:58 +00:00
Cédric Tabin e195e48638 New interruptible attribute supported in YAML parsing.
Since it is not possible to dynamically detect if a job is automatically
cancellable or not, a this new attribute is necessary. Moreover, it let
the maintainer of the repo to adjust the behaviour of the auto cancellation
feature to match exactly what he needs.
2019-09-05 14:50:39 +00:00
Ash McKenzie 124bad7bd8
Use stub_rails_env for Rails.env stubbing
RailsHelpers.stub_rails_env takes care of
stubbing Rails.env
2019-09-05 12:54:03 +10:00
James Fargher bc04a1dcf4 Allow group install of JupyterHub
Removes limitations on cluster types that can install JupyterHub
2019-09-05 09:46:51 +12:00
Pavel Shutsin f089a23015 Backport EE changes for productivity analytics
Improve diff lines count efficiency
2019-09-04 13:01:55 +03:00
Grzegorz Bizon 1068ec2e92 Merge branch '66741-remove-spec-rails_helper-rb' into 'master'
Remove spec/rails_helper.rb

Closes #66741

See merge request gitlab-org/gitlab-ce!32380
2019-09-03 13:48:17 +00:00
Andreas Brandl 53801b1206
Preload routes information
This fixes a high frequency N+1 issue:

`RoutableActions#find_routable!` is used across many controllers to
retrieve e.g. the Project or Namespace by path. The `#find_routable!`
method calls `#ensure_canonical_path` which in turn retrieves
`#full_path` from the given Routable.

This in turn triggers a lookup on `routes`, leading to a high frequency
of these queries:

```sql
SELECT  "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND
"routes"."source_type" = $2 LIMIT $3
```

This is unnecessary as we already join `routes` in
`Routable#find_by_full_path` anyways.
2019-09-03 12:16:03 +02:00
Etienne Baqué a43ab8d6a4 Added relationships between Release and Milestone
Modified schema via migrations.
Added one-to-one relationship between the two models.
Added changelog file
2019-09-03 09:38:59 +00:00
Kamil Trzciński 6b7fe67ada Merge branch 'add-pipeline-type-key-in-pipeline-entity' into 'master'
Expose `name` and `merge_request_event_type` in serialized json and predefined variables

See merge request gitlab-org/gitlab-ce!32323
2019-09-03 09:18:46 +00:00
Rémy Coutable af5f2424ca Merge branch 'change-role-system-hook' into 'master'
Add system hooks for project/group membership updates

Closes gitlab-ee#12252

See merge request gitlab-org/gitlab-ce!32371
2019-09-03 07:08:40 +00:00
Shinya Maeda 8c21610c79 Add pipeline.type key to PipelineEntity
This commit adds pipeline.type key to PipelineEntity.
This key will be used in MR widget in the next iteration.
2019-09-03 13:30:53 +07:00
Brandon Williams 2bd4d580d1
Add system hooks for project/group membership updates
When updating group and project members, new system hooks
`user_update_for_group` and `user_update_for_team` will be executed.

Fixes https://gitlab.com/gitlab-org/gitlab-ee/issues/12252
2019-09-02 18:35:36 -05:00
Massimeddu Cireddu aef0d81792 Fixing #65389
Wrong format on MS Teams integration push events with multi line commit messages
2019-09-02 10:43:54 +00:00
Michael Kozono 88c6423e4a Merge branch 'remove-ignorable-column-concern' into 'master'
Remove dependency on IgnorableColumn concern

Closes #66746

See merge request gitlab-org/gitlab-ce!32427
2019-08-30 21:59:31 +00:00
Manoj MJ b943baa42a Limit access request email to 10 most recently active owners/maintainers
This change limits the number of emails
for new access requests notifications to
10 most recently active owners/maintainers
2019-08-30 21:30:51 +00:00
James Fargher 5142bd738e Install cert-manager v0.9.1
This does not support upgrading from earlier versions
2019-08-30 11:47:13 +00:00
Andreas Brandl 739d6a5ad3
Perform two-step Routable lookup by path
In order to lookup a Project or Namespace by path, we prefer an exact
match (case-sensitive) but in absence of that, we'd also take a
case-insensitive match.

The case-insensitive matching with preference for the exact match is a
bit more involved in SQL as the exact lookup. Yet, the majority of cases
will be an exact match. The thinking here is that we can optimize the
lookup by performing an exact match first and only if there is no
result, we perform the case-insensitive lookup.

Data for GitLab.com:
* We have about 15M records in routes table
* About 2,500 routes exist where there's more than one record
  with the same `lower(path)`

It is possible for a user to craft requests that would always trigger
the 2-step search (e.g. we have a route for `/foo/bar`, the request is
always for `/FOO/bar`). In this case, the change at hand is not
beneficial as it would run an additional query.

However, based on the data, it is highly likely that the vast majority
of requests can be satisfied with an exact match only.

The context for this change is
https://gitlab.com/gitlab-org/gitlab-ce/issues/64590#note_208156463.
2019-08-30 07:58:33 +02:00
Ash McKenzie 19ff9d9899
Replace rails_helper.rb with spec_helper.rb
rails_helper.rb's only logic was to require
spec_helper.rb.
2019-08-30 12:26:18 +10:00
Robert Speicher 7698d40550
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq 2019-08-29 17:17:37 -05:00
GitLab Release Tools Bot 090956259c Merge branch 'security-enable-image-proxy' into 'master'
Use image proxy to mitigate stealing ip addresses

Closes #2812

See merge request gitlab/gitlabhq!2926
2019-08-29 21:34:29 +00:00
GitLab Release Tools Bot 5a008d1368 Merge branch 'security-epic-notes-api-reveals-historical-info-ce-master' into 'master'
Filter out old system notes for epics in notes api endpoint response

See merge request gitlab/gitlabhq!3224
2019-08-29 21:34:24 +00:00
GitLab Release Tools Bot 170cb8bc18 Merge branch 'security-fix-html-injection-for-label-description-ce-master' into 'master'
Fix HTML injection for label description

See merge request gitlab/gitlabhq!3250
2019-08-29 21:34:20 +00:00
GitLab Release Tools Bot b01c7ad291 Merge branch 'security-61974-limit-issue-comment-size' into 'master'
Limit the size of issuable description and comments

See merge request gitlab/gitlabhq!3267
2019-08-29 21:34:15 +00:00
GitLab Release Tools Bot 4e8e402bc5 Merge branch 'security-sarcila-fix-weak-session-management' into 'master'
Clear reset_password_tokens when login (email or username) change

See merge request gitlab/gitlabhq!3334
2019-08-29 21:33:52 +00:00
GitLab Release Tools Bot 15b88fe57f Merge branch 'security-ssrf-kubernetes-dns-12-3' into 'master'
DNS Rebind SSRF in Kubernetes Integration

See merge request gitlab/gitlabhq!3345
2019-08-29 21:33:42 +00:00
dineshpanda fa6f19d1f8 Remove dependency on IgnorableColumn concern 2019-08-30 02:09:13 +05:30
Nick Thomas c6ccc07f48
Revert "Cache branch and tag names as Redis sets"
This reverts commit 0eff75fa2b.
2019-08-29 18:04:52 +01:00
Lee Tickett 72390953da Handle invalid mirror url 2019-08-29 16:19:07 +00:00
Felipe Artur 8f6a433c41 Save board lists collapsed setting
Persists if a board list is collapsed for each user.
2019-08-28 20:18:40 +00:00
Adam Hegyi 55d28efa1f Adding NOT NULL constraint to private_profile
This change sets NOT NULL constraint to users.private profile.

closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57538
2019-08-28 13:38:50 +00:00
Heinrich Lee Yu 4fea485ec4 Use `stub_full_request` to fix spec failure
Also change test URL sequest to .test TLD
2019-08-28 15:04:40 +02:00
Ash McKenzie 4576d55f44 Merge branch 'id-change-total-notes-calculation' into 'master'
Change the way totalNotes is calculated

See merge request gitlab-org/gitlab-ce!32191
2019-08-28 08:27:21 +00:00
Grzegorz Bizon fe641cbd6a Merge branch 'sh-fix-issue-move-api' into 'master'
Fix moving issues API failing when text includes commit URLs

Closes #66666

See merge request gitlab-org/gitlab-ce!32317
2019-08-28 08:25:36 +00:00
Stan Hu 29ce13e999 Fix moving issues API failing when text includes commit URLs
When a issue is moved from one project to another, all associated
Markdown text is rewritten in the context of the new project. If the
note contained a link to a commit URL, `CommitRewriter#rewrite` would
fail because `Commit#link_reference_pattern` would match `nil` `commit`
values in the HTML generated from the Markdown. These `nil` values were
passed along to `Project#commits_by` because `Commit#reference_valid?`
was always returning `true`.

To prevent this issue from happening, we tighten up the check for
`Commit#reference_valid?` to look for valid SHA values.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66666
2019-08-28 00:18:33 -07:00
Stan Hu 6262a91e36 Merge branch 'todos/include-issue-mr-titles' into 'master'
Add Issue and Merge Request titles to Todo items

Closes #63488

See merge request gitlab-org/gitlab-ce!30435
2019-08-28 05:40:19 +00:00
Igor Drozdov 72544449cf Change the way totalNotes is calculated
totalNotes is only used to prerender a number of
skeleton containers until real notes are loaded

issuable.discussions makes multiple requests, so
too expensive for this

This commit uses mere notes for this and sends
actual totalNotes number if it's less than 10;
otherwise it sends 10 - it allows us to avoid
bunch of skeleton prerenderings, which are not
necessary since they doesn't fit into the whole
screen and disappear quite fast
2019-08-28 08:30:13 +03:00
Arun Kumar Mohan 4ca32c2b55 Add Issue and Merge Request titles to Todo items
Only displays the todo body if the todo has a note.
This is to avoid redundant Issue or Merge Request titles
displayed both in the Todo title and body.
2019-08-27 20:09:24 -05:00
Heinrich Lee Yu 1ee8d6385d Use `stub_full_request` to fix spec failure
Also change test URL sequest to .test TLD
2019-08-27 19:25:22 +08:00
Aishwarya Subramanian a06410d995 Using before_save method instead of setter
Removed unused method for name setter method
2019-08-26 18:20:18 +00:00
Zeger-Jan van de Weg a844a958ea
Remove the object pools feature flag
The flag defaulted to true, so there's no change unless users turned it
off. Given there's a lack of issues regarding object pools, this should
be OK.
2019-08-26 12:35:52 +02:00
Brett Walker ad05e48863 Add support for using a Camo proxy server
User images and videos will get proxied through
the Camo server in order to keep malicious
sites from collecting the IP address of users.
2019-08-23 23:44:53 -05:00
Tim Zallmann 459309fa57 Merge branch '66037-deployment-user' into 'master'
Return correct user for manual deployments

See merge request gitlab-org/gitlab-ce!32004
2019-08-23 20:50:01 +00:00
Adam Hegyi 60e3388526 Implement validation logic to ProjectStage
- Introducting StageEvents to define the available events
- Define the event pairing rules, since some events are not compatible
- Express default Cycle Analytics stages with the event structure
2019-08-23 20:28:11 +00:00
Grzegorz Bizon f7f3b3c3ef Merge branch 'optimise-build-queue-service' into 'master'
Optimise UpdateBuildQueueService

Closes #66438

See merge request gitlab-org/gitlab-ce!32095
2019-08-23 09:31:40 +00:00
Alessio Caiazza 606a1d2d31 Expose namespace storage statistics with GraphQL
Root namespaces have storage statistics.
This commit allows namespace owners to get those stats via GraphQL
queries like the following one

{
  namespace(fullPath: "a_namespace_path") {
    rootStorageStatistics {
      storageSize
      repositorySize
      lfsObjectsSize
      buildArtifactsSize
      packagesSize
      wikiSize
    }
  }
}
2019-08-22 22:08:28 +00:00
Kamil Trzciński 4e4f8534fd Merge branch 'avoid-race-condition-of-archive-trace-cron-worker' into 'master'
Avoid conflicts between ArchiveTracesCronWorker and ArchiveTraceWorker

See merge request gitlab-org/gitlab-ce!31376
2019-08-22 14:21:05 +00:00
Krasimir Angelov d86b77bf20 Extract logic who created deployment into Deployment#deployed_by
Prefer the deployable user over the deployment user.

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/66037.
2019-08-22 15:36:55 +03:00
Kamil Trzciński a5f6182753 Optimise build queue service
This makes BuildQueueService to force refresh runners
that are considered to have recent queue.

Such runners are the ones that connected within online
interval + time to expire runner cache.
2019-08-22 13:51:53 +02:00
Alexandru Croitor 5af535d919 Limit the size of issuable description and comments
Limiting the size of issuable description and comments to 1_000_000,
which is close to ~1MB of ASCII characters, which represents 99.9% of
all descriptions and comments we have in DB at the moment. This should
help prevent DoS attacks when comments contain refference strings.

Also this change updates regexp matching the namespaces paths by
limiting the namespaces paths to Namespace::NUMBER_OF_ANCESTORS_ALLOWED,
as we allow 20 levels deep groups.

see https://gitlab.com/gitlab-org/gitlab-ce/issues/61974#note_191274234
2019-08-22 10:43:13 +03:00
Shinya Maeda d78f0724d9 Avoid conflicts between ArchiveTraceWorkers
This commits avoiding conflicts between ArchiveTraceWorker
and ArchiveTracesCronWorker by changing the target of the
latter worker.
2019-08-22 10:28:12 +07:00