Commit Graph

3020 Commits

Author SHA1 Message Date
James Lopez 49495fe63d fix spec 2017-08-28 15:24:24 +02:00
Hiroyuki Sato 866aab7f2a Fix escape characters was not sanitized 2017-08-26 22:32:55 +09:00
Grzegorz Bizon 5ce9e03f6c Use new complex only/except policy internal scheme 2017-08-26 11:11:28 +02:00
Grzegorz Bizon 15ace6a910 Merge commit '2be34630623711fc20ef8c101b5cef688f207cc1' into backstage/gb/rename-ci-cd-processing-sidekiq-queues
* commit '2be34630623711fc20ef8c101b5cef688f207cc1':
  Common Docker Documentation Location in `gitlab-ce`
  fix deprecation warning present during webpack compiles
  Enable 5 lines of Sidekiq backtrace lines to aid in debugging
  Add support for copying permalink to notes via more actions dropdown
  Handle creating a nested group on MySQL correctly
  Decrease statuses batch size even more in a migration
  Fix repo editor scrollbar
  Replace 'source/search_code.feature' spinach test with an rspec analog
  Authorizations regarding OAuth - style confirmation
  Update README.md
  Refactor complicated API group finding rules into GroupsFinder
  Fix group and project search for anonymous users
  Document version Group Milestones API introduced
  Allow v4 API GET requests for groups to be unauthenticated
  Adjust a range and a size in stages statuses migration
  Update README.md
  Point to /developers on docs/administration/authentiq.md
  Indexes GFM markdown guide
  use inline links instead of referenced
  Add index on ci_runners.contacted_at
2017-08-26 10:55:20 +02:00
Gabriel Mazetto 8f178c4222 Prevent new / renamed project from using a repository path that already exists on disk
There are some redundancies in the validation steps, and that is to
preserve current error messages behavior

Also few specs have to be changed in order to fix madness in validation
logic.
2017-08-25 20:06:06 +02:00
Grzegorz Bizon 0410861171 Add specs for attributable aspect of ci config entry 2017-08-25 18:26:55 +02:00
Grzegorz Bizon 4509594e20 Fix Rubocop offense in CI/CD only/except policy class 2017-08-25 17:54:14 +02:00
Sean McGivern f92a80b42a Merge branch 'bvl-fix-mysql-bare-repository-importer' into 'master'
Handle creating a nested group on MySQL correctly

See merge request !13829
2017-08-25 15:00:35 +00: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
Bob Van Landuyt 529a07bd1e Handle creating a nested group on MySQL correctly
Since we don't support nested groups on MySQL, raise an error
explaining that on import instead of trying anyway.
2017-08-25 12:35:47 +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 873460783a Add specs for a simplifiable CI/CD entry aspect 2017-08-25 11:25:37 +02: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
Robert Speicher 51ceacb1fc Add missing third argument to `Git::Repository#initialize` in spec 2017-08-24 17:34:05 -04: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
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
Jacob Vosmaer 961da7d0a7 Add tests for Committer#== 2017-08-23 17:23:28 +02: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
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 bc97931e2d Fix Hook.new call sites in tests 2017-08-23 10:45:20 +02:00
Jacob Vosmaer c47b947a73 Move GitHooksService tests 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
Alejandro Rodríguez 258d5a50e6 Incorporate DiffService.CommitPatch Gitaly RPC 2017-08-22 16:31:59 -03:00
Robert Speicher a6fbd8648e Stub `ForkedStorageCheck.storage_available?` by default in all specs
Add `:broken_storage` metadata to examples to disable this behavior only
when necessary.
2017-08-22 13:06:25 -04: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
Grzegorz Bizon 3366e38cc1 Fix indentation in migration helpers 2017-08-22 14:57:54 +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
James Lopez e163c83b48 fix static analysis 2017-08-22 09:42:24 +02:00
James Lopez ac53067b64 fix specs 2017-08-22 08:59:01 +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
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
Robert Speicher bb40f4ab6e Greatly reduce test duration for git_access_spec
- Combine multiple `it` blocks into one where it made sense
- Use `set` for the top-level User record
- Refactor permission matrix tests
2017-08-18 15:16:54 -04:00
Jacob Vosmaer faaed0aa1f Delete unused Gitlab::Git methods 2017-08-18 14:12:17 +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
Alejandro Rodríguez 0296700207 Add GitalyClient::RepositoryService specs 2017-08-17 14:40:43 -03:00
Sean McGivern c3e0f31dfb Merge branch 'backstage/gb/migrations-tests-schema-version' into 'master'
Improve migrations / background migrations testing strategy

Closes #36303

See merge request !13589
2017-08-17 11:54:54 +00:00
Grzegorz Bizon 3a1103fd91 Add specs for stage status background migration class 2017-08-17 12:56:09 +02:00
Felipe Artur 91035871d3 Fix project import to group when there are project milestones 2017-08-17 10:40:19 +00:00
Grzegorz Bizon d1cfa79dfc Merge branch 'backstage/gb/migrations-tests-schema-version' into backstage/gb/migrate-stages-statuses
* backstage/gb/migrations-tests-schema-version:
  Migrate down before each migration unit test
  Disable db_cleaner tables caching in migrations tests
  Extend migrations testing documentation
  Make it possible to provide schema version in tests
  Migrate db schema for context in :migration specs
2017-08-17 11:59:00 +02: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 4e0ee10a72 Merge branch 'bvl-circuitbreaker-settings-to-avoid-failures' into 'master'
Circuitbreaker settings to avoid spec-failures

Closes #36324

See merge request !13519
2017-08-16 13:38:00 +00:00
Bob Van Landuyt ee603a0089 Allow a `failure_wait_time` of 0 for storage access
This allows testing every storage attempt after a failure. Which could
be useful for tests
2017-08-16 14:15:50 +02:00
Grzegorz Bizon 1066d8ba77 Use usual method to retrieve CI/CD stage statuses 2017-08-16 13:30:49 +02: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
Grzegorz Bizon c76f8f3e8f Make it possible to provide schema version in tests 2017-08-16 13:05:18 +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 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
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 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
Robert Speicher 5896d1b1e6 Merge branch '32004-use-timecop-safe-mode' into 'master'
Enable Timecop safe mode

Closes #32004

See merge request !13498
2017-08-11 16:59:37 +00: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
Sean McGivern 2a4304aea7 Merge branch 'rc/32308-rspec-retry-hack' into 'master'
Detect and keep track of flaky specs

See merge request !13021
2017-08-11 14:59:17 +00: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
Rémy Coutable 8f8fd34231 Use a new RspecFlakyListener to detect flaky specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-11 14:55:10 +02:00
Rémy Coutable 1b413bd62f Enable Timecop safe mode
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-11 14:53:17 +02:00
Yorick Peterse c62ae6cfd7 Merge branch '36328-deserializemergerequestdiffsandcommits-fails-due-to-null-too_large-column-9-5-rc1' into 'master'
Fix merge request diff deserialisation when too_large was absent

Closes #36328

See merge request !13500
2017-08-11 12:23:15 +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
Alexis Reigel 6cd9888f6f store gpg return directory locally 2017-08-11 08:38:42 +02:00
Robert Speicher c8b802471b Enable the RSpec/HookArgument cop and auto-correct offenses 2017-08-10 19:29:42 -04:00
Stan Hu ad3c1573a5 Merge branch 'jej/security-release-2017-08-10' into 'master'
Security release 2017-08-10 patch

See merge request !13477
2017-08-10 22:47:38 +00: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
Rémy Coutable 449a0587f6 Improve the Project factory to make `creator` defaults to namespace.owner
Also improves the `create_templates` transient attribute and use
`project.project_feature.update_columns` instead of
`project.project_feature.update_attributes!` since it's faster.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-10 09:28:58 +02:00
Jacob Vosmaer 11eda5c255 Rename RPC 'Exists' to 'RepositoryExists' 2017-08-09 18:12:29 +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
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 75096f958c Make sure that we have author and committer
In case we don't have it setup in ~/.gitconfig
2017-08-08 20:35:38 +08:00
Lin Jen-Shin d831e8e1d0 Add a test to show that threshold 40 would corrupt
If we set `ENCODING_CONFIDENCE_THRESHOLD` to 40,
this test case would not pass. If we raise to 50,
this would pass.

Note that if in the future rugged didn't return
corrupt data, this would be less relevant. But still
icu recommend the threshold to be 50, we should just
stick with 50.
2017-08-08 19:10:46 +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
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
Oswaldo Ferreira 0640b3d1d8 Store MergeWorker JID on merge request, and clean up stuck merges 2017-08-07 15:23:37 -03: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
Douglas Barbosa Alexandre 29d380b03c Set the new GitHub import as import source 2017-08-07 13:06:13 -03: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
Jacob Vosmaer 29a1c5a126 Rename 'limit' to 'blob_size_limit' 2017-08-07 16:26:50 +02:00
Z.J. van de Weg 2e6aa4f25e
After merge cleanup 2017-08-07 15:09:14 +02:00
Bob Van Landuyt 7de6f742dc Use `broken_storage` in the fs_shards_spec. 2017-08-07 13:30:11 +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
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
Bob Van Landuyt 4b34720c0c Use ruby's `File.stat` to check storage availability 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 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
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 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
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04: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
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
Rémy Coutable 0bc1dfb6d5 Merge branch 'rs-empty_project-cleanup' into 'master'
Ensure all project factories use `:repository` trait or `:empty_project`

See merge request !13238
2017-08-02 09:45:42 +00: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
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Sean McGivern 7a2509ea1f Merge branch 'blob-limit-test' into 'master'
Fix bug in blob test

See merge request !13224
2017-08-01 12:53:57 +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
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
Jacob Vosmaer f3569a25e4 Fix bug in blob test 2017-08-01 13:53:32 +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
Gabriel Mazetto fb06a4d8fe Rename more path_with_namespace -> full_path or disk_path 2017-08-01 07:28:13 +02:00
Gabriel Mazetto c6dee99803 Rename path_with_namespace -> disk_path when dealing with the filesystem 2017-08-01 07:26:58 +02:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Mike Greiling cf2d2cd323 add tests for proper timezone date grouping within ContributionsCalendar 2017-07-31 17:36:46 -05:00
Douwe Maan dbadf5a576 Merge branch 'mk-fix-wiki-backup' into 'master'
Fix improperly skipped backups of wikis

Closes #28854

See merge request !13096
2017-07-31 16:51:06 +00:00
Kamil Trzciński 0b0d04b4db Merge branch 'fix/gb/fix-chatops-deploy-multiple-actions-matching' into 'master'
Improve deploy environment chatops slash command

Closes #34748

See merge request !13150
2017-07-31 15:28:07 +00:00
Jacob Vosmaer 7b18c42464 Remove unused (?) code 2017-07-31 17:19:25 +02:00
Pawel Chojnacki 48778ac589 Tests for query context variables 2017-07-31 16:32:26 +02:00
Pawel Chojnacki 6df5bd8b84 Context handling and tests cleanup + simple test kube_namespace context test 2017-07-31 16:32:26 +02:00
Grzegorz Bizon 8f1274ae03 Merge commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3' into backstage/gb/migrate-stages-statuses
* commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3': (270 commits)
  Add a note about EFS and GitLab log files
  Projects logo are not centered vertically on projects page
  Fix spec/features/projects/branches_spec
  Fixup POST /v3/:id/hooks and PUT /v3/:id/hooks/:hook_id
  Fix a spec that was assuming to be on the wrong page
  Add copy about search terms to ux guide
  Update documentation of user creation by replacing the 'confirm' param with 'skip_confirmation'
  Fix replying to commit comments on MRs from forks
  Fix 500 error when rendering avatar for deleted project creator
  Load and process at most 100 commits when pushing into default branch
  Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
  Add log messages to clarify log messages about API CSRF token verification failure
  Update gitlab_flow.md, Teatro seems to be completely dead, see also https://forum.gitlab.com/t/gitlab-flow-documentation-teatro/7774
  Fix diff commenting results just after changing view
  Update CHANGELOG.md for 9.4.2
  none is not a CSS Value for sizes ;-)
  Merge issuable "reopened" state into "opened"
  Make access level more compatible with EE
  Add link to JIRA article in docs
  Expand pipeline_trigger_service_spec by godfat request
  ...
2017-07-31 10:50:10 +02:00
Michael Kozono a459e45eac Fix Rubocop offense 2017-07-28 14:44:23 -07:00
Michael Kozono bab49fdf9f Protect backups from stale cache for repo exists 2017-07-28 14:44:23 -07:00
Alex Ives a07fe9d7f8 Fixes #29385: Add /shrug and /tableflip commands
- Updated DSL to support substitution definitions
- Added substitution definition, inherits from command definition
- Added tabelflip and shrug substitutions to interpret service
- Added support for substitution definitions to the extractor for preview mode.
- Added substitution handling in the interpret service

Signed-off-by: Alex Ives <alex@ives.mn>
2017-07-28 14:37:44 -05:00
Grzegorz Bizon 07bcabb305 Improve wording related to deploy chatops command 2017-07-28 12:16:07 +02:00
Z.J. van de Weg 1d3815f89b
Allow projects to be started from a template
Started implementation for the first iteration of
gitlab-org/gitlab-ce#32420. This will allow users to select a template
to start with, instead of an empty repository in the project just
created.

Internally this is basically a small extension of the ImportExport
GitLab projects we already support. We just import a certain import
tar archive. This commits includes the first one: Ruby on Rails. In the
future more will be added.
2017-07-28 11:32:46 +02:00
Shinya Maeda 56418e85ac init 2017-07-28 18:13:29 +09:00
Grzegorz Bizon 29a8827752 Improve deploy environment chatops slash command
We now match deployment actions better. If there is more than one
deployment action matched, we check if there is an action which name
equals to environment name, instead of raising an error about too many
actions defined.
2017-07-28 10:56:50 +02:00
Alejandro Rodríguez 8e3f2ecfa9 Incorporate RefsService.FindAllBranches Gitaly RPC 2017-07-27 15:40:54 -04:00
Alejandro Rodríguez 8065adcc1e Improve Gitlab::Git::Repository specs for #branches 2017-07-27 15:39:31 -04:00
Alejandro Rodríguez 432bb22308 Remove unused Gitlab::Git operations 2017-07-27 15:39:31 -04:00
Ahmad Sherif cd5ae5cb2b Migrate Repository#tags to Gitaly
Closes gitaly#411
2017-07-27 20:07:40 +02:00
Dmitriy Zaporozhets ac0cbe6970 Merge branch 'feature/gpg-signed-commits' into 'master'
GPG signed commits

Closes #20268

See merge request !9546
2017-07-27 15:29:39 +00:00
Robert Speicher 9981814514 Merge branch '34319-remove-useless-type-definitions-from-specs' into 'master'
Remove superfluous tags in RSpec examples.

Closes #34319

See merge request !12754
2017-07-27 15:01:06 +00:00
Douwe Maan 842bcfa777 Merge branch 'pawel/ensure_temp_files_are_deleted_in_fs_metrics-35457' into 'master'
Ensure test files are deleted after fs metrics gathering run

Closes #35457

See merge request !13080
2017-07-27 14:45:02 +00:00
Alexis Reigel 9488b7780e optimize query, only select relevant db columns 2017-07-27 15:46:04 +02:00
Alexis Reigel cd01e82873 store gpg user name and email on the signature 2017-07-27 15:44:39 +02:00
Alexis Reigel deb474b413 extract common method 2017-07-27 15:43:37 +02:00
Alexis Reigel b66e3726dc also update gpg_signatures when gpg_key is null 2017-07-27 15:43:37 +02:00
Alexis Reigel a7d2ebe508 simplify fetching of commit 2017-07-27 15:43:37 +02:00
Alexis Reigel e9515dff84 remove the :gpg rspec tag
since everything (except the CurrentKeyChain method) operates on a
tempoary keychain anyway we don't need this anymore.
2017-07-27 15:43:37 +02:00
Alexis Reigel afd7582af6 extract variable 2017-07-27 15:43:36 +02:00
Alexis Reigel 028ecb081b need to wrap the raw commit in a commit model 2017-07-27 15:42:53 +02:00
Alexis Reigel e75ab06430 update invalid gpg signatures when email changes 2017-07-27 15:42:53 +02:00
Alexis Reigel 24671cd601 update invalid gpg signatures when key is created 2017-07-27 15:42:53 +02:00
Alexis Reigel 502e31bec9 memoize verified_signature call 2017-07-27 15:42:53 +02:00
Alexis Reigel 5d5fd4babe store gpg_key_primary_keyid for unknown gpg keys
we need to store the keyid to be able to update the signature later in
case the missing key is added later.
2017-07-27 15:42:53 +02:00
Alexis Reigel 34810acd6c move signature cache read to Gpg::Commit
as we write the cache in the gpg commit class already the read should
also happen there.

This also removes all logic from the main commit class, which just
proxies the call to the Gpg::Commit now.
2017-07-27 15:42:53 +02:00
Alexis Reigel 7b616d39ef gpg signature is only valid when key is verified 2017-07-27 15:42:53 +02:00
Alexis Reigel 8c4b6a32fc bail if the commit has no signature 2017-07-27 15:42:53 +02:00
Alexis Reigel 69e511c4c2 cache the gpg commit signature
we store the result of the gpg commit verification in the db because the
gpg verification is an expensive operation.
2017-07-27 15:42:53 +02:00
Alexis Reigel 2f956fae03 verify gpg commit using tmp keyring and db query 2017-07-27 15:42:53 +02:00
Alexis Reigel 3c42d73098 add primary keyid attribute to gpg keys 2017-07-27 15:42:53 +02:00
Alexis Reigel 7e13d96715 don't sync to keychain file 2017-07-27 15:42:53 +02:00
Alexis Reigel 0668521b2b move current keychain methods to namespace 2017-07-27 15:40:41 +02:00
Alexis Reigel 0e3d3d60ba email handling for gpg keys 2017-07-27 15:40:41 +02:00
Alexis Reigel 5ce61120b1 use example gpg key instead of my own 2017-07-27 15:40:41 +02:00
Alexis Reigel eb77e1068c add second gpg key for specs 2017-07-27 15:40:41 +02:00
Alexis Reigel 87c0fd3455 add / remove gpg keys to / from system keychain 2017-07-27 15:40:41 +02:00
Alexis Reigel e34cef0cd2 extract gpg functionality to lib class 2017-07-27 15:40:41 +02:00
Rémy Coutable cddc5cacfb Use described_class when possible
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Markus Koller d27dec80ce
Support custom directory in gitlab:backup:create task 2017-07-27 13:24:19 +02:00
Sean McGivern ef50875d3a Merge branch '33601-add-csrf-token-verification-to-api' into 'master'
Resolve "Add CSRF token verification to API"

Closes #33601

See merge request !12154
2017-07-27 10:20:52 +00:00
Sean McGivern 2e483ca9e3 Merge branch 'rc/fix-tests-factories' into 'master'
Fix the :project factory by not copying the test repo twice

See merge request !13123
2017-07-27 08:55:53 +00:00
Rémy Coutable 704ce761f3 Merge branch '35539-can-t-create-a-merge-request-containing-a-binary-file-with-non-utf-8-characters' into 'master'
Resolve "Can't create a merge request containing a binary file with non-UTF-8 characters"

Closes #35539

See merge request !13086
2017-07-27 08:39:51 +00:00
Douwe Maan bfe8b96874 Add specs 2017-07-27 10:32:44 +02:00
Rémy Coutable 05e152fa7f
Fix the :project factory by not copying the test repo twice
Also, fixing some calls to the :project factory with the :test_repo
trait since this trait is already included in the :project factory.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 09:58:06 +02:00
Casper a5d2ce8e61 Use LDAP-attributes configured in gitlab.yml in lookup instead of just hard-coded attributes. 2017-07-26 16:48:13 +00:00
Sean McGivern 396b8f91ec Fix saving diffs that are not valid UTF-8
Previously, we used Psych, which would:

1. Check if a string was encoded as binary, and not ASCII-compatible.
2. Add the !binary tag in that case.
3. Convert to base64.

We need to do the same thing, using a new column in place of the tag.
2017-07-26 15:34:57 +01:00
Grzegorz Bizon 79a7f7b6e5 Merge branch 'master' into backstage/gb/migrate-stages-statuses
* master: (110 commits)
  Add missing colon
  Fix project wiki web_url spec
  Resolve "Memory usage notice doesn't link anywhere"
  Docs new topic "user/index"
  Implement GRPC call to RepositoryService
  Pending delete projects should not show in deploy keys
  Remove outdated ~Frontend label in CONTRIBUTING.md
  Fixes 500 error caused by pending delete projects in admin dashboard
  Add lower path index to redirect_routes
  Remove project_key from the Jira configuration
  Update CHANGELOG.md for 9.4.1
  Enable gitaly_post_upload_pack by default
  Add `api` prefix as a top level route in the spec.
  Move relative_path to the element that is being clicked
  Bumps Gitlab Omniauth LDAP version
  Add directives to Vue component ordering
  synchronize ukrainian translation in zanata again
  v3 API is unsupported after 9.5, but may not be removed
  Fix vertical alignment in firefox and safari for pipeline mini graph
  Adds link_to_gfm method instrumentation
  ...

Conflicts:
	db/schema.rb
2017-07-26 14:54:45 +02:00
Sean McGivern 5de3ec64da Merge branch '29289-project-destroy-clean-up-after-failure' into 'master'
Handle errors while a project is being deleted asynchronously.

Closes #29289

See merge request !11088
2017-07-26 12:49:54 +00:00
Douwe Maan d29598e691 Merge remote-tracking branch 'dev/master'
# Conflicts:
#	Gemfile
#	Gemfile.lock
2017-07-26 14:47:50 +02:00
Pawel Chojnacki 7ce0a61a99 use `.zero?` instead of `== 0` 2017-07-26 13:23:27 +02:00
Sean McGivern 96dba2ca17 Merge branch 'post-upload-pack-opt-out' into 'master'
Enable gitaly_post_upload_pack by default

See merge request !13078
2017-07-26 10:39:15 +00:00
Michael Kozono 7f92a36a36 Fix plain LDAP (no encryption) 2017-07-26 02:43:40 -07:00
Michael Kozono 72d8b1e40a Move backwards compatibility logic out of the code
And closer to the configuration setup. The code doesn’t need to know about this.
2017-07-26 02:43:36 -07:00
Michael Kozono 2d7d1fa69d Pass configured `ssl_version` to `omniauth-ldap` 2017-07-26 02:43:36 -07:00
Michael Kozono c8dd77de81 Pass configured `ca_file` to `omniauth-ldap` 2017-07-26 02:43:35 -07:00
Michael Kozono cd13e4ae73 Verify certificates in `omniauth-ldap` 2017-07-26 02:43:35 -07:00
Michael Kozono 612b386450 Set `Net::LDAP` `ssl_version` option 2017-07-26 02:43:34 -07:00
Michael Kozono dcc12505aa Set `Net::LDAP` `ca_file` option 2017-07-26 02:43:34 -07:00
Michael Kozono b67c007842 Set `Net::LDAP` encryption properly 2017-07-26 02:43:33 -07:00
Michael Kozono 94b4c9f34f Use encryption instead of method
The method key is deprecated in the `gitlab_omniauth-ldap` gem.
2017-07-26 02:43:33 -07:00
Sean McGivern 695f5085a1 Merge branch 'zj-repo-exists-gitaly' into 'master'
Implement GRPC call to RepositoryService

See merge request !13019
2017-07-26 08:27:48 +00:00
Z.J. van de Weg acf4a36b3e Implement GRPC call to RepositoryService 2017-07-26 09:32:34 +02:00
Pawel Chojnacki 895e1b3ed1 Stop abusing subject to store results,
+ add helper methods to cleanup fs_shards metrics
2017-07-26 00:28:13 +02:00
Kamil Trzciński ac948684fc Merge branch '30634-protected-pipeline' into 'master'
Implement "Block pipelines on protected branches"

Closes #30634, #34616, and #33130

See merge request !11910
2017-07-25 15:04:23 +00:00
Jacob Vosmaer a78306e7fa Enable gitaly_post_upload_pack by default 2017-07-25 15:23:41 +02:00
Bob Van Landuyt ad46c8878b Add `api` prefix as a top level route in the spec.
Now that it has been removed from the rails routes. But it still needs
to be a reserved top-level word, so the tests should know about this.
2017-07-25 14:51:36 +02:00