summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@12-6-stable-eeGitLab Bot2019-12-201-3/+20
|
* Add latest changes from gitlab-org/gitlab@12-4-stable-eeGitLab Bot2019-10-221-30/+17
|
* Add latest changes from gitlab-org/gitlab@masterGitLab Bot2019-09-171-1/+0
|
* Fix moving issues API failing when text includes commit URLssh-fix-issue-move-apiStan Hu2019-08-281-1/+6
| | | | | | | | | | | | | | | 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
* Enable Rubocop Performance/ReverseEachsh-rubocop-reverse-eachStan Hu2019-07-241-1/+1
| | | | | | | `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)
* Speed up merge request loads by disabling BatchLoader replace_methodsStan Hu2019-06-131-1/+1
| | | | | | | | | | | 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 for modules that have many methods. 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
* Use Redis for CacheMarkDownField on non AR modelsPatrick Bajao2019-06-051-7/+4
| | | | | | | | | | | | | | | | | | This allows using `CacheMarkdownField` for models that are not backed by ActiveRecord. When the including class inherits `ActiveRecord::Base` we include `Gitlab::MarkdownCache::ActiveRecord::Extension`. This will cause the markdown fields to be rendered and the generated HTML stored in a `<field>_html` attribute on the record. We also store the version used for generating the markdown. All other classes that include this model will include the `Gitlab::MarkdownCache::Redis::Extension`. This add the `<field>_html` attributes to that model and will generate the html in them. The generated HTML will be cached in redis under the key `markdown_cache:<class>:<id>`. The class this included in must therefore respond to `id`.
* Allow custom squash commit messagesLuke Duncalfe2019-02-061-1/+1
|
* [master] Pipelines section is available to unauthorized usersKamil Trzciński2019-01-311-1/+4
|
* Skip per-commit validations which have already passed on another change/branchFrancisco Javier López2018-12-281-0/+4
|
* Truncate merge request titles with periods instead of ellipsisStan Hu2018-12-061-1/+3
| | | | Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54862
* Rename project's pipelines relationFrancisco Javier López2018-12-051-2/+2
|
* Match users better by their private commit emailNick Thomas2018-11-191-18/+7
| | | | | | 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.
* User can keep their commit email private43521-keep-personal-emails-privateTiago Botelho2018-11-071-1/+1
| | | | | | | | The private commit email is automatically generated in the format: id-username@noreply.HOSTNAME GitLab instance admins are able to change the HOSTNAME portion, that defaults to Gitlab's hostname, to whatever they prefer.
* Add pipeline status to diffs/commit_item49329-mr-show-commit-detailsPaul Slaughter2018-10-031-1/+5
| | | | | **Notes:** - Also exposes commit.pipeline_status_path in diffs.json
* Properly fix an introduced N+1 SQL issue loading commit authorsNick Thomas2018-09-061-6/+1
|
* Bulk-render commit titles in the tree view to improve performanceNick Thomas2018-09-061-1/+7
|
* Make it clearer when Commit#description returns no_commit_messageSean McGivern2018-08-211-5/+2
|
* use #blank? instead #nil?yisiliang2018-08-211-1/+1
|
* to avoid “NoMethodError (undefined method `split' for nil:NilClass)” ↵yisiliang2018-08-211-1/+5
| | | | while safe_message is nil.
* Create empty Commits::UpdateService and wire it upPeter Leitzen2018-08-101-0/+4
|
* Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-modelsgfyoung2018-07-261-4/+6
| | | | Partially addresses #47424.
* Preload pipeline data for project pipelinesYorick Peterse2018-05-171-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge branch 'blackst0ne-rails5-add-touch-later-to-commit-model' into 'master'Rémy Coutable2018-05-021-0/+6
|\ | | | | | | | | [Rails5] Add `touch_later` to `Commit` model See merge request gitlab-org/gitlab-ce!18642
| * [Rails5] Add `touch_later` to `Commit` modelblackst0ne2018-04-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes errors like: ``` 1) API::Todos GET /todos when unauthenticated returns authentication error Failure/Error: @raw.__send__(method, *args, &block) # rubocop:disable GitlabSecurity/PublicSend NoMethodError: undefined method `touch_later' for #<Gitlab::Git::Commit:0x00005573f5196270> # ./app/models/commit.rb:259:in `method_missing' # ./spec/requests/api/todos_spec.rb:12:in `block (2 levels) in <top (required)>' ```
* | Merge request and commit discussions APIJan Provaznik2018-05-011-0/+4
|/
* Fix N+1 queries when loading participants for a commit noteStan Hu2018-04-181-1/+1
| | | | | | | | | We saw about 10,000 SQL queries for some commits in the NewNoteWorker, which stalled the Sidekiq queue for other new notes. The notification service took up to 8 minutes to process the commits. Avoiding this N+1 query brings the time down significantly. Closes #45526
* Add support for patch link extension for commit links on GFMOswaldo Ferreira2018-04-061-1/+4
|
* Add banzai filter to detect commit message trailers and properly link the usersOmar Mekky2018-04-041-1/+2
|
* Send notification emails when push to a merge requestYarNayar/gitlab-ce-23460-send-email-when-pushing-more-commits-to-the-merge-requestYarNayar2018-03-261-1/+1
| | | | Closes #23460
* Lazy fetch parent commits for a commitZeger-Jan van de Weg2018-03-061-2/+5
|
* Fetch commit signatures from Gitaly in batchesfeature/fetch-commit-signs-from-gitaly-in-batchAhmad Sherif2018-03-011-4/+2
| | | | Closes gitaly#1046
* stop ProcessCommitWorker from processing MR merge commitMicaël Bergeron2018-02-161-4/+4
| | | | | | | When a merge request is merged, it creates a commit with the description of the MR, which may contain references and issue closing references. As this will be handled in the PostMergeService anyways, let's ignore merge commit generated from a MR.
* API - Include project in commits&blobs search resultsJarka Kadlecová2018-02-141-0/+4
|
* Migrate Commit#uri_type to Gitalyfeature/migrate-commit-uri-to-gitalyAhmad Sherif2018-01-151-4/+4
| | | | Closes gitaly#915
* Display related merge requests in commit detail pageHiroyuki Sato2018-01-121-0/+4
|
* Only search for MR revert commits on notes after MR was merged41807-15665-consistently-502s-because-it-fetches-every-commitSean McGivern2018-01-121-2/+3
| | | | | | | | | | If we search for notes before the MR was merged, we have to load every commit that was ever part of the MR, or mentioned in a push. In extreme cases, this can be tens of thousands of commits to load, but we know they can't revert the merge commit, because they are from before the MR was merged. In the (rare) case that we don't have a `merged_at` value for the MR, we can still search all notes.
* Remove the Commit#tree methodremove-commit-treeJacob Vosmaer2018-01-041-1/+1
|
* Load commit in batches for pipelines#indexZeger-Jan van de Weg2017-12-191-3/+17
| | | | | | | | | | 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.
* Adds ordering to projects contributors in APIJacopo2017-12-131-0/+14
| | | | | | | Allows ordering in GET api/v4/projects/:project_id/repository/contributors through `order_by` and `sort` params. The available `order_by` options are: name|email|commits. The available `sort` options are: asc|desc.
* add support for the commit reference filtermicael.bergeron2017-12-071-1/+2
|
* Fix link text from group contextJarka Kadlecova2017-11-231-6/+6
|
* Batchload blobs for diff generationZeger-Jan van de Weg2017-11-211-2/+2
| | | | | | | | | | | | | | | | | | After installing a new gem, batch-loader, a construct can be used to queue data to be fetched in bulk. The gem was also introduced in both gitlab-org/gitlab-ce!14680 and gitlab-org/gitlab-ce!14846, but those mrs are not merged yet. For the generation of diffs, both the old blob and the new blob need to be loaded. This for every file in the diff, too. Now we collect all these so we do 1 fetch. Three `.allow_n_plus_1_calls` have been removed, which I expect to be valid, but this needs to be confirmed by a full CI run. Possibly closes: - https://gitlab.com/gitlab-org/gitlab-ce/issues/37445 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37599 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
* Optimise getting the pipeline status of commitsci-pipeline-status-queryYorick Peterse2017-11-161-3/+6
| | | | | This adds an optimised way of getting the latest pipeline status for a list of Commit objects (or just a single one).
* Remove unnecessary commentsDouwe Maan2017-09-251-2/+0
|
* Properly compare diff refs and diff positions when shas are truncatedDouwe Maan2017-09-251-5/+6
|
* Adds cacheless render to Banzai object render34509-improves-markdown-rendering-performance-for-commits-listTiago Botelho2017-09-061-0/+9
|
* pass whole commit to Gitlab::Gpg::Commit againAlexis Reigel2017-09-051-1/+1
| | | | | we need the commit object for the updated verification that also checks the committer's email to match the gpg key and user's emails.
* Merge branch 'sm-cherry-pick-list-commits-in-message' into 'master'Sean McGivern2017-09-011-0/+22
|\ | | | | | | | | Add 'from commit' information to cherry-picked commits See merge request !13475
| * Change a variable name in Commit#cherry_pick_descriptionSaverio Miroddi2017-08-211-4/+4
| |