Commit Graph

82 Commits

Author SHA1 Message Date
GitLab Bot 5f5f492fe2 Add latest changes from gitlab-org/gitlab@master 2021-04-22 15:09:56 +00:00
GitLab Bot b81fd57f3d Add latest changes from gitlab-org/gitlab@master 2021-04-22 09:09:45 +00:00
GitLab Bot 98f1353fcd Add latest changes from gitlab-org/gitlab@master 2021-04-20 21:09:07 +00:00
GitLab Bot dc7cd84a3e Add latest changes from gitlab-org/gitlab@master 2021-04-07 09:09:06 +00:00
GitLab Bot 1631d8a2e0 Add latest changes from gitlab-org/gitlab@master 2021-02-24 21:11:16 +00:00
GitLab Bot a7d515f2f3 Add latest changes from gitlab-org/gitlab@master 2021-02-23 00:11:11 +00:00
GitLab Bot 232e7582b0 Add latest changes from gitlab-org/gitlab@master 2021-02-22 15:10:48 +00:00
GitLab Bot 2ac4833015 Add latest changes from gitlab-org/gitlab@master 2020-10-08 18:08:32 +00:00
GitLab Bot bbe2430603 Add latest changes from gitlab-org/gitlab@master 2019-12-18 18:08:04 +00:00
Stan Hu 384a92b736 Check for valid refs in CommitController before doing anything
Before a 404 would be rendered only after a request to Gitaly would
return with an InvalidArgument error. Now we check that the ref have a
valid format before sending it to Gitaly. In both cases, a 404 is
returned to the user, but this change prevents Gitaly from generating
error noise in production.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1425
2018-12-09 21:56:31 -08:00
Stan Hu 22d7c1379f Reject invalid branch names in repository compare controller
Closes #51003
2018-10-08 13:32:31 -07:00
gfyoung 12ee2753c1 Enable even more frozen string in app/controllers
Enables frozen string for some vestigial files as
well as the following:

* app/controllers/projects/**/*.rb
* app/controllers/sherlock/**/*.rb
* app/controllers/snippets/**/*.rb
* app/controllers/users/**/*.rb

Partially addresses #47424.
2018-09-25 22:43:49 -07:00
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00
Stan Hu 5138d659b5 Speed up diff comparisons by limiting number of commit messages rendered
When a diff has a significant number of commits, the previous behavior would
attempt to render the Markdown on all the commit messages but only display
1000 of them. To avoid additional work, we only need to render the Markdown
on the set that is displayed.
2018-08-22 06:28:31 -07:00
Marc 0aa1f53d10 Add signature verification badge to compare view 2018-05-07 08:41:36 +00:00
Alejandro Rodríguez 0a4ee10eda Fix n+1 issue by not reloading fully loaded blobs 2018-03-05 11:14:43 -03:00
Andrew Newdigate 64d7ec0a9e Detect n+1 issues involving Gitaly 2017-09-19 10:55:37 +00:00
Rémy Coutable c456cc718b Make the labels in the Compare form less confusing
* Improve the descriptive text
* Rename "from" to "Target" and "to" to "Source"
* Swap "Target" and "Source" to have the same order as in MRs
* Reworded "Switch base of comparison" to "Swap versions"

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-09-15 13:05:30 +02:00
Tiago Botelho 6d8e102c74 Adds cacheless render to Banzai object render 2017-09-06 15:35:35 +01:00
Douwe Maan fe13f11041 Create and use project path helpers that only need a project, no namespace 2017-07-05 11:11:59 -05:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Douwe Maan bc4fec1fcb Remove @commit in compare and MR controllers 2017-05-23 15:37:43 -05:00
Douwe Maan 7c479d88a9 Pass fallback_diff_refs to Diff::File instead of using view helpers 2017-05-23 15:37:05 -05:00
Douwe Maan 48a0e9f6ae Fix specs 2017-04-09 22:27:45 -05:00
Douwe Maan 9d7c5e7584 Address feedback 2017-02-06 18:06:46 -06:00
Douwe Maan 6edc8d50dc Add feature specs 2017-02-06 16:12:24 -06:00
Douwe Maan c8b63a28af Improve performance of finding last deployed environment 2017-02-06 16:12:24 -06:00
Douwe Maan 27f2ca9418 Add 'View on [env]' link to blobs and individual files in diffs 2017-02-06 16:12:23 -06:00
Lin Jen-Shin 4587c78afa Merge remote-tracking branch 'upstream/master' into fix-git-hooks-when-creating-file
* upstream/master: (1122 commits)
  Update CHANGELOG.md for 8.16.2
  Display project ID in project settings (!8572)
  fixed points from comments to improve code quality
  Update CHANGELOG.md for 8.14.8
  Statisfy eslint
  Add CHANGELOG entry
  Fix access to the wiki code via HTTP when repository feature disabled
  Display fullscreen button on small screens (!5302)
  Prevent removing fields from dropdowns on input elements
  fix for all themes
  Return struct instead of multiple values
  Fix race conditions for AuthorizedProjectsWorker
  Add User#nested_groups and User#nested_projects methods
  Fix spec failure due to timestamp ordering issue in mySQL
  Fixed error with filter keyboard tests
  `can?` already includes the `feature_available?` check
  Test there is no Merge Request button when MRs are disabled
  Ensure the correct Merge Request button is found
  Add 409 conflict tests
  Add CHANGELOG
  ...
