Commit Graph

103 Commits

Author SHA1 Message Date
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
Nick Thomas 7b276a1076
Fix an order dependency in a spec 2018-01-29 16:18:31 +00:00
Ahmad Sherif f32f04a50f Migrate Commit#uri_type to Gitaly
Closes gitaly#915
2018-01-15 14:16:22 +01:00
Hiroyuki Sato a7d26f00c3 Display related merge requests in commit detail page 2018-01-12 20:38:36 +00:00
Jacob Vosmaer ac2cb65ab3 Remove the Commit#tree method 2018-01-04 18:00:28 +01:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Zeger-Jan van de Weg c6edae3887
Load commit in batches for pipelines#index
Uses `list_commits_by_oid` on the CommitService, to request the needed
commits for pipelines. These commits are needed to display the user that
created the commit and the commit title.

This includes fixes for tests failing that depended on the commit
being `nil`. However, now these are batch loaded, this doesn't happen
anymore and the commits are an instance of BatchLoader.
2017-12-19 10:05:40 +01:00
Yorick Peterse ab16a6fb34
Optimise getting the pipeline status of commits
This adds an optimised way of getting the latest pipeline status for a
list of Commit objects (or just a single one).
2017-11-16 16:01:14 +01:00
Jacob Vosmaer 902b5347dc Prepare Repository#merge for migration to Gitaly 2017-09-15 16:39:20 +02:00
Saverio Miroddi 934eef7290 Improve description of a Commit#cherry_pick_message UT 2017-08-22 22:20:22 +02:00
Saverio Miroddi 7a8a8e0764 Fix rubocop errors in spec/models/commit_spec.rb 2017-08-21 22:13:41 +02:00
Saverio Miroddi e6220c018e Add UT for cherry-pick of an existing merge that is not found 2017-08-21 21:05:11 +02:00
Saverio Miroddi 9ec358af7b Reverse order of commits in MR cherry-pick message
Also improved the UT for better documenting this change.
2017-08-21 20:47:18 +02:00
Saverio Miroddi b4622c772e Remove redundant statement part in a test suite 2017-08-18 08:30:14 +02:00
Saverio Miroddi c0f921606c Correct the cherry-pick message for merge commits
The list of commits must be generated from the merge request,
not from a diff of the branches.
2017-08-17 22:38:47 +02:00
Saverio Miroddi 919c0c7ba7 Extended UTs for the new cherry-pick message format 2017-08-16 13:18:07 +02:00
Alejandro Rodríguez 3ce6f03f14 Incorporate Gitaly's CommitService.FindCommit RPC 2017-08-07 23:33:43 -04:00
Alejandro Rodríguez c21ae07e33 Refactor Gitlab::Git::Commit to include a repository 2017-08-07 22:34:34 -04:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Lin Jen-Shin aada5273fa Use RequestStoreWrap for Commit#author
We also try to use instance variable to cache the result if
RequestStore is not available, so we could keep the same logic,
using the same cache key. Also introduce a way to specify method
specific cache key
2017-07-18 01:18:20 +08:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Rémy Coutable b173ae6b48 Fix linting, route, and specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-09 17:21:39 +02:00
Rémy Coutable 54c04f53fd Fix spec failures and add a feature flag for the performance bar
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-09 17:21:39 +02:00
Dmitriy Zaporozhets 8ce11fc388 Merge branch '12614-fix-long-message' into 'master'
Fix long urls in the title of commit

Closes #12614

See merge request !10938
2017-06-08 10:32:45 +00:00
Ahmad Sherif 99feed6e00 Add support for deltas_only under Gitaly
Closes gitaly#199
2017-05-13 18:27:06 +02:00
Alexander Randa fdba744986 Fix long urls in the title of commit 2017-05-12 11:45:26 +00:00
Jacob Vosmaer 27fb64d6a3 Remove deltas_only from DiffCollection 2017-05-11 16:01:10 +02:00
Ahmad Sherif 34cd109797 Re-enable Gitaly commit_raw_diff feature 2017-05-07 23:37:42 +02:00
Lin Jen-Shin 0a29bde4a1 Rename latest_pipeline to last_pipeline
As it might be confusing that it's not the same as
Pipeline#latest

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11038#note_28677090
2017-05-03 01:40:49 +08:00
Alejandro Rodríguez d6cc8feb6c Setup and run a Gitaly server for testing if GitalyClient is enabled 2017-04-11 16:00:44 -03:00
Robert Speicher 5409a3c5b7 Merge branch 'feature/use-gitaly-for-commit-show' into 'master'
Use Gitaly for CommitController#show

See merge request !9629
2017-03-17 17:41:44 +00:00
Filipa Lacerda ec970763e9 Adds pipeline mini-graph to system information box in Commit View 2017-03-16 00:44:31 +00:00
Ahmad Sherif c0a4f527db Use Gitaly for CommitController#show 2017-03-15 12:52:11 +02:00
Robert Speicher fcb37542e7 Use `:empty_project` where possible in model specs 2017-01-26 17:44:59 -05:00
YarNayar dd3ddcd72b Allows to search within project by commit's hash
Was proposed in #24833
2017-01-24 14:56:00 +03:00
jurre e59623e738
Mark MR as WIP when pushing WIP commits 2017-01-19 12:30:34 +01:00
Lin Jen-Shin d9000184e5 Add explicit status test, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20058993

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059060

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059357
2016-12-15 18:52:36 +08:00
Lin Jen-Shin cc6f578d5f Use described_class and update description
Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059124

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059187

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059322
2016-12-15 18:16:22 +08:00
Lin Jen-Shin 7cced60069 Introduce latest_status and add a few tests
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20003268
2016-12-14 23:37:49 +08:00