Commit Graph

5190 Commits

Author SHA1 Message Date
Kamil Trzciński a343484bdf Merge branch 'zj-sort-templates' into 'master'
Sort templates when fetching them

Closes #37153

See merge request !13920
2017-09-04 08:18:41 +00:00
Zeger-Jan van de Weg a315e6025c
Merge branch 'master' into zj-auto-devops-table 2017-09-04 09:28:46 +02:00
Zeger-Jan van de Weg 78dad4cf32
Fix tests 2017-09-04 09:27:09 +02:00
Bob Van Landuyt 7199e882db Only require `simple_po_parser` in rake task that needs it
That way we don't need to install it in production, since it's really
not needed there.
2017-09-04 08:30:10 +02:00
Shinya Maeda bbe967abeb Add the rest of specs 2017-09-03 23:49:10 +09:00
Shinya Maeda eda34b1a18 Add spec. Fix runner setting page. It worked. 2017-09-03 23:49:10 +09:00
Shinya Maeda e1ef436d1f Update application code by the db schema change 2017-09-03 23:49:10 +09:00
Robert Speicher 223849fa17 Merge branch '17849-allow-admin-to-restrict-min-key-length-and-techno' into 'master'
Add settings for minimum key strength and allowed key type

Closes #17849

See merge request !13712
2017-09-01 19:23:08 +00:00
Douwe Maan dceb2112d2 Merge branch 'bvl-validate-po-files' into 'master'
Validate PO files in static analysis

See merge request !13000
2017-09-01 14:30:43 +00:00
Jacob Vosmaer 6cdaa27a53 Move GitOperationService to Gitlab::Git 2017-09-01 14:37:56 +02:00
Jacob Vosmaer (GitLab) 0187018e48 Simplify Git interactions in AfterImportService 2017-09-01 12:01:50 +00:00
Douwe Maan 7d3e888d06 Merge branch '37202-revert-changes-to-signing-enabled' into 'master'
Rollback changes made to signing_enabled.

Closes #37202

See merge request !13956
2017-09-01 11:49:22 +00:00
Bob Van Landuyt 4761235f69 Validate unescaped `%` chars in PO files 2017-09-01 13:44:10 +02:00
Grzegorz Bizon fc4fb6e4d2 Change CI/CD kubernetes policy keyword to `active` 2017-09-01 13:04:08 +02:00
Tiago Botelho 37383d9a9d Rollsback changes made to signing_enabled. 2017-09-01 10:51:40 +01:00
Jacob Vosmaer 254f5ab62b Add Gitlab::Git::Repository#== 2017-09-01 11:40:07 +02:00
Jacob Vosmaer (GitLab) 35acc4cbbe Make Gitaly PostUploadPack mandatory 2017-09-01 08:45:19 +00:00
Dmitriy Zaporozhets 6f96ccaa7d Merge branch 'gitaly-shell-redis' into 'master'
Implement /internal/post_receive unified endpoint for PostReceive tasks

See merge request !13916
2017-09-01 06:49:28 +00:00
Zeger-Jan van de Weg 770bcf71bb
Form for setting project auto devops settings 2017-08-31 22:25:26 +02:00
Bob Van Landuyt 538104bdd1 Fetch all translation keys using a regex 2017-08-31 21:13:02 +02:00
Bob Van Landuyt abe198723d Take `nplurals` into account when validating translations. 2017-08-31 21:13:02 +02:00
Bob Van Landuyt 2c4f9b7a73 Check for newlines in different methods on TranslationEntry 2017-08-31 21:13:02 +02:00
Bob Van Landuyt f35a5d0d99 Split translation & metadata entries into classes 2017-08-31 21:13:01 +02:00
Bob Van Landuyt c6d969949e Validate the number of plurals in an entry 2017-08-31 21:13:01 +02:00
Bob Van Landuyt cdaf1072da Move detailed information of an entry into a separate class 2017-08-31 21:13:01 +02:00
Bob Van Landuyt 0fa0ed7d85 Move `PoLinter` into `Gitlab::I18n` 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 49b3819477 Only perform `join_message` in `validate_variable_usage` 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 1da594d39b Check newlines in translations 2017-08-31 21:13:00 +02:00
Bob Van Landuyt 973c697960 Add spec for languages without plurals 2017-08-31 21:13:00 +02:00
Douwe Maan 52ac5cf27c Merge branch '37266-nomethoderror-undefined-method-current_application_settings-build-failed-30837482' into 'master'
`current_application_settings` belongs on `Gitlab::CurrentSettings`

Closes #37266

See merge request !13955
2017-08-31 14:55:54 +00:00
Alejandro Rodríguez eaf60bb544 Implement /internal/post_receive unified endpoint for PostReceive tasks 2017-08-31 11:31:45 -03:00
Zeger-Jan van de Weg ed8f7ed671
Sort templates when fetching them
Used to rely on the underlying filesystem to sort the entries, now its
forced to be sorted on the name of the template.
2017-08-31 15:45:48 +02:00
Jacob Vosmaer 8ad690b0d4 Prepare GitOperationService for move to Gitlab::Git 2017-08-31 15:35:59 +02:00
Grzegorz Bizon ef030709eb Change kubernetes job policy allowed values
It is now possible to use `kubernetes: configured`.
2017-08-31 14:56:25 +02:00
Sean McGivern 5883ce95ef `current_application_settings` belongs on `Gitlab::CurrentSettings`
The initializers including this were doing so at the top level, so every object
loaded after them had a `current_application_settings` method. However, if
someone had rack-attack enabled (which was loaded before these initializers), it
would try to load the API, and fail, because `Gitlab::CurrentSettings` didn't
have that method.

To fix this:

1. Don't include `Gitlab::CurrentSettings` at the top level. We do not need
   `Object.new.current_application_settings` to work.
2. Make `Gitlab::CurrentSettings` explicitly `extend self`, as we already use it
   like that in several places.
3. Change the initializers to use that new form.
2017-08-31 13:38:33 +01:00
Bob Van Landuyt bde39322f1 Add a linter for PO files 2017-08-31 14:10:04 +02:00
Bob Van Landuyt b6646e778d Track the locale in Sentry so we know which ones are failing 2017-08-31 14:10:04 +02:00
Grzegorz Bizon 92673c2c63 Merge branch 'master' into feature/gb/kubernetes-only-pipeline-jobs
* master: (275 commits)
  Decrease Metrics/PerceivedComplexity threshold to 17
  Upgrade mail and nokogiri gems due to security issues
  Link out to stackoverflow answer on setting swappiness
  Document swappiness recomendations in the requirements doc
  Fix invalid attribute used for time-ago-tooltip component
  Update latest artifacts doc
  Add changelog entry for flipping verify_certificates
  Default LDAP config verify_certificates to true
  Update share project with groups docs
  remove accidental console.log from karma tests
  update specs to match reorganized monitoring components
  Remove tooltips from new sidebar
  Use `git update-ref --stdin -z` to delete refs
  Don't use public_send in destroy_conditionally! helper
  Remove unused expressions policy from ci/cd config
  Simplify code for appending strategies in CI/CD config
  Raise exception when simplifiable ci entry incomplete
  Add changelog entry
  Fix MySQL failure for emoji autocomplete
  max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably)
  ...

