Commit Graph

143 Commits

Author SHA1 Message Date
GitLab Bot 45a8c43afe Add latest changes from gitlab-org/gitlab@master 2023-05-15 09:08:57 +00:00
GitLab Bot af69e63b66 Add latest changes from gitlab-org/gitlab@master 2023-04-25 09:18:44 +00:00
GitLab Bot b486760a63 Add latest changes from gitlab-org/gitlab@master 2022-12-22 18:07:08 +00:00
GitLab Bot 66e3f84f52 Add latest changes from gitlab-org/gitlab@master 2022-11-23 21:11:46 +00:00
GitLab Bot 16daf112d6 Add latest changes from gitlab-org/gitlab@master 2022-09-14 12:12:34 +00:00
GitLab Bot b420660ef1 Add latest changes from gitlab-org/gitlab@master 2022-07-28 18:09:03 +00:00
GitLab Bot 8e1bb8745b Add latest changes from gitlab-org/gitlab@master 2022-05-24 15:08:28 +00:00
GitLab Bot 0aa20f3dac Add latest changes from gitlab-org/gitlab@master 2022-02-03 18:17:34 +00:00
GitLab Bot 2b2d833ab3 Add latest changes from gitlab-org/gitlab@master 2022-01-25 18:11:55 +00:00
GitLab Bot fee19ef336 Add latest changes from gitlab-org/gitlab@master 2021-11-23 18:12:49 +00:00
GitLab Bot cb6a3f5f73 Add latest changes from gitlab-org/gitlab@master 2021-10-13 18:12:40 +00:00
GitLab Bot be8b477154 Add latest changes from gitlab-org/gitlab@master 2021-06-29 03:07:32 +00:00
GitLab Bot d35de87f96 Add latest changes from gitlab-org/gitlab@master 2021-06-15 06:10:17 +00:00
GitLab Bot d715acda3b Add latest changes from gitlab-org/gitlab@master 2021-06-10 18:10:05 +00:00
GitLab Bot 9724bdc4c0 Add latest changes from gitlab-org/gitlab@master 2021-04-07 03:09:01 +00:00
GitLab Bot 6e495b4e91 Add latest changes from gitlab-org/gitlab@master 2021-02-01 09:09:28 +00:00
GitLab Bot fcef382cb9 Add latest changes from gitlab-org/gitlab@master 2021-01-19 09:10:32 +00:00
GitLab Bot 39c1496527 Add latest changes from gitlab-org/gitlab@master 2021-01-13 12:10:27 +00:00
GitLab Bot eb8836dea4 Add latest changes from gitlab-org/gitlab@master 2020-12-21 12:10:22 +00:00
GitLab Bot 83fc2f3dc8 Add latest changes from gitlab-org/gitlab@master 2020-07-08 21:09:09 +00:00
GitLab Bot c59765a50a Add latest changes from gitlab-org/gitlab@master 2020-06-24 18:09:03 +00:00
GitLab Bot 5781a49660 Add latest changes from gitlab-org/gitlab@master 2020-03-12 00:09:34 +00:00
GitLab Bot 47ebeef912 Add latest changes from gitlab-org/gitlab@master 2020-03-11 00:09:09 +00:00
GitLab Bot 0ab47b994c Add latest changes from gitlab-org/gitlab@master 2020-02-13 15:08:52 +00:00
GitLab Bot 6168721025 Add latest changes from gitlab-org/gitlab@master 2020-02-07 00:09:12 +00:00
GitLab Bot 20d564f106 Add latest changes from gitlab-org/gitlab@master 2020-02-05 12:09:15 +00:00
GitLab Bot c158fa8d69 Add latest changes from gitlab-org/gitlab@master 2020-01-16 12:08:32 +00:00
GitLab Bot 2b3bfe8fc5 Add latest changes from gitlab-org/gitlab@master 2020-01-08 00:07:43 +00:00
GitLab Bot ccf37fd3ec Add latest changes from gitlab-org/gitlab@master 2019-12-18 15:08:03 +00:00
GitLab Bot 4e375367b7 Add latest changes from gitlab-org/gitlab@master 2019-12-07 00:07:51 +00:00
GitLab Bot ab7cf450ba Add latest changes from gitlab-org/gitlab@master 2019-12-03 18:06:49 +00:00
GitLab Bot 0a850868df Add latest changes from gitlab-org/gitlab@master 2019-10-09 12:06:13 +00:00
GitLab Bot 538fff823d Add latest changes from gitlab-org/gitlab@master 2019-09-30 15:08:09 +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
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 18020f00f8 Speed up commit loads by disabling BatchLoader replace_methods
We've seen a significant performance penalty when using
`BatchLoader#__replace_with!`. This defines methods on the batch loader
that proxy to the 'real' object using send. The alternative is
`method_missing`, which is slower.  However, we've noticed that
`method_missing` can be faster if:

