Commit Graph

1412 Commits

Author SHA1 Message Date
Kamil Trzciński 723f936fb1 Merge branch 'sh-cache-pipeline-find-commits' into 'master'
Cache FindCommit results in pipelines view

See merge request gitlab-org/gitlab-ce!26776
2019-04-02 14:29:49 +00:00
Stan Hu e37383d453 Cache FindCommit results in pipelines view
For each pipeline, the controller will call `Pipeline#latest?` to
determine if the pipeline's ref is the latest for that branch.
Since it's likely that the same branches are being used in each
pipeline, we can reduce Gitaly overhead by caching the results
of the FindCommit call.
2019-04-02 04:15:32 -07:00
John Jarvis 69b65a6b74 Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02 2019-04-02 10:12:32 +02:00
GitLab Release Tools Bot b122be5ed5 Merge branch 'security-id-potential-denial-languages' into 'master'
Return cached languages if they've been detected before

See merge request gitlab/gitlabhq!2998
2019-04-02 07:48:28 +00:00
Stan Hu db759c5d9c Allow ref name caching CommitService#find_commit
For a given merge request, it's quite common to see duplicate FindCommit
Gitaly requests because the Gitaly CommitService caches the request by
the commit SHA, not by the ref name. However, most of the duplicate
requests use the ref name, so the cache is never actually used in
practice. This leads to unnecessary requests that slow performance.

This commit allows certain callers to bypass the ref name to
OID conversion in the cache. We don't do this by default because it's
possible the tip of the branch changes during the commit, which
would cause the caller to get stale data.

This commit also forces the Ci::Pipeline to use the full ref name
so that caching can work for merge requests.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57083
2019-03-27 14:46:39 -05:00
Alex Hanselka c7fc0bf531
Merge remote-tracking branch 'dev/master'
* dev/master:
  Update CHANGELOG.md for 11.8.3
  Update CHANGELOG.md for 11.7.7
  Only return `commands_changes` used in frontend
2019-03-20 15:57:19 -05:00
Alex Hanselka d8dfd330de Merge branch 'security-2826-fix-project-serialization-in-quick-actions' into 'master'
Fix project serialization in quick actions response

Closes #2826

See merge request gitlab/gitlabhq!3001
2019-03-20 20:56:40 +00:00
Igor Drozdov 732f892db3 Return cached languages if they've been detected before 2019-03-20 20:33:49 +03:00
Stan Hu d165754400 Reject HEAD requests to info/refs endpoint
In production, we see high error rates due to clients attempting to use
the dumb Git HTTP protocol with HEAD /foo/bar.git/info/refs
endpoint. This isn't supported and causes Error 500s because Workhorse
doesn't send along its secret because it's not proxying this request.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54579
2019-03-19 11:23:51 -07:00
Heinrich Lee Yu 3d85406734 Only return `commands_changes` used in frontend
When executing quick actions, this limits the `commands_changes`
response to only those used by the frontend
2019-03-18 13:28:35 -05:00
Heinrich Lee Yu 2de0bcf800 Remove redirecting to last visited board
Move this to EE-only. It isn't useful here since there's only one board
2019-03-13 20:33:35 +08:00
Heinrich Lee Yu 7d5ee4181a Refactor groups and projects boards actions
Move common functionality to BoardsActions concern
2019-03-13 20:33:35 +08:00
Grzegorz Bizon 5cea1e8b80 Merge branch '56937-edit-knative-domain' into 'master'
Edit Knative domain after it has been deployed

Closes #56937

See merge request gitlab-org/gitlab-ce!25386
2019-03-07 12:43:34 +00:00
Douwe Maan 6cfa5ee536 Merge branch 'expand-diff-to-full-file' into 'master'
Expand diff to entire file

Closes #19054

See merge request gitlab-org/gitlab-ce!24406
2019-03-07 11:33:15 +00:00
Mark Chao cea59dbe03 Move diff_line preparation into presenter
Update spec
2019-03-07 16:12:36 +08:00
Mark Chao 2609c2a73e Fix spec description and outdated comments 2019-03-06 15:51:22 +08:00
Mark Chao 90527b9f84 Add full option for blob diff action
Returns all diff lines for frontend if full is true.
Turn UnfoldForm into presenter, and move controller logic to presenter.
2019-03-06 15:50:55 +08:00
João Cunha 3bdff7aadf Rename ClusterUpdateAppWorker to ClusterPatchAppWorker
- This is to avoid colision with EE ClusterUpdateAppWorker
2019-03-05 15:21:29 +00:00
João Cunha f8234d9a08 Creates Clusterss::ApplciationsController update endpoint
- Creates new route
- Creates new controller action
- Creates call stack:
  Clusterss::ApplciationsController calls -->
  Clusters::Applications::UpdateService calls -->
  Clusters::Applications::ScheduleUpdateService calls -->
  ClusterUpdateAppWorker calls -->
  Clusters::Applications::PatchService -->
  ClusterWaitForAppInstallationWorker