Conflicts:
	lib/gitlab/ci/config/entry/policy.rb
2017-08-31 14:02:52 +02:00
Sean McGivern 91a55ed6a1 Merge branch 'gitaly-440-shell-fetch-remote' into 'master'
Migrate Repository.FetchRemote to Gitaly

See merge request !13625
2017-08-31 11:08:45 +00:00
Kamil Trzciński a0b5684634 Merge branch 'feature/gb/add-complex-jobs-only-except-config-policy' into 'master'
New syntax for CI/CD job triggering policy that supports variables expressions

See merge request !13769
2017-08-31 07:24:57 +00:00
Nick Thomas b84ca08e35 Address review comments 2017-08-30 20:50:44 +01:00
Nick Thomas 6847060266 Rework the permissions model for SSH key restrictions
`allowed_key_types` is removed and the `minimum_<type>_bits` fields are
renamed to `<tech>_key_restriction`. A special sentinel value (`-1`) signifies
that the key type is disabled.

This also feeds through to the UI - checkboxes per key type are out, inline
selection of "forbidden" and "allowed" (i.e., no restrictions) are in.

As with the previous model, unknown key types are disallowed, even if the
underlying ssh daemon happens to support them. The defaults have also been
changed from the lowest known bit size to "no restriction". So if someone
does happen to have a 768-bit RSA key, it will continue to work on upgrade, at
least until the administrator restricts them.
2017-08-30 20:50:44 +01:00
Nick Thomas b0f982fbdf Add settings for minimum key strength and allowed key type
This is an amalgamation of:

* Cory Hinshaw: Initial implementation !5552
* Rémy Coutable: Updates !9350
* Nick Thomas: Resolve conflicts and add ED25519 support !13712
2017-08-30 20:50:44 +01:00
Kim "BKC" Carlbäcker b77176d11a Migrate Repository.FetchRemote to Gitaly
- `Gitlab::Shell.fetch_remote` now takes a `Gitlab::Git::Repository` instead
2017-08-30 20:51:56 +02:00
Hiroyuki Sato 59e5393827 Fuzzy search issuable title or description 2017-08-31 03:14:58 +09:00
Douwe Maan d6e956d3a8 Merge branch '36807-gc-unwanted-refs-after-import' into 'master'
Remove unwanted refs after importing a project

Closes #36807

See merge request !13766
2017-08-30 18:08:37 +00:00
Douwe Maan e68a1fc1be Merge branch 'check-trigger-permissions-mysql' into 'master'
Improve migrations using triggers

Closes #36633

See merge request !13666
2017-08-30 17:55:15 +00:00
Lin Jen-Shin c5553ce772 Use `git update-ref --stdin -z` to delete refs 2017-08-30 22:01:23 +08:00
Lin Jen-Shin 86149a8216 Merge remote-tracking branch 'upstream/master' into 36807-gc-unwanted-refs-after-import
* upstream/master: (225 commits)
  Add changelog entry
  Backports EE 2756 logic to CE.
  Make rubocop happy
  Make profile settings dropdown consistent
  Add filter by my reaction
  Update spec initialization with it being a shared component
  Update identicon path and selector
  Renamed to `identicon` and make shared component
  Merge branch 'master-i18n' into 'master'
  Fix broken Frontend JS guide
  Replace 'project/star.feature' spinach test with an rspec analog
  Adds position fixed to right sidebar
  Fixes the margin of the top buttons of the pipeline page
  Remove commented out code
  Better align fallback image emojis
  Decrease Metrics/CyclomaticComplexity threshold to 15
  Add changelog
  Respect the default visibility level when creating a group
  Further break with_repo_branch_commit into parts
  Make sure inspect doesn't generate crazy string
  ...
2017-08-30 21:13:19 +08:00
Grzegorz Bizon 1bf87d2524 Remove unused expressions policy from ci/cd config 2017-08-30 14:47:54 +02:00
Grzegorz Bizon 3474e109b7 Simplify code for appending strategies in CI/CD config 2017-08-30 13:27:48 +02:00
Grzegorz Bizon 808fb2549b Raise exception when simplifiable ci entry incomplete 2017-08-30 13:26:11 +02:00
Yorick Peterse 8274e0fe3c Merge branch 'improve-autocomplete-user-performance' into 'master'
Improve AutocompleteController#users.json performance

Closes #36879

See merge request !13754
2017-08-30 11:17:10 +00:00
Yorick Peterse 5eab624d3c
Improve migrations using triggers
This adds a bunch of checks to migrations that may create or drop
triggers. Dropping triggers/functions is done using "IF EXISTS" so we
don't throw an error if the object in question has already been dropped.
We now also raise a custom error (message) when the user does not have
TRIGGER privileges. This should prevent the schema from entering an
inconsistent state while also providing the user with enough information
on how to solve the problem.

The recommendation of using SUPERUSER permissions is a bit extreme but
we require this anyway (Omnibus also configures users with this
permission).

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
2017-08-29 13:02:44 +02:00
Hiroyuki Sato 12633b46b6 Refactor 2017-08-29 18:00:03 +09:00
Lin Jen-Shin 9954dafda5 Just use a block 2017-08-29 16:23:12 +08:00
Maxim Rydkin 10ae0d8316 replace `is_ancestor` with `ancestor?` 2017-08-29 11:14:42 +03:00
Maxim Rydkin e6c7c11a5b replace `has_matching_label` with `has_matching_label?` 2017-08-29 11:14:42 +03:00
Maxim Rydkin 622c912d5b replace `is_successful?` with `successful?` 2017-08-29 11:14:42 +03:00
Maxim Rydkin 87467127b6 replace `is_ancestor?` with `ancestor?` 2017-08-29 11:14:41 +03:00
Hiroyuki Sato 87b51c5981 Move the logic to a concern 2017-08-29 07:14:41 +09:00
James Lopez eef5135e08 Fix events error importing GitLab projects 2017-08-28 15:24:24 +02:00
Douwe Maan 073811074b Merge branch 'sh-simplify-system-hook-testing' into 'master'
Simplify system hook testing and guarantee test will fire

Closes #37067

See merge request !13858
2017-08-28 10:38:52 +00:00
Stan Hu 1e53f40c25 Simplify system hook testing and guarantee test will fire
The change in !11728 would cause an arbitrary project to be chosen to test
system hooks, and it's likely that the project would not have any commits or
relevant commits to test the hook. This would prevent admins from verifying
that the hook fired. Instead of trying to create a representative hook
dynamically, just send static data to guarantee the hook will actually be
tested.

