Commit Graph

60 Commits

Author SHA1 Message Date
GitLab Bot 375b68fe81 Add latest changes from gitlab-org/gitlab@master 2023-09-08 18:10:02 +00:00
GitLab Bot fa69a57b46 Add latest changes from gitlab-org/gitlab@master 2023-04-26 18:19:16 +00:00
GitLab Bot 363a1ea138 Add latest changes from gitlab-org/gitlab@master 2023-03-14 12:08:06 +00:00
GitLab Bot 4a7ca716f6 Add latest changes from gitlab-org/gitlab@master 2023-02-23 12:11:53 +00:00
GitLab Bot 3cda3d43ae Add latest changes from gitlab-org/gitlab@master 2023-02-03 15:07:39 +00:00
GitLab Bot 18869e31e6 Add latest changes from gitlab-org/gitlab@master 2022-11-22 21:10:22 +00:00
GitLab Bot c0b718a0db Add latest changes from gitlab-org/gitlab@master 2022-11-21 18:07:57 +00:00
GitLab Bot 026a5e9101 Add latest changes from gitlab-org/gitlab@master 2022-05-26 09:08:11 +00:00
GitLab Bot 93003eb115 Add latest changes from gitlab-org/gitlab@master 2022-03-17 21:08:35 +00:00
GitLab Bot 634e9bccc6 Add latest changes from gitlab-org/gitlab@master 2022-01-31 18:18:10 +00:00
GitLab Bot 60aef5496e Add latest changes from gitlab-org/gitlab@master 2021-11-12 18:12:20 +00:00
GitLab Bot a7d30d92f8 Add latest changes from gitlab-org/gitlab@master 2021-10-21 09:09:48 +00:00
GitLab Bot c9bef85d79 Add latest changes from gitlab-org/gitlab@master 2021-04-19 21:09:27 +00:00
GitLab Bot a46b489e17 Add latest changes from gitlab-org/gitlab@master 2021-03-24 12:09:32 +00:00
GitLab Bot 889bf7a0ee Add latest changes from gitlab-org/gitlab@master 2021-03-16 18:11:53 +00:00
GitLab Bot 2ac4833015 Add latest changes from gitlab-org/gitlab@master 2020-10-08 18:08:32 +00:00
GitLab Bot 619d0b6922 Add latest changes from gitlab-org/gitlab@master 2020-02-26 18:09:24 +00:00
GitLab Bot 8c30d396c5 Add latest changes from gitlab-org/gitlab@master 2019-10-14 18:06:24 +00:00
GitLab Bot 538fff823d Add latest changes from gitlab-org/gitlab@master 2019-09-30 15:08:09 +00:00
GitLab Bot 80f61b4035 Add latest changes from gitlab-org/gitlab@master 2019-09-18 14:02:45 +00:00
Stan Hu 0d8e9f6ee3 Expand FindCommit caching to blob and refs
This enables FindCommit caching to the following actions:

* BlobController#show
* RefsController#logs_tree

It also improves caching in CommitsController since some
duplicate requests were occuring inside the before_action
definitions.
2019-04-06 05:16:22 -07:00
Stan Hu f1dce21609 Enable FindCommit caching for project and commits pages
This reduces a handful of duplicate FindCommit calls while viewing the
projects and commits pages.
2019-04-05 04:52:42 -07: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
Douwe Maan 19ad2a4987
Revert "[Rails5] Set request.format in commits_controller"
This reverts commit 6da1941553.

# Conflicts:
#	app/controllers/projects/commits_controller.rb
2018-12-03 12:29:01 +01:00
Cindy Pallares fe5f75930e
Merge branch 'security-fix-pat-web-access' into 'master'
[master] Resolve "Personal access token with only `read_user` scope can be used to authenticate any web request"

See merge request gitlab/gitlabhq!2583
2018-11-28 19:13:59 -05: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
Kia Mei Somabes c03bc268be Transfer to commits_controller, add test, and update changelog 2018-07-24 08:04:16 +08:00
blackst0ne 6da1941553 [Rails5] Set request.format in commits_controller
Since Rails 5.0 `request.format` is being set depending on the route extension.

In commits pages we pass a ref as a URL parameter.
If the ref is an extension-like, Rails converts it and sets to
`request.format`.

E.g. if the ref is `some_branch.atom`, Rails starts responding with
`atom` format, but it should response with `html` because `.atom` is the
part of ref name, not the format.

This commit explicitly sets `request.format` to `:html` when needed.
2018-06-20 21:42:52 +11:00
Ahmad Sherif 03f3350f3f Fetch commit signatures from Gitaly in batches
Closes gitaly#1046
2018-03-01 18:31:31 +01:00
Yorick Peterse cca61980d5
Track and act upon the number of executed queries
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.

In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
2018-02-01 17:00:46 +01:00
Jacob Vosmaer (GitLab) 4d87f3bb37 Retrieve commit signatures with Gitaly 2018-01-18 14:10:17 +00:00
haseeb d1e00b1eb6 Fix 404 on empty branch 2017-11-27 13:36:02 +00: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
Douwe Maan fec48c6e17 Use Commit#notes and Note.for_commit_id when possible to make sure we use all the indexes available to us 2017-11-08 12:22:11 +01:00
Guilherme Vieira ada114065f Renders 404 in commits controller if no commits are found 2017-10-18 23:41:00 -02:00
Tiago Botelho 6d8e102c74 Adds cacheless render to Banzai object render 2017-09-06 15:35:35 +01:00
Alexis Reigel eda001565c fetch gpg signature badges by ajax 2017-07-27 15:46:03 +02:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Tieu-Philippe KHIM 3c1700cde6 Refactor atom builder by using xml.atom layout 2017-06-12 19:21:13 +02: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 5416d0e083 Pass `@ref` along so we know which pipeline to show
Closes #23615
2016-10-24 22:26:06 +08:00
Valery Sizov fd2c3a3da0 Refactoring find_commits functionality 2016-10-20 12:45:34 +03:00
Paco Guzman c4b9bd0413 API support for the 'since' and 'until' operators on commit requests
- Parameter validation as ISO8601 format
2016-04-29 09:26:52 +02:00
Douglas Barbosa Alexandre 1353cff5fe Replaces "Create merge request" link with one to the MR when one exists 2016-02-10 10:32:25 -02:00
Dmitriy Zaporozhets 4443a5f3c7 Add support for ref and path to commits filtering
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-07 15:16:11 +01:00
Dmitriy Zaporozhets 9a250ad6d8 Filter commits by search parameter
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-01-07 15:16:10 +01:00
Robert Speicher 1bda2e43a2 Prevent an XSS warning from the updated Brakeman 2015-12-27 21:19:14 -05:00
Valery Sizov 95df86638d Fix: Inability to reply to code comments in the MR view, if the MR comes from a fork 2015-10-22 18:38:00 +02:00