1. The objects being loaded have a large interface.
2. We don't call too many methods on the loaded object.

In production, we've seen the rendering times of the merge request
widget increase as a result of loading commit data. BatchLoader attempts
to call replace_methods on the lazy object, but this has a significant
performance penalty. Disabling this mode
(https://github.com/exAspArk/batch-loader/pull/45) appears to cut load
times by about 50% for MergeRequestsController#show.

Relates to https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6941
2019-06-13 14:21:23 -07:00
Thong Kuah a2cfc150ce Add # frozen_string_literal to spec/models
Adds `# frozen_string_literal: true` to spec/models ruby files
2019-04-01 14:37:54 +13:00
Stan Hu 4ee08fd1f7 Add back Rugged support for retrieving a commit tree entry
This brings back some of the changes in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20176/diffs.

We discovered another N+1 that hits Gitaly `TreeEntry` via the
`RelativeLinkFilter`:
https://gitlab.com/gitlab-org/gitlab-ce/issues/58657. When a blob is
loaded with many relative links, `TreeEntry` is called for each link to
scan the URI type.

There are multiple paths that hit Gitaly `TreeEntry`, and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25706 did not
cover all cases. This commit covers another common use case.

For users using Gitaly on top of NFS, accessing the Git data directly
via Rugged may be faster than going through than Gitaly. This merge
request introduces the feature flag `rugged_commit_tree_entry` to
activate the Rugged method.
2019-03-08 16:01:59 -08:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Stan Hu 7d18c4d236 Truncate merge request titles with periods instead of ellipsis
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54862
2018-12-06 21:51:51 -08:00
Nick Thomas 59c4fb4ecb
Match users better by their private commit email
Private commit emails were introduced in !22560, but some parts of
GitLab were not updated to take account of them. This commit adds
support in places that were missed.
2018-11-19 12:45:07 +00:00
Rémy Coutable 4ca1afec35 Merge branch 'fix-committer-typo' into 'master'
Fix committer typo

Closes #51808

See merge request gitlab-org/gitlab-ce!21899
2018-09-25 17:08:23 +00:00
George Tsiolis f611493912 Fix committer typo 2018-09-25 11:51:07 +03:00
Michael Kozono a54a5d9f39 Use `Gitlab::SafeRequestStore` in more places
Even if it doesn’t save lines of code, since people will tend to use
code they’ve seen. And `SafeRequestStore` is safer since you
don’t have to remember to check `RequestStore.active?`.
2018-09-24 12:11:27 -07:00
Sean McGivern 5759bfe029 Make it clearer when Commit#description returns no_commit_message 2018-08-21 11:41:25 +01:00
yisiliang 0d642e1e3c to avoid “NoMethodError (undefined method `split' for nil:NilClass)” while safe_message is nil. 2018-08-21 10:41:47 +01:00
Jacob Vosmaer 33c950f293 Client-side fix for Gitaly TreeEntry bug 2018-06-26 14:12:08 +02:00
Yorick Peterse 19428e8008
Preload pipeline data for project pipelines
When displaying the pipelines of a project we now preload the following
data:

1. Authors of the commits that belong to these pipelines
2. The number of warnings per pipeline, which is used by
   Ci::Pipeline#has_warnings?

== Commit Authors

Previously this data was queried for every Commit separately, leading to
20 SQL queries being executed in the worst case. With an average of 3 to
5 milliseconds per SQL query this could result in 100 milliseconds being
spent in _just_ getting Commit authors.

To preload this data Commit#author now uses BatchLoader (through
Commit#lazy_author), and a separate module
Gitlab::Ci::Pipeline::Preloader is used to ensure all authors are loaded
before they are used.

== Number of warnings

This changes Ci::Pipeline#has_warnings? so it supports preloading of the
number of warnings per pipeline. This removes the need for executing a
COUNT(*) query for every pipeline just to see if it has any warnings or
not.
2018-05-17 13:53:00 +02:00
Zeger-Jan van de Weg dfdd881510
Workhorse to send raw diff and patch for commits
Prior to this change, this was done through unicorn. In theory this
could time out. Workhorse has been sending these raw patches and diffs
for a long time and is stable in doing so.

Added bonus is the fact that `Commit#to_patch` can be removed.

`Commit#to_diff` too, which closes
https://gitlab.com/gitlab-org/gitaly/issues/324

Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
2018-05-16 11:52:43 +02:00
Zeger-Jan van de Weg e02f1271f5
Return nil on empty path
The execution path wasn't clear from the error, but either way this is a
fix.

Closes gitlab-org/gitaly#1115
2018-04-17 16:30:18 +02:00