Closes #37067
2017-08-27 15:50:20 -07:00
Hiroyuki Sato 866aab7f2a Fix escape characters was not sanitized 2017-08-26 22:32:55 +09:00
Grzegorz Bizon 326dc7da3b Check if kubernetes required before creating a job 2017-08-26 12:45:36 +02:00
Grzegorz Bizon 5ce9e03f6c Use new complex only/except policy internal scheme 2017-08-26 11:11:28 +02:00
Grzegorz Bizon 0410861171 Add specs for attributable aspect of ci config entry 2017-08-25 18:26:55 +02:00
Lin Jen-Shin d1054bd3dd Resolve feedback on the MR:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13766

* Rename AfterImportService
* Use constants
* Move Git operations to Gitlab::Git::Repository
* Use Regexp.union
2017-08-25 22:38:07 +08:00
Grzegorz Bizon 7e6bc4dde2 Improve reporting of a CI/CD entry config location 2017-08-25 15:16:09 +02:00
Kamil Trzciński a653c8ead4 Merge branch 'master' into 'backstage/gb/rename-ci-cd-processing-sidekiq-queues'
# Conflicts:
#   db/schema.rb
2017-08-25 12:10:53 +00:00
Grzegorz Bizon 99dddac558 Simplify ci config entry validator implementation 2017-08-25 13:00:45 +02:00
Sean McGivern 4a2cc38197 Merge branch '36939-fix-find-blobs-by-path' into 'master'
Fix searching for files by path

Closes #36939

See merge request !13798
2017-08-25 10:26:12 +00:00
Grzegorz Bizon 946e8d3a93 Use only/except policy that returns an array 2017-08-25 12:01:59 +02:00
Grzegorz Bizon a061a2461a Fix CI/CD trigger policy default value 2017-08-25 11:42:40 +02:00
Hiroyuki Sato 9e203582b3 Improve AutocompleteController#user.json performance 2017-08-25 18:41:43 +09:00
Nick Thomas fa2915ec2d Fix searching for files by path 2017-08-25 10:36:32 +01:00
Grzegorz Bizon fcb4d1f809 Implement complex only/except policy CI/CD config 2017-08-25 10:27:00 +02:00
Grzegorz Bizon 8c409fc40b Make it possible to define CI/CD config strategies 2017-08-25 09:49:18 +02:00
Sean McGivern e46a3d2fda Merge branch 'git-operation-user' into 'master'
Move GitHooksService into Gitlab::Git

See merge request !13739
2017-08-24 14:32:17 +00:00
Grzegorz Bizon 0d7d7c1057 Use aspect-oriented design in CI/CD config entries 2017-08-24 14:54:27 +02:00
Douwe Maan 610155e063 Merge branch 'fix-old-mr-diffs' into 'master'
Fix old MR diffs

Closes #36516

See merge request !13744
2017-08-24 10:56:57 +00:00
Grzegorz Bizon 5ced2d8d7d Rename CI/CD job triggering policy class to Policy 2017-08-24 12:22:01 +02:00
Sean McGivern e8525e107d Show un-highlighted diffs when blobs are the same
For some old merge requests, we don't have enough information to figure out the
old blob and the new blob for the file. This means that we can't highlight the
diff correctly, but we can still display it without highlighting.
2017-08-24 11:11:18 +01:00
Andrew Newdigate fb49c94e49 Delegate Repository::branch_exists? and ref_exists? to Gitlab::Git 2017-08-24 09:20:04 +00:00
Douwe Maan 93ad83443a Merge branch 'sh-fix-branch-count' into 'master'
Fix inconsistent number of branches when remote branches are present

Closes #36934

See merge request !13784
2017-08-24 07:42:30 +00:00
Stan Hu 37904108b9 Fix inconsistent number of branches when remote branches are present
Users of project mirrors would see that the number of branches did not
match the number in the branch dropdown because remote branches were
counted when Rugged was in use. With Gitaly, only local branches
are counted.

Closes #36934
2017-08-23 22:07:32 -07:00
Robert Speicher cdf87fe890 Merge branch 'dm-ldap-adapter-attributes' into 'master'
Support simple string LDAP attribute specifications, and search for name rather…

Closes #36841

See merge request !13776
2017-08-23 21:42:29 +00:00
Douwe Maan c1cf5f4101 Support simple string LDAP attribute specifications, and search for name rather than username attributes 2017-08-23 22:06:22 +02:00
Robert Speicher 2b906219a0 Merge branch 'fix/gitlay-raw-blame-request-encoding' into 'master'
Properly encode Gitaly RawBlame request params

See merge request !13764
2017-08-23 15:51:22 +00:00
Sean McGivern 9ec60b5030 Merge branch 'bvl-improve-bare-project-import' into 'master'
Make the import take subgroups into account

Closes #36664 and #30546

See merge request !13670
2017-08-23 14:04:22 +00:00
Ahmad Sherif 9240d3552a Properly encode Gitaly RawBlame request params 2017-08-23 13:44:54 +02:00
Bob Van Landuyt 22ef4ba3a4 Migrate creation of nested groups into a service 2017-08-23 13:36:38 +02:00
Bob Van Landuyt d8d2b73b9f Improve bare repository import
- Allow imports into nested groups
- Make sure it sets the correct visibility level when creating new
  groups

While doing this, I moved the import into a testable class, that made
it easier to improve.
2017-08-23 13:36:37 +02:00
Sean McGivern d546f7d36e Merge branch 'gitaly-commit-patch' into 'master'
Incorporate DiffService.CommitPatch Gitaly RPC

Closes gitaly#463

See merge request !13441
2017-08-23 10:39:01 +00:00
Jacob Vosmaer da769135fe Rubocop whitespace 2017-08-23 10:45:20 +02:00
Jacob Vosmaer dc7c6bede2 Move GitHooksService to Gitlab::Git 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 65f83941c3 Make gl_repository a G::G::Repository attribute 2017-08-23 10:45:20 +02:00
Jacob Vosmaer 9b93093292 Decouple GitOperationService from User 2017-08-23 10:45:20 +02:00
Grzegorz Bizon faf92651aa Fix invalid default argument in migration helpers 2017-08-23 08:58:55 +02:00
Robert Speicher 4598e0c392 Fix a potential timeout in `Gitlab::Logger.read_latest`
If this method was called for a file that didn't exist, we attempted to
first `build` it. But if the file wasn't writeable, such as a symlink
pointing to an unmounted filesystem, the method would just hang and
eventually timeout.

Further, this was entirely pointless since we were creating a file and
then shelling out to `tail`, eventually returning an empty Array. Now we
just skip building it and return the empty Array straight away.
2017-08-22 17:09:45 -04:00
Alejandro Rodríguez 258d5a50e6 Incorporate DiffService.CommitPatch Gitaly RPC 2017-08-22 16:31:59 -03:00
Kamil Trzciński 080a359e0c Merge branch 'fix/sm/34762-bad-validation-message' into 'master'
Enforce namespace of Kubernetes to lowercase

Closes #34762