2017-01-26 17:21:38 +08:00
Martin Cabrera 856003cfea refactor rubocop suggestion 2017-01-16 23:17:24 +01:00
Martin Cabrera 9844c1f222 Refactored ‘from’ and ‘to’ variable preservation 2017-01-16 20:23:30 +01:00
Martin Cabrera 0413a7ad03 from or to get variables gets preserved if the other one is missing 2017-01-15 02:26:29 +01:00
Martin Cabrera c2283a2db7 Changed alert message character: from & to and 2017-01-15 01:12:19 +01:00
Martin Cabrera 5dc8fe31ba Fix Compare page throws 500 error when any branch/reference is not selected 2017-01-10 23:15:56 +01:00
Lin Jen-Shin c1a75c3c0b Prefer leading dots over trailing dots
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237#note_20601323
2017-01-04 22:32:36 +08:00
Lin Jen-Shin e0df1b5f99 Merge remote-tracking branch 'upstream/master' into fix-git-hooks-when-creating-file
* upstream/master: (60 commits)
  Refactor SSH keys docs
  Improvements to setting up ssh
  Do not reload diff for merge request made from fork when target branch in fork is updated
  Add 8.12.10, 8.12.11, and 8.12.12 CHANGELOG.md items
  Changes after review
  Fix broken test
  Adds CHANGELOG entry
  Adds tests
  Uniformize props name format
  Replace commit icon svg logic
  Replace play icon svg logic
  Update docs to reflect new defaults on omnibus
  Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'
  Merge branch 'html-safe-diff-line-content' into 'security'
  Merge branch 'rs-filter-authentication_token' into 'security'
  Merge branch 'destroy-session' into 'security'
  remove unnecessary issues event filter on comments tab
  Updating reference to database password
  Add CHANGELOG entry
  Displays milestone remaining days only when it's present
  ...
2016-12-10 01:27:56 +08:00
Douwe Maan f23b1cb453 Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'
Replace MR access checks with use of MergeRequestsFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

⚠️ - Potentially untested
💣 - No test coverage
🚥 - Test coverage of some sort exists (a test failed when error raised)
🚦 - Test coverage of return value (a test failed when nil used)
 - Permissions check tested

- [x] 💣  app/finders/notes_finder.rb:17
- [x] ⚠️  app/views/layouts/nav/_project.html.haml:80 [`.count`]
- [x] 💣  app/controllers/concerns/creates_commit.rb:84
- [x] 🚥  app/controllers/projects/commits_controller.rb:24
- [x] 🚥  app/controllers/projects/compare_controller.rb:56
- [x] 🚦  app/controllers/projects/discussions_controller.rb:29
- [x]   app/controllers/projects/todos_controller.rb:27
- [x] 🚦  app/models/commit.rb:268
- [x]  lib/gitlab/search_results.rb:71

- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_267_266 Memoize ` merged_merge_request(current_user)`
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_248_247 Expected side effect for `merged_merge_request!`, consider `skip_authorization: true`.
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_269_269 Scary use  of unchecked `merged_merge_request?`

See merge request !2033
2016-12-08 21:42:07 -03:00
Lin Jen-Shin 8384d0d8d5 Introduce Repository#with_tmp_ref which we need
commits from the other repository. We'll cleanup
the tmp ref after we're done with our business.
2016-12-08 17:57:52 +08:00
Douwe Maan c008a1a967 Make Compare#diffs diff_options a regular argument 2016-08-03 09:32:01 -07:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Paco Guzman cd7c2cb6dd Cache highlighted diff lines for merge requests
Introducing the concept of SafeDiffs which relates 
diffs with UI highlighting.
2016-08-03 07:00:19 +02:00
Douwe Maan 79214be727 Add Discussion model to represent MR/diff discussion 2016-07-20 16:18:18 -06:00
Phil Hughes a9d5b07769 Apply diff view cookie on compare
Closes #19573
2016-07-15 13:42:18 -05:00
Sean McGivern ff55398aaf DRY up diff_for_path actions
1. Move render method to a concern, not a helper.
2. Let DiffHelper#diff_options automatically add the path option.
3. Move more instance var definitions to before filters.
2016-07-08 13:53:51 +01:00
Sean McGivern 6a46926f88 Remove unused argument to CompareService#execute 2016-07-08 13:53:17 +01:00
Sean McGivern b6b26692ea Collapse large diffs by default
When rendering a list of diff files, skip those where the diff is over
10 KB and provide an endpoint to render individually instead.
2016-07-08 10:56:55 +01:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Douwe Maan 9a3ed265e9 Use `@diff_notes_disabled` instead of `@comments_allowed` 2016-05-13 17:31:58 -05:00