Commit Graph

31 Commits

Author SHA1 Message Date
Zeger-Jan van de Weg a33d591602
Don't pass the repository path to Gitlab Shell
This isn't a requirement, and removes deprecated method calls
2018-05-17 15:19:32 +02:00
Jacob Vosmaer (GitLab) b942462788 Remove support for absolute dirs from Git::Env 2018-03-30 09:19:46 +00:00
Alejandro Rodríguez cf1a1e9ac1 Send Gitaly payload for git-upload-archive SSH commands 2018-03-21 10:57:06 -03:00
Kim "BKC" Carlbäcker 3c0f6da546 Make git push mandatory 2018-03-06 15:17:00 +01:00
Tiago Botelho 1e56b3f476 Moves project creationg to git access check for git push 2018-02-06 16:52:29 +00:00
Tiago Botelho dc229c076c Abstracts ProjectMoved and ProjectCreated into a BaseProject 2018-02-06 13:35:35 +00:00
Tiago Botelho e42a548f1d Move new project on push logic to a service 2018-02-06 13:35:35 +00:00
Tiago Botelho bc78ae6985 Add specs 2018-02-06 13:35:35 +00:00
Tiago Botelho 32b2ff2601 Adds remote messsage when project is created in a push over SSH or HTTP 2018-02-06 13:35:35 +00:00
Jacob Vosmaer (GitLab) 583cff8d61 Default to Gitaly for 'git push' HTTP/SSH, and make Gitaly mandatory for SSH pull 2018-01-22 16:51:47 +00:00
Lin Jen-Shin 85be6d83be Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (170 commits)
  support ordering of project notes in notes api
  Redirect to an already forked project if it exists
  Reschedule the migration to populate fork networks
  Create fork networks for forks for which the source was deleted.
  Fix item name and namespace text overflow in Projects dropdown
  Minor backport from EE
  fix link that was linking to `html` instead of `md`
  Backport epic tasklist
  Add timeouts for Gitaly calls
  SSHUploadPack over Gitaly is now OptOut
  fix icon colors in commit list
  Fix star icon color/stroke
  Backport border inline edit
  Add checkboxes to automatically run AutoDevops pipeline
  BE for automatic pipeline when enabling Auto DevOps
  I am certainly weary of debugging sidekiq but I don't think that's what was meant
  Ensure MRs always use branch refs for comparison
  Fix issue comment submit button disabled on GFM paste
  Lock seed-fu at the correct version in Gemfile.lock
  Improve indexes on merge_request_diffs
  ...
2017-11-30 15:20:00 +08:00
Kim "BKC" Carlbäcker a402056472 SSHUploadPack over Gitaly is now OptOut
- Better gitaly-handling in /api/internal/allowed specs
2017-11-29 08:21:41 +01:00
Lin Jen-Shin 07d3d44775 Move ModuleWithInstanceVariables to Gitlab namespace
And use .rubocop.yml to exclude paths we don't care,
rather than using the cop itself to exclude.
2017-11-22 17:06:57 +08:00
Lin Jen-Shin 9ac0c76b78 Use StrongMemoize and enable/disable cops properly 2017-11-18 01:01:53 +08:00
Lin Jen-Shin 0af35d7e30 Merge remote-tracking branch 'upstream/master' into no-ivar-in-modules
* upstream/master: (507 commits)
  Add dropdowns documentation
  Convert migration to populate latest merge request ID into a background migration
  Set 0.69.0 instead of latest for codeclimate image
  De-duplicate background migration matchers defined in spec/support/migrations_helpers.rb
  Update database_debugging.md
  Update database_debugging.md
  Move installation of apps higher
  Change to Google Kubernetes Cluster and add internal links
  Add Ingress description from official docs
  Add info on creating your own k8s cluster from the cluster page
  Add info about the installed apps in the Cluster docs
  Resolve "lock/confidential issuable sidebar custom svg icons iteration"
  Update HA README.md to clarify GitLab support does not troubleshoot DRBD.
  Update license_finder to 3.1.1
  Make sure NotesActions#noteable returns a Noteable in the update action
  Cache the number of user SSH keys
  Adjust openid_connect_spec to use `raise_error`
  Resolve "Clicking on GPG verification badge jumps to top of the page"
  Add changelog for container repository path update
  Update container repository path reference
  ...
2017-11-17 19:19:06 +08:00
Ahmad Sherif 52bfd06462 Use relative git object paths to construct absolute ones before setting Env 2017-11-14 20:26:39 +01:00
Lin Jen-Shin 6a4ee9aa71 Allow simple ivar ||= form. Update accordingly 2017-09-19 01:29:32 +08:00
Lin Jen-Shin 9ae92b8caa Add cop to make sure we don't use ivar in a module 2017-09-18 21:23:45 +08:00
Alejandro Rodríguez 8323e55b6c Return a value to check if redis is available on /internal/check 2017-09-05 20:12:18 -03:00
Alejandro Rodríguez eaf60bb544 Implement /internal/post_receive unified endpoint for PostReceive tasks 2017-08-31 11:31:45 -03:00
Kim "BKC" Carlbäcker 8b074b4e78 Send Gitaly Repository with /api/internal/allowed
- Make single gitaly payload
- Add feature-flag specs to verify payload
2017-07-07 22:24:16 +02:00
Michael Kozono af784cc6e2 Add “Project moved” error to Git-over-SSH 2017-06-16 14:14:19 -07:00
Michael Kozono b50a22894d Refactor construction of response 2017-06-05 05:32:26 -07:00
Alejandro Rodríguez c45341c816 Generate and handle a gl_repository param to pass around components
This new param allows us to share project information between components
that don't share or don't have access to the same filesystem
mountpoints, for example between Gitaly and Rails or between Rails and
Gitlab-Shell hooks. The previous parameters are still supported, but if
found, gl_repository is prefered. The old parameters should be deprecated
once all components support the new format.
2017-05-03 17:37:30 -03:00
Sean McGivern 380e40fee3 Remove unused user activities code 2017-04-14 15:20:55 +02:00
James Lopez 3cb84e06b7 Remove user activities table and use redis instead of PG for recording activities
Refactored specs and added a post deployment migration to remove the activity users table.
2017-04-14 15:20:55 +02:00
Rémy Coutable 710cd82cc1 Set Git-specific env in /api/internal/allowed
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-10 16:10:18 +02:00
Alejandro Rodríguez 0b9d56f960 Update storage settings to allow extra values per shard
This will be necessary when adding gitaly settings. This version
doesn't make any functional changes, but allows us to include this
breaking change in 9.0 and add the needed extra settings in the future
with backwards compatibility
2017-03-03 12:13:30 -03:00
Adam Pahlevi a0586dbc16 replace `find_with_namespace` with `find_by_full_path`
add complete changelog for !8949
2017-02-03 07:14:04 +07:00
Timothy Andrew f82d549d26 Accept environment variables from the `pre-receive` script.
1. Starting version 2.11, git changed the way the pre-receive flow works.

  - Previously, the new potential objects would be added to the main repo. If the
    pre-receive passes, the new objects stay in the repo but are linked up. If
    the pre-receive fails, the new objects stay orphaned in the repo, and are
    cleaned up during the next `git gc`.

  - In 2.11, the new potential objects are added to a temporary "alternate object
    directory", that git creates for this purpose. If the pre-receive passes, the
    objects from the alternate object directory are migrated to the main repo. If
    the pre-receive fails the alternate object directory is simply deleted.

2. In our workflow, the pre-recieve script (in `gitlab-shell) calls the
   `/allowed` endpoint, which calls out directly to git to perform
   various checks. These direct calls to git do _not_ have the necessary
   environment variables set which allow access to the "alternate object
   directory" (explained above). Therefore these calls to git are not able to
   access any of the new potential objects to be added during this push.

3. We fix this by accepting the relevant environment variables
   (GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_OBJECT_DIRECTORY) on the
   `/allowed` endpoint, and then include these environment variables while
   calling out to git.

4. This commit includes (whitelisted) these environment variables while making
   the "force push" check. A `Gitlab::Git::RevList` module is extracted to
   prevent `ForcePush` from being littered with these checks.
2016-12-16 23:32:25 +05:30
Nick Thomas 1c994dbc05 Fix POST /internal/allowed to cope with gitlab-shell v4.0.0 project paths
gitlab-shell v3.6.6 would give project paths like so:

* namespace/project

gitlab-shell v4.0.0 can give project paths like so:

* /namespace1/namespace2/project
* /namespace/project
* /path/to/repository/storage/namespace1/namespace2/project
* /path/to/repository/storage/namespace/project
2016-11-16 14:30:56 +00:00