See merge request !13732
2017-08-22 16:38:07 +00:00
Sean McGivern b0f09406f5 Always return a simple diff viewer
We didn't have a fallback case before, because we believed the conditions were
exhaustive. They weren't, so we can always fallback to not previewing.
2017-08-22 14:04:54 +01:00
Grzegorz Bizon 2e91f18143 Merge branch 'master' into backstage/gb/rename-ci-cd-processing-sidekiq-queues
* master: (115 commits)
  Use event-based waiting in Gitlab::JobWaiter
  Make sure repository's removal work for legacy and hashed storages
  Use `@hashed` prefix for hashed paths on disk, to avoid collision with existing ones
  Refactor project and storage types
  Prevent using gitlab import task when hashed storage is enabled
  Some codestyle changes and fixes for GitLab pages
  Removed some useless code, codestyle changes and removed an index
  Fix repository reloading in some specs
  Changelog
  Moving away from the "extend" based factory to a more traditional one.
  Enable automatic hashed storage for new projects by application settings
  New storage is now "Hashed" instead of "UUID"
  Add UUID Storage to Project
  Move create_repository back to project model as we can use disk_path and share it
  Codestyle: move hooks to the same place and move dependent methods to private
  Use non-i18n values for setting new group-level issue/MR button text
  indexes external issue tracker
  copyedit
  indexes user/search/ from /user/index
  Correctly encode string params for Gitaly's TreeEntries RPC
  ...
2017-08-22 14:58:10 +02:00
Sean McGivern ce89c425fe Merge branch 'fix/import-fork-mr' into 'master'
Fix Import/Export issue to do with fork merge requests

Closes #36666

See merge request !13717
2017-08-22 11:57:06 +00:00
Douwe Maan 78a0d27e98 Merge branch '34533-inline-single-authorized-projects' into 'master'
Use an event-based system when waiting for AuthorizedProjectsWorker to complete

See merge request !13564
2017-08-22 11:05:14 +00:00
Grzegorz Bizon 193b199672 Add Sidekiq migration helpers for migrating queues 2017-08-22 12:47:20 +02:00
Nick Thomas 6e8d0b78eb Use event-based waiting in Gitlab::JobWaiter 2017-08-22 09:54:46 +01:00
Shinya Maeda fe9fc0af75 Enfouce namespace for Kubernetes to lowercase 2017-08-22 15:12:27 +09:00
Gabriel Mazetto 9e6fa996ea New storage is now "Hashed" instead of "UUID" 2017-08-22 06:33:20 +02:00
Robert Speicher 539ed0a637 Merge branch 'gitaly-tree-entries-encoding' into 'master'
Correctly encode string params for Gitaly's TreeEntries RPC

Closes #36720

See merge request !13724
2017-08-21 22:22:37 +00:00
Robin Bobbitt 62ef67acc3 Hide read_registry scope when registry is disabled on instance 2017-08-21 18:13:32 -04:00
Robert Speicher 367d3d9704 Merge branch 'only-limit-fetch-when-requested' into 'master'
Only require sidekiq-limit_fetch when enabled in settings

Closes #36253

See merge request !13715
2017-08-21 19:26:12 +00:00
Alejandro Rodríguez b7ebb447d7 Correctly encode string params for Gitaly's TreeEntries RPC 2017-08-21 15:13:40 -03:00
James Lopez fb9bd552c9 Fix fork MRs importing issue 2017-08-21 16:39:28 +02:00
Sean McGivern 0db5f576fe Only require sidekiq-limit_fetch when enabled in settings
This gem allows Sidekiq jobs to be throttled. Unfortunately, it has a
side-effect: when we haven't enabled job throttling, it will still hit Redis a
lot (and miss, because nothing is configured).

As this setting already required a restart, ensure that the library is only
required when it's enabled.
2017-08-21 12:56:22 +01:00
Kamil Trzciński e00e62c2c8 Merge branch 'backstage/gb/migrate-stages-statuses' into 'master'
Migrate CI/CD stages statuses

Closes #33453

See merge request !12584
2017-08-21 11:47:44 +00:00
Douwe Maan d6547ce0e7 Merge branch 'gitaly-annotations-update' into 'master'
Gitlab::Git deletions and simplifications

See merge request !13640
2017-08-21 11:45:35 +00:00
Douwe Maan 2166f9f548 Merge branch 'rs-git-access-spec-speed' into 'master'
Greatly reduce test duration for git_access_spec

See merge request !13675
2017-08-21 08:46:52 +00:00
Stan Hu 718ecd4eb5 Fix Error 500s when attempting to destroy a protected tag
Due to a missing `on_delete: :cascade`, users would hit the error that
looked like:

```
PG::ForeignKeyViolation: ERROR: update or delete on table "protected_tags"
violates foreign key constraint "fk_rails_f7dfda8c51" on table
"protected_tag_create_access_levels" DETAIL: Key (id)=(1385) is still
referenced from table "protected_tag_create_access_levels". : DELETE FROM
"protected_tags" WHERE "protected_tags"."id" = 1385
```

Closes #36013
2017-08-20 03:32:31 -07:00
Robert Speicher 5b37f21bf2 Reduce duplication in GitAccess spec around error messages
- Adds a new `ProjectMovedError` class to encapsulate that error
  condition. Inherits from `NotFoundError` so existing rescues should
  continue to work.
- Separating that condition out of `NotFoundError` allowed us to
  simplify the `raise_not_found` helper and avoid repeating the literal
  string.
- Spec makes use of `ERROR_MESSAGES` hash to avoid repeating literal
  error message strings.
2017-08-18 15:16:54 -04:00
Jacob Vosmaer 3049dfaf48 Simplify return values 2017-08-18 16:03:27 +02:00
Jacob Vosmaer df7f2b135a Simplify method arguments 2017-08-18 15:59:17 +02:00
Jacob Vosmaer a902166475 More annotations 2017-08-18 15:55:30 +02:00
Jacob Vosmaer faaed0aa1f Delete unused Gitlab::Git methods 2017-08-18 14:12:17 +02:00
Jacob Vosmaer 66afd1ee1c Add Gitaly annotation 2017-08-18 14:07:51 +02:00
Sean McGivern 34a859ee2a Fix MR diffs background migration when file modes are missing
Guess the modes based on the following:

1. If the file didn't exist, it's zero.
2. If the diff contains 'Subproject commit', it might be a submodule, so 0600.
3. Otherwise, it's 0644.

This isn't perfect, but it doesn't have to be - it won't change file modes in
the repository.
2017-08-18 13:02:30 +01:00
Sean McGivern 133c72ae42 Merge branch 'gitaly_ref_exists' into 'master'
Client Implementation: RefService::RefExists

Closes gitaly#452

See merge request !13528
2017-08-18 10:20:50 +00:00
Douwe Maan cc543b6c85 Merge branch '36041-notification-title' into 'master'
Don't escape html entities in InlineDiffMarkdownMarker

Closes #36041

See merge request !13553
2017-08-18 08:50:59 +00:00
Andrew Newdigate aaa887feba Client Implementation: RefService::RefExists 2017-08-18 09:43:58 +01:00
Jarka Kadlecova c271fdc80f Don't escape html entities when rich == raw line 2017-08-17 19:55:07 +02:00
Alejandro Rodríguez c463a83405 Incorporate RepositoryService.ApplyGitattributes Gitaly RPC 2017-08-17 14:44:30 -03:00
Douwe Maan 91d3e6d901 Merge branch 'ee-2628-backport-to-ce' into 'master'
Backports EE mirror stuck handling feature…