DRY req params

Adds gcp_cluster:cluster_update_app queue

Schedule_update_service is uneeded

Extract common logic to a parent class (UpdateService will need it)

Introduce new UpdateService

Fix rescue class namespace

Fix RuboCop offenses

Adds BaseService for create and update services

Remove request_handler code duplication

Fixes update command

Move update_command to ApplicationCore so all apps can use it

Adds tests for Knative update_command

Adds specs for PatchService

Raise error if update receives an unistalled app

Adds update_service spec

Fix RuboCop offense

Use subject in favor of go

Adds update endpoint specs for project namespace

Adds update endpoint specs for group namespace
2019-03-05 08:32:51 +02:00
Yorick Peterse 59db98a0ca
Merge dev master into GitLab.com master 2019-03-04 19:44:46 +01:00
Yorick Peterse b50ad88460 Merge branch '2802-security-add-public-internal-groups-as-members-to-your-project-idor' into 'master'
Add public/internal groups as members to your Project(IDOR)

See merge request gitlab/gitlabhq!2898
2019-03-04 18:36:52 +00:00
Yorick Peterse d21a6a4588 Merge branch 'security-issue_54789_2' into 'master'
[master] Prevent disclosing project milestone titles

Closes #2794

See merge request gitlab/gitlabhq!2965
2019-03-04 18:36:30 +00:00
Reuben Pereira 43e713eb41 Refactor model and spec
- Move some specs into contexts
- Let get_slugs method take a parameter and return a specific slug.
- Add rescues when using Addressable::URI.
2019-03-01 14:51:54 +00:00
Vladimir Shushlin 25c10abb80 Add name_without_type to environments.json
It's needed to show shorter names in environments "folders"
2019-02-26 19:13:09 +00:00
Nick Thomas 0b0a04fdf7 Merge branch 'zj-load-languages-from-database' into 'master'
Load repository language from the DB if detected

Closes #47390

See merge request gitlab-org/gitlab-ce!25518
2019-02-25 16:41:04 +00:00
Zeger-Jan van de Weg abe8cbe90b Load repository language from the DB if detected
The repository charts page used to detect the repository language for
each request that was made to the page. Given the detection is an
expensive operation and the same data is stored in the database the
database is now serving the request.

The same goes for an API endpoint that serves the languages.

When a repository is empty or non-existent the languages will always be
empty. And the language detection RPC isn't requested.

Closes: https://gitlab.com/gitlab-org/gitlab-ce/issues/47390
2019-02-25 15:15:16 +01:00
Felipe Artur 7e83acb8a2 Prevent disclosing project milestone titles
Prevent unauthorized users having access to milestone titles
through autocomplete endpoint.
2019-02-25 10:55:15 -03:00
Vladimir Shushlin ddfdd494f0 Allow maintainers to remove pages
Move remove_pages permission to maintainer
Fix before_action in pages controller to check `remove_pages`
permission
Add specs
2019-02-25 11:43:19 +00:00
Heinrich Lee Yu d03dee26b9 Refactor params for notes_actions
Removes unneeded params from permitted list

This also fixes commenting on commits with a hash starting with a large
number
2019-02-23 09:38:58 +08:00
Małgorzata Ksionek 211c4e5985 Change policy regarding group visibility 2019-02-20 11:08:13 +01:00
Robert Speicher c7787f44ff Merge branch 'ce-return-entity-type-for-project-autocomplete-sources-members' into 'master'
Add a type property to project autocomplete members

Closes #57771

See merge request gitlab-org/gitlab-ce!25296
2019-02-20 00:20:23 +00:00
Luke Bennett aa464800b8
Add type property to project autocomplete members 2019-02-18 16:58:28 +00:00
Rémy Coutable 45ce5ff7ea
Fix Projects::MergeRequests::DiffsController specs
These specs were flaky and only passing after a retry due to how
rspec-retry works.

1. The test with paths that don't exist was returning 200 on the first
  try, then 404 on the second, not because the paths don't exist, but
  because the MR IID didn't change, thus the MR couldn't be found.
  I decided to remove the test entirely since we don't seem to return
  404 for paths that don't exist.
2. The test with a user that cannot view the merge request was failing
  the first time because the project owner wasn't removed with
  `project.team.truncate`.
  Changing the `let(:user)` to `create(:user)` and calling
  `project.add_maintainer(user)` in the `before` block fix the test.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-18 12:13:08 +01:00
Vladimir Shushlin 13d2d1985c Fix access to pages domain settings 2019-02-12 12:18:17 +00:00
Reuben Pereira e5c58b44ca Add list_projects endpoint to error tracking 2019-02-06 16:27:18 +00:00
Luke Duncalfe 2b7dd017af Allow custom squash commit messages 2019-02-06 12:33:11 +00:00
Shinya Maeda e8d9df83a6 Inroduce Internal API for searching environment names
Add changelog

Rename word to query

User hash for limit

Do not allow control limit

Rename pluck names and add more specs
2019-02-06 18:14:18 +09:00
Sean McGivern f04910f254 Merge branch 'sh-encode-content-disposition' into 'master'
Encode Content-Disposition filenames

Closes #47673

See merge request gitlab-org/gitlab-ce!24919
2019-02-05 13:36:43 +00:00
Daniel Juarez 72b59d6e3b Fix comparing equality between `ActionController::Parameters` and a `Hash`.... 2019-02-05 12:30:06 +00:00
Stan Hu 41b51c0656 Encode Content-Disposition filenames
Users downloading non-ASCII attachments would see garbled characters.
When used with object storage, AWS S3 would return an InvalidArgument
error: Header value cannot be represented using ISO-8859-1.

Per RFC 5987 and RFC 6266, Content-Disposition should be encoded
properly. This commit takes the Rails 6 implementation of
ActiveSuppport::Http::ContentDisposition
(https://github.com/rails/rails/pull/33829) and ports it here.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47673
2019-02-04 23:12:44 -08:00
Sean McGivern 70b92fb380 Merge branch '19745-forms-with-task-lists-can-be-overwritten-when-editing-simultaneously' into 'master'
Forms with task lists can be overwritten when editing simultaneously

See merge request gitlab-org/gitlab-ce!23938
2019-02-04 08:52:22 +00:00
Kamil Trzciński d4c7214799
[master] Pipelines section is available to unauthorized users 2019-01-31 16:52:50 +01:00
Heinrich Lee Yu 65eb988dae
Use common error for unauthenticated users
Removes special error message when creating new issues
2019-01-31 16:51:17 +01:00
Grzegorz Bizon 6429dc943d Merge branch 'fix/49388' into 'master'
Fix metrics graphs environments dropdown

Closes #49388

See merge request gitlab-org/gitlab-ce!24441
2019-01-31 09:25:48 +00:00
Brett Walker 968e35a692
Specs for caching and issue controller changes 2019-01-30 23:18:17 +01:00
Andrew Newdigate ff0b2cc61f Re-enable MethodCallWithoutArgsParentheses Cop
Re-enables and autocorrects all instances of the
Style/MethodCallWithoutArgsParentheses rule
2019-01-29 21:05:30 +02:00
Mario de la Ossa 49c74068ae
Save sorting preference for Issues/MRs in BE
In order to let users' sorting preferences transfer between devices, we
save the preference for issues and MRs (one preference for issues, one
for MRs) in the backend inside the UserPreference object
2019-01-28 12:48:05 -06:00
Grzegorz Bizon dc6091876d Merge branch 'container-repository-cleanup-api' into 'master'
Container repository cleanup API

Closes #55978

See merge request gitlab-org/gitlab-ce!24303
2019-01-25 13:24:35 +00:00
Sean McGivern dfa31d5f2f Merge branch '54905-milestone-search' into 'master'
Resolve "Milestone search"

Closes #54905

See merge request gitlab-org/gitlab-ce!24265
2019-01-25 13:22:34 +00:00
Kamil Trzciński 045d07bab3 Add Container Registry API
This includes a set of APIs to manipulate container registry.
This includes also an ability to delete tags based on requested
criteria, like keep-last-n, matching-name, older-than.
2019-01-25 13:13:48 +01:00