See merge request !13627
2017-08-17 13:53:39 +00:00
Tiago Botelho f865b1b459 Backports EE mirror stuck handling feature (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2628) to CE 2017-08-17 13:38:05 +01:00
Jacob Vosmaer 40752ce7e9 Use grpc 1.4.5 2017-08-17 13:58:19 +02:00
Felipe Artur 91035871d3 Fix project import to group when there are project milestones 2017-08-17 10:40:19 +00:00
Robert Speicher ec34b2d051 Merge branch 'dm-gpg-signature-performance' into 'master'
Only create commit GPG signature when necessary

See merge request !13561
2017-08-16 18:34:55 +00:00
Douwe Maan ba7251fefd Only create commit GPG signature when necessary 2017-08-16 18:57:50 +02:00
Rémy Coutable fcce6c3168 Merge branch 'rs-more-public-send-whitelists' into 'master'
Whitelist or fix additional `Gitlab/PublicSend` cop violations

See merge request !13467
2017-08-16 11:25:26 +00:00
Grzegorz Bizon 32d0983a4e Merge branch 'master' into backstage/gb/migrate-stages-statuses
* master: (1000 commits)
  Fix username autocomplete group name with no avatar alignment
  Fix 'Projected tags' typo in protected_tags_spec.rb
  Many Repo Fixes
  Repo Editor Fixes
  Docs: New index for permissions
  link article from CI index
  link tech articles from the landing page
  new articles come first
  fix relative link
  fix date format
  Fixed changed files dropdown not being shown
  Update publication date
  Remove deprecated field from workhorse API responses
  Fix API responses when dealing with txt files
  Make sure MySQL would not use CURRENT_TIMESTAMP
  Add two more project templates
  Allow usage of any_projects? with an Array
  Copyedit Artifactory and GitLab article
  Rename Artifactory and GitLab article file
  Display GPG status loading spinner only when Ajax request is made
  ...
2017-08-16 13:18:03 +02:00
Rémy Coutable 7b68bdce15 Merge branch 'rs-trailingwhitespace-cop' into 'master'
Enable Layout/TrailingWhitespace cop and auto-correct offenses

See merge request !13573
2017-08-16 10:27:46 +00:00
Rémy Coutable 1b46a8360e Merge branch '34643-fix-project-path-slugify' into 'master'
Fix CI_PROJECT_PATH_SLUG slugify

Closes #34643

See merge request !13350
2017-08-16 10:10:24 +00:00
Douwe Maan 765b183168 Merge branch 'rs-redis-config-paths' into 'master'
Don't depend on `Rails` for Redis configuration file paths

Closes #36514

See merge request !13575
2017-08-16 09:54:06 +00:00
Douwe Maan e254014d3d Merge branch '34533-speed-up-project-creation' into 'master'
Speed up project creation by inlining repository creation

Closes #34533

See merge request !13529
2017-08-16 09:45:25 +00:00
Robert Speicher 142b9ec4a0 Fix two additional violations caused by previous changes 2017-08-15 15:53:16 -04:00
Robert Speicher f5cb3ac14d Don't depend on `Rails` for Redis configuration file paths
The `Rails` object was not always available in all tasks that require
Redis access, such as `mail_room`, so the constant pointing to the
configuration path was never defined, but we still attempted to access
it in `config_file_name`, resulting in a `NameError` exception.

Further, there was no benefit to defining these paths in a constant to
begin with -- they're only accessed in one place, and it was within the
class where they were being defined. We can just provide them at
run-time instead.

Further _still_, we were calling `File.expand_path` on the absolute path
returned by `Rails.root.join`, which was rather pointless.
2017-08-15 15:08:56 -04:00
Robert Speicher 4edfad9678 Enable Layout/TrailingWhitespace cop and auto-correct offenses 2017-08-15 13:44:37 -04:00
Nick Thomas 5fc871381a Speed up project creation by inlining repository creation 2017-08-15 18:33:07 +01:00
Douwe Maan 97b768508c Merge branch 'workhorse-deprecate-gitaly-address' into 'master'
Remove deprecated field from workhorse API responses

See merge request !13567
2017-08-15 15:56:02 +00:00
Jacob Vosmaer 4405c8e393 Remove deprecated field from workhorse API responses 2017-08-15 16:39:31 +02:00
Z.J. van de Weg 6391406774
Add two more project templates
Related to !13108. Mostly this is just running the rake task and
changing the task a bit to catch cases like the project already existing
or so. The rake task moves archives to the vendor/project_template
directory, which are checked in too.
2017-08-15 12:55:54 +02:00
Douwe Maan 0da644072f Merge branch 'malformed-submodule' into 'master'
Handle missing .gitmodules when getting submodule urls

See merge request !13509
2017-08-15 09:00:44 +00:00
vanadium23 e99444bb2d Fix CI_PROJECT_PATH_SLUG slugify 2017-08-15 08:22:56 +03:00
Robert Speicher 260c8da060 Whitelist or fix additional `Gitlab/PublicSend` cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00
Douwe Maan a64760d6d0 Merge branch 'gitaly-404-commit-list-files' into 'master'
Migrate `Git::Repository.ls_files` to Gitaly

Closes gitaly#404

See merge request !13302
2017-08-14 15:44:36 +00:00
Dmitriy Zaporozhets 725b383718 Merge branch 'fix/thread-safe-gpgme-tmp-directory' into 'master'
Fix: Thread safe GPGME tmp directory

Closes #35986

See merge request !13481
2017-08-14 13:38:43 +00:00
Alexis Reigel a175966677 reset original directory in ensure 2017-08-14 12:57:56 +02:00
Alexis Reigel edcc488b75 use mutex for keychain interaction
setting of the gpg home directory is not thread safe, as the directoy
gets stored on the class.

if multiple threads change the directory at the same time, one of the
threads will be working in the wrong directory.
2017-08-14 12:57:56 +02:00
Jacob Vosmaer d9b6fd4fba Handle missing .gitmodules when getting submodule urls 2017-08-14 10:53:02 +02:00
Douwe Maan 9419d10e86 Merge branch 'bvl-rollback-renamed-system-namespace' into 'master'
Don't rename system when migrating from 9.x -> 9.4

Closes #35525 and #36148

See merge request !13228
2017-08-14 07:39:52 +00:00
Robert Speicher f8fa7a050e Merge branch 'feature/migrate-force-push-check-to-gitaly' into 'master'
Migrate force push check to Gitaly

See merge request !13406
2017-08-11 20:43:25 +00:00
Ahmad Sherif daa0137b41 Migrate force push check to Gitaly 2017-08-11 19:42:17 +02:00
Bob Van Landuyt 2ea8442ff3 Move the personal snippet uploads from `system` to `-/system`
Update the markdown unconditionally since the move might have been
done before, but the markdown not updated.
2017-08-11 18:17:45 +02:00
Robert Speicher d0622b79d8 Better categorize test coverage results
Also marks a few things as uncovered, and removes an unused class.
2017-08-11 10:59:11 -04:00
Sean McGivern e80a893ff0 Merge branch 'split-events-into-push-events' into 'master'
Use a separate table for storing push events

See merge request !12463
2017-08-11 14:40:03 +00:00
Sean McGivern d2315054e6 Fix merge request diff deserialisation when too_large was absent
Not all diffs in st_diffs had the too_large attribute set at all, but the column
is non-nullable. Explicitly cast to boolean to avoid that problem.
2017-08-11 11:58:36 +01:00
Sean McGivern 2f35428c72 Merge branch 'gitlab-git-expose-raw-log' into 'master'
Expose the raw_log method

See merge request !13434
2017-08-11 10:11:01 +00:00
Alexis Reigel 6cd9888f6f store gpg return directory locally 2017-08-11 08:38:42 +02:00
James Edwards-Jones b296921681 Merge branch 'rs-alphanumeric-ssh-params' into 'security-9-4'
Ensure user and hostnames begin with an alnum character in UrlBlocker

See merge request !2138
2017-08-10 20:47:28 +01:00
James Edwards-Jones 334915d508 Merge branch 'import-symlinks-9-3' into 'security-9-3'
Fix file disclosure via hidden symlinks using the project import (9.3)

See merge request !2164
2017-08-10 20:42:01 +01:00
Yorick Peterse aac1de46c9
Use a specialized class for querying events
This changes various controllers to use the new EventCollection class
for retrieving events. This class uses a JOIN LATERAL query on
PostgreSQL to retrieve queries in a more efficient way, while falling
back to a simpler / less efficient query for MySQL.

The EventCollection class also includes a limit on the number of events
to display to prevent malicious users from cycling through all events,
as doing so could put a lot of pressure on the database.

JOIN LATERAL is only supported on PostgreSQL starting with version 9.3.0
and as such this optimisation is only used when using PostgreSQL 9.3 or
newer.
2017-08-10 17:45:49 +02:00
Yorick Peterse 0395c47193
Migrate events into a new format
This commit migrates events data in such a way that push events are
stored much more efficiently. This is done by creating a shadow table
called "events_for_migration", and a table called "push_event_payloads"
which is used for storing push data of push events. The background
migration in this commit will copy events from the "events" table into
the "events_for_migration" table, push events in will also have a row
created in "push_event_payloads".

This approach allows us to reclaim space in the next release by simply
swapping the "events" and "events_for_migration" tables, then dropping
the old events (now "events_for_migration") table.

The new table structure is also optimised for storage space, and does
not include the unused "title" column nor the "data" column (since this
data is moved to "push_event_payloads").

== Newly Created Events

Newly created events are inserted into both "events" and
"events_for_migration", both using the exact same primary key value. The
table "push_event_payloads" in turn has a foreign key to the _shadow_
table. This removes the need for recreating and validating the foreign
key after swapping the tables. Since the shadow table also has a foreign
key to "projects.id" we also don't have to worry about orphaned rows.

This approach however does require some additional storage as we're
duplicating a portion of the events data for at least 1 release. The
exact amount is hard to estimate, but for GitLab.com this is expected to
be between 10 and 20 GB at most. The background migration in this commit
deliberately does _not_ update the "events" table as doing so would put
a lot of pressure on PostgreSQL's auto vacuuming system.

== Supporting Both Old And New Events

Application code has also been adjusted to support push events using
both the old and new data formats. This is done by creating a PushEvent
class which extends the regular Event class. Using Rails' Single Table
Inheritance system we can ensure the right class is used for the right
data, which in this case is based on the value of `events.action`. To
support displaying old and new data at the same time the PushEvent class
re-defines a few methods of the Event class, falling back to their
original implementations for push events in the old format.

Once all existing events have been migrated the various push event
related methods can be removed from the Event model, and the calls to
`super` can be removed from the methods in the PushEvent model.

The UI and event atom feed have also been slightly changed to better
handle this new setup, fortunately only a few changes were necessary to
make this work.

== API Changes

The API only displays push data of events in the new format. Supporting
both formats in the API is a bit more difficult compared to the UI.
Since the old push data was not really well documented (apart from one
example that used an incorrect "action" nmae) I decided that supporting
both was not worth the effort, especially since events will be migrated
in a few days _and_ new events are created in the correct format.
2017-08-10 17:45:44 +02:00
Kim "BKC" Carlbäcker 7b10885046 Migrate Git::Repository.ls_files to Gitaly 2017-08-10 16:10:47 +02:00
Jacob Vosmaer 11eda5c255 Rename RPC 'Exists' to 'RepositoryExists' 2017-08-09 18:12:29 +02:00
Rémy Coutable 04c328f923 Fix ee_compat_check when EE branch uses a prefix
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 16:49:44 +02:00
Jacob Vosmaer b21539cc57 Expose the raw_log method 2017-08-09 15:37:05 +02:00
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Brian Neel 9770c57fab Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04:00
Dmitriy Zaporozhets 1439115183 Merge branch 'gitaly-find-commit' into 'master'
Incorporate Gitaly's CommitService.FindCommit RPC

Closes gitaly#402

See merge request !13094
2017-08-08 14:27:22 +00:00
Lin Jen-Shin 8e2350ae95 Raise encoding confidence threshold to 50
It is recommended that we set this to 50:
https://gitlab.com/gitlab-org/gitlab-ce/issues/35098#note_35036746

In this particular issue, the confidence was 42 for Shift JIS,
but in fact that's encoded in UTF-8 just with a single bad
character. In this case, we shouldn't try to treat it as Shift JIS,
but just treat it as UTF-8 and remove invalid bytes.

Treating it like Shift JIS would corrupt the whole data.

Unfortunately, the diff which would cause this could not be
disclosed therefore we can't use it as a test example.
2017-08-08 19:09:56 +08:00
Alejandro Rodríguez 3ce6f03f14 Incorporate Gitaly's CommitService.FindCommit RPC 2017-08-07 23:33:43 -04:00
Alejandro Rodríguez e363fbf71a Move `deltas` and `diff_from_parents` logic to Gitlab::Git::Commit
This helps keep the abstraction layers simpler, and also keep the
interface of those methods consistent, in case of implementation
changes.
2017-08-07 23:33:40 -04:00
Alejandro Rodríguez c21ae07e33 Refactor Gitlab::Git::Commit to include a repository 2017-08-07 22:34:34 -04:00
Stan Hu fd40bce9cc Merge branch '31207-clean-locked-merge-requests' into 'master'
Resolve "Store MergeWorker JID on merge request, and clean up stuck merges"

Closes #31207

See merge request !13207
2017-08-08 01:47:48 +00:00
Oswaldo Ferreira a0c22d1eda Exclude merge_jid on Import/Export attribute configuration 2017-08-07 20:04:16 -03:00
Robert Speicher 475f41acd4 Merge branch 'feature/migrate-find-commits-by-message-to-gitaly' into 'master'
Migrate Repository#find_commits_by_message to Gitaly

Closes gitaly#443

See merge request !13268
2017-08-07 21:33:45 +00:00
Robert Speicher 6085ce1352 Merge branch 'feature/migrate-repository-size-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#size to Gitaly

Closes gitaly#437

See merge request !13259
2017-08-07 21:29:32 +00:00
Sean McGivern f9c6ff7508 Merge branch 'backport-ee-2251' into 'master'
Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE

Closes #21391

See merge request !13275
2017-08-07 20:04:21 +00:00
Douwe Maan 942bd5b411 Merge branch 'blob-batch-methods' into 'master'
Add Gitlab::Git::Blob.batch method

See merge request !13225
2017-08-07 19:57:25 +00:00
Robert Speicher dd3d422193 Merge branch 'github' into 'master'
Improve GitHub importer

Closes #27429

See merge request !12886
2017-08-07 19:27:42 +00:00
Sean McGivern 4c8b666893 Merge branch 'zj-project-templates' into 'master'
Allow projects to be started from a template

Closes #32420

See merge request !13108
2017-08-07 19:24:14 +00:00
Sean McGivern bc648ae5d2 Merge branch 'gitlab-git-repository-log-options' into 'master'
Set default options outside the raw_log method

See merge request !13346
2017-08-07 19:06:46 +00:00
Nick Thomas da5262f4e6 Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE 2017-08-07 19:17:11 +01:00
Paweł Chojnacki 746f0ec367 Add sidekiq metrics endpoint and add http server to sidekiq 2017-08-07 17:13:02 +00:00
Ahmad Sherif c0b41064ff Migrate Repository#find_commits_by_message to Gitaly
Closes gitaly#443
2017-08-07 18:57:06 +02:00
Ahmad Sherif c4f55ce32d Migrate Gitlab::Git::Repository#size to Gitaly
Closes gitaly#437
2017-08-07 18:53:32 +02:00
Douglas Barbosa Alexandre 29d380b03c Set the new GitHub import as import source 2017-08-07 13:06:13 -03:00
Jacob Vosmaer f278e5fb3e Set default options outside the raw_log method
The raw_log method is meant to become the Gitaly RPC boundary. By
setting the defaults before doing the RPC we keep the RPC
implementation simpler. We also sidestep the unfortunate subtleties of
what happens when options[:limit] is not set, or nil.
2017-08-07 18:05:06 +02:00
Rémy Coutable 66e7b4cd07 Merge branch 'add-star-for-action-scope' into 'master'
add star for action scope, in order to delete image from registry

Closes #26465

See merge request !13248
2017-08-07 15:39:19 +00:00
Sean McGivern 5bf65c9306 Merge branch 'bvl-nfs-circuitbreaker' into 'master'
Circuitbreaker for storage paths

Closes #32207, #33117, gitlab-com/infrastructure#1946, and gitlab-com/infrastructure#1775

See merge request !11449
2017-08-07 14:56:15 +00:00
Jacob Vosmaer 29a1c5a126 Rename 'limit' to 'blob_size_limit' 2017-08-07 16:26:50 +02:00
Bob Van Landuyt fda83a6179 Use correct `Environment`-class within `Gitlab` namespace 2017-08-07 15:54:30 +02:00
Tiago Botelho aae947cb1c
Fixes race condition in project uploads
Originally picked as: 3fc0dbcbeb. But
given the internals changed, this was changed now. The changelog was
removed too.
2017-08-07 14:31:45 +02:00
Filipa Lacerda 3b9012871d Merge branch 'master' into zj-project-templates
* master: (623 commits)
  Fix issues with pdf-js dependencies
  fix missing changelog entries for security release on 2017-01-23
  Update top bar issues icon
  Fix pipeline icon in contextual nav for projects
  Since mysql is not a priority anymore, test it less
  Fix order of CI lint ace editor loading
  Add container registry and spam logs icons
  Fix different Markdown styles
  Backport to CE for:
  Make new dropdown dividers full width
  Fix spec
  Fix spec
  Fix spec
  Bump GITLAB_SHELL_VERSION and GITALY_VERSION to support unhiding refs
  Add changelog
  Install yarn via apt in update guides
  Use long curl options
  fix
  Add a spec for concurrent process
  Remove monkey-patched Array.prototype.first() and last() methods
  ...
2017-08-07 11:09:50 +01:00
Huang Tao 0732b974fa Add Korean translation to i18n 2017-08-07 09:19:41 +00:00
Douwe Maan 727b6d16e5 Merge branch 'master' into 'bvl-nfs-circuitbreaker'
# Conflicts:
#   app/models/repository.rb
#   spec/models/repository_spec.rb
2017-08-07 09:13:10 +00:00
Sean McGivern 9b21668663 Merge branch 'gitaly-renames-annotations' into 'master'
Gitaly deletions and annotations

See merge request !13280
2017-08-07 08:40:53 +00:00
Lin Jen-Shin b9a8147333 Merge remote-tracking branch 'upstream/master' into add-star-for-action-scope
* upstream/master: (184 commits)
  Fix issues with pdf-js dependencies
  fix missing changelog entries for security release on 2017-01-23
  Update top bar issues icon
  Fix pipeline icon in contextual nav for projects
  Since mysql is not a priority anymore, test it less
  Fix order of CI lint ace editor loading
  Add container registry and spam logs icons
  Fix different Markdown styles
  Backport to CE for:
  Make new dropdown dividers full width
  Fix spec
  Fix spec
  Fix spec
  Bump GITLAB_SHELL_VERSION and GITALY_VERSION to support unhiding refs
  Add changelog
  Install yarn via apt in update guides
  Use long curl options
  fix
  Add a spec for concurrent process
  Remove monkey-patched Array.prototype.first() and last() methods
  ...
2017-08-07 16:19:28 +08:00
Tim Zallmann 9b93508028 Merge branch '27616-fix-contributions-graph-utc-offset-mysql' into 'master'
Fix Timezone Inconsistencies in User Contribution Calendar

Closes #27616 and #1943

See merge request !13208
2017-08-06 05:57:49 +00:00
Robert Speicher e299d595c7 Merge branch 'feature/migrate-last-commit-for-path-to-gitaly' into 'master'
Migrate Repository#last_commit_for_path to Gitaly

Closes gitaly#433

See merge request !13200
2017-08-04 15:46:36 +00:00
Bob Van Landuyt 4b34720c0c Use ruby's `File.stat` to check storage availability 2017-08-04 15:38:50 +02:00
Bob Van Landuyt 3a2aaed881 Use a Struct to keep track of failure info 2017-08-04 15:38:50 +02:00
Bob Van Landuyt 0dd4c306ca Only track accessibility once 2017-08-04 15:38:50 +02:00
Bob Van Landuyt 022c38e63e Use `keys` instead of `scan_each` 2017-08-04 15:38:49 +02:00
Bob Van Landuyt 3899d07f9e Move hostname to Gitlab::Environment 2017-08-04 15:38:49 +02:00
Bob Van Landuyt 0fa94a0ddd Make sure the check works for paths with spaces. 2017-08-04 15:38:49 +02:00
Bob Van Landuyt 3598e60bf2 Add a Circuitbreaker for storage paths 2017-08-04 15:38:48 +02:00
Ahmad Sherif f81c07eacc Migrate Repository#last_commit_for_path to Gitaly
Closes gitaly#433
2017-08-03 19:26:46 +02:00
Ahmad Sherif 03440eed20 Migrate blame loading to Gitaly
Closes gitaly#421
2017-08-03 19:20:46 +02:00
Robert Speicher 8f9b658e3a Merge branch 'feature/migrate-count-commits-to-gitaly' into 'master'
Migrate Gitlab::Git::Repository#count_commits to Gitaly

Closes gitaly#415

See merge request !13121
2017-08-03 15:25:03 +00:00
Jacob Vosmaer 25a6a0725c Migration link for Repository#log 2017-08-03 16:48:11 +02:00
Rémy Coutable 2a73be5161 Merge branch 'merge-request-commits-background-migration' into 'master'
Merge request commits background migration

See merge request !12685
2017-08-03 14:41:58 +00:00
Jacob Vosmaer 00c9c6b458 Remove unused methods 2017-08-03 16:03:37 +02:00
Jacob Vosmaer 3a8f4a3460 Remove unnecessary 'raw' alias 2017-08-03 15:52:14 +02:00
Jacob Vosmaer 29a07fd3a1 Rename 'commits_between' to 'rugged_commits_between' 2017-08-03 15:48:10 +02:00
Sean McGivern 27d34789c9 Merge branch '28472-ignore-auto-generated-mails' into 'master'
Don't send rejection mails for all auto-generated mails

Closes #28472

See merge request !13254
2017-08-03 12:41:16 +00:00
Sean McGivern f2d50af917 Migrate MR commits and diffs to new tables
Previously, we stored these as serialised fields - `st_{commits,diffs}` - on the
`merge_request_diffs` table. These now have their own tables -
`merge_request_diff_{commits,diffs}` - with a column for each attribute of the
serialised data.

Add a background migration to go through the existing MR diffs and migrate them
to the new format. Ignore any contents that cannot be displayed. Assuming that
we have 5 million rows to migrate, and each batch of 2,500 rows can be
completed in 5 minutes, this will take about 7 days to migrate everything.
2017-08-03 13:20:26 +01:00
Lin Jen-Shin 86e1f41b83 Check against "Auto-Submitted: no" instead
This would be much more accurate. We assume this is an
auto-generated email if such header is provided, and
the value is not "no". It could also be: "auto-generated",
"auto-replied", or other values from extension. It seems
that only "no" could mean that this is sent by a human.

See: https://tools.ietf.org/html/rfc3834
2017-08-03 19:29:18 +08:00
Lin Jen-Shin f097e4dbcd Don't send rejection mails for all auto-generated mails
Also make it easier to have mailer helper
2017-08-03 00:40:10 +08:00
Rémy Coutable 42aa9311be Merge branch 'handle-reserved-words-for-oauth-usernames' into 'master'
Uniquify reserved word usernames on OAuth user creation

See merge request !13244
2017-08-02 14:46:32 +00:00
Robin Bobbitt 71951fc38c Uniquify reserved word usernames on OAuth user creation 2017-08-02 09:40:49 -04:00
Sean McGivern 30413fd2ff Merge branch 'rugged-is-ancestor' into 'master'
Add rugged_is_ancestor method

See merge request !13232
2017-08-02 09:57:06 +00:00
Lin Jen-Shin b3e058996c Cleanup tests and add admin_container_image to
full_authentication_abilities. This is fine because
we're going to check with can?(..) anyway
2017-08-02 17:51:29 +08:00
Douwe Maan c327affc61 Merge branch 'pawel/add_more_variables_to_additional_metrics-35267' into 'master'
Add kube_namespace and standardize common variables for additional metrics queries

See merge request !13169
2017-08-02 09:09:53 +00:00
Ahmad Sherif 215e0911e5 Migrate Gitlab::Git::Repository#count_commits to Gitaly
Closes gitaly#415
2017-08-02 00:33:04 +02:00
Pawel Chojnacki ba97a42193 Remove default arguments for common query context 2017-08-01 22:11:59 +02:00
Pawel Chojnacki feb94e8ea3 Move timeframe_start and timeframe_end to common query context 2017-08-01 21:51:53 +02:00
Pawel Chojnacki b243c3ea78 Give metric query context rspec examples correctly sounding names. + missing whitespace 2017-08-01 20:28:25 +02:00
Jacob Vosmaer d3ddc69b54 Add rugged_is_ancestor method 2017-08-01 17:24:37 +02:00
Sean McGivern c7583e72f9 Merge branch 'rc/fetch-before-finding-merge-base-in-ee_compat_check' into 'master'
Always fetch branches before finding the merge base, otherwise we could find an outdated merge base

See merge request !13226
2017-08-01 13:00:05 +00:00
Z.J. van de Weg 3baf3dc955
Rename GitLabProjectImporterService and misc fixes
First round of review, main changes:
- templates.title is human readable, #name will be passed around
- GitLabProjectImporterService has been renamed
2017-08-01 14:36:42 +02:00
Filipa Lacerda a853d3e944 [ci skip] Adds svgs and css for all icons 2017-08-01 13:25:52 +01:00
Sean McGivern 90cb2aab38 Merge branch '28283-legacy-storage-format' into 'master'
[CE] Added Legacy Storage format

See merge request !13149
2017-08-01 12:24:24 +00:00
Rémy Coutable 4fa83bbe90
Always fetch branches before finding the merge base, otherwise we could find an outdated merge base
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-01 13:52:44 +02:00
Jacob Vosmaer 5e20e448ce Add Gitlab::Git::Blob.batch method 2017-08-01 13:49:57 +02:00
Sean McGivern 5343b3ef57 Merge branch 'gitaly-commit-languages' into 'master'
Add option to use Gitaly CommitLanguages RPC

See merge request !13084
2017-08-01 11:22:53 +00:00
Z.J. van de Weg 09974de3e3
Create rake task to create project templates
First iteration, and some stuff is missing. But basically this rake task
does a clone of a project we've pointed it to. Than creates a project on
the GDK, which should be running in the background. This project is
exported, after which we move that archive to the location we need it.
We clean up by removing the generated project.

The first idea was to export the project on .com too, however than we
might run into ImportExport versions mismatch. This could've been
circumvented by checkout out an older commit locally. This however is
not needed yet, so we opted to not go this route yet, instead we will
iterate on what we got.
2017-08-01 13:00:51 +02:00
Douwe Maan c8a8d13dbb Merge branch 'remove-content-commit' into 'master'
Remove unused Gitlab::Diff code

See merge request !13195
2017-08-01 10:40:36 +00:00
Jacob Vosmaer 67de82cf5f Add option to use CommitLanguages RPC 2017-08-01 10:48:46 +02:00