summaryrefslogtreecommitdiff
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Upgrade to Ruby 2.6.3sh-upgrade-to-ruby-2.6.3Stan Hu2019-05-061-1/+1
| | | | | | Restores some of the changes in https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/257, but still targets Rubocop for 2.3.
* Actually print matched keys in list_keysChristian Ratzenhofer2019-04-301-8/+12
|
* Print console messages to $stderr if present9217-warn-on-git-fetch-over-ssh-if-the-secondary-is-lagging-the-primaryAsh McKenzie2019-04-041-1/+16
| | | | Using ConsoleHelper::write_stderr
* New ConsoleHelper moduleAsh McKenzie2019-04-041-0/+38
| | | | | .write_stderr .format_for_stderr
* Remove hooks, they belong to Gitaly nowJacob Vosmaer2019-04-033-656/+0
|
* Merge branch 'display-post-receive-warnings' into 'master'Nick Thomas2019-04-011-6/+20
|\ | | | | | | | | Display post receive warnings from Rails See merge request gitlab-org/gitlab-shell!288
| * Rename print_broadbast method to be genericdisplay-post-receive-warningsLuke Duncalfe2019-04-011-1/+1
| | | | | | | | | | | | print_warnings is now using that method in order to print a large formatted warning message, so renaming the method to be less tied to the broadcast message functionality.
| * Fixing whitespace issues in specLuke Duncalfe2019-03-291-8/+8
| |
| * Allow GitlabPostReceive to print warningsLuke Duncalfe2019-03-281-0/+14
| | | | | | | | | | | | Warnings are printed using the same method that prints broadcast messages. This ensures that whatever warnings are returned will be displayed correctly.
* | Merge branch 'add-pry' into 'master'Rémy Coutable2019-04-011-0/+1
|\ \ | | | | | | | | | | | | Add pry gem to allow easy debugging See merge request gitlab-org/gitlab-shell!289
| * | Add pry gem for easy debuggingadd-pryLuke Duncalfe2019-03-291-0/+1
| |/
* | Provide go implementation for 2fa_recovery_codes commandIgor2019-03-214-94/+203
| |
* | Detect user based on key, username or idBob Van Landuyt2019-03-141-8/+25
|/ | | | | | | | | | | | | | | | | | This allows gitlab-shell to be called with an argument of the format `key-123` or `username-name`. When called in this way, `gitlab-shell` will call the GitLab internal API. If the API responds with user information, it will print a welcome message including the username. If the API responds with a successful but empty response, gitlab-shell will print a welcome message for an anonymous user. If the API response includes an error message in JSON, this message will be printed to stderr. If the API call fails, an error message including the status code will be printed to stderr.
* Add support for using gl_project_pathsh-use-gl-project-pathStan Hu2019-02-165-2/+13
| | | | | | This will enable us to track the human-readable project path with SSH access in gitlab-shell. Currently the Gitaly logs will only show the hashed storage and gl_repository path (e.g. project-1234).
* Provide expires_in for LFS if available57353-git-push-fails-on-large-lfs-files-where-the-push-take-a-long-timeAsh McKenzie2019-02-141-14/+34
|
* Don't fall back to ruby for non SSH connectionsbvl-feature-flag-commandsBob Van Landuyt2019-01-151-20/+24
| | | | | When SSH_CONNECTION is not set, we don't fall back to ruby, but instead fail directly in go writing the error to stderr.
* Allow enabling gitlab-shell "discover"-featureBob Van Landuyt2019-01-151-52/+82
| | | | | | | | | | | | | | | | | | | This adds the possibility to enable features for GitLab shell. The first feature being recognized is "Discover": It's the command that is executed when running `ssh git@gitlab.example.com` and is called without a command. The gitlab key id or username is already parsed from the command line arguments. Currently we only support communicating with GitLab-rails using unix sockets. So features will not be enabled if the GitLab-url is using a different protocol. The url for this read from the config yaml. Pending ruby-specs have been added for the gitlab-shell command. Refactor to have separate command packages
* Merge branch 'fix-rspec-warnings' into 'master'Douwe Maan2018-12-201-9/+15
|\ | | | | | | | | Fix rspec deprecation warning See merge request gitlab-org/gitlab-shell!267
| * Fix rspec deprecation warningsfix-rspec-warningsJacob Vosmaer2018-12-201-9/+15
| |
* | Fix spec failure with Ruby 2.5Jacob Vosmaer2018-12-201-1/+1
|/
* Use 'push_options' everywhere instead of 'push_opts'Jonathon Reinhart2018-12-132-5/+5
|
* Pass push options to GitLab /internal/post_receive APIJonathon Reinhart2018-12-132-3/+5
| | | | | | | | | | push_opts[] is named as such so that it becomes an array in the GitLab internal Grape::API params hash. If it were named push_opts, only the final (scalar) push_opts parameter would be present. Also update specs to include push_opts parameter: - gitlab_post_receive_spec - gitlab_net_spec for the internal API change
* Add lib/hooks_utils.rbJonathon Reinhart2018-12-131-0/+22
| | | | | | | This module is responsible for converting the GIT_PUSH_OPTION_* environment variables into an array. See https://gitlab.com/gitlab-org/gitlab-ce/issues/18667
* Remove unused lib/names_helper.rbJonathon Reinhart2018-12-131-12/+0
| | | | As of 7eb45672b7, NamesHelper is no longer used.
* Include LFS operation when making auth requestashmckenzie/8114-geo-push-ssh-lfs-http-auth-bugAsh McKenzie2018-11-083-8/+69
| | | | Operation is either upload or download
* Remove mistaken support for `gitlab-shell user-123`gitlab-shell-no-glid-argumentJacob Vosmaer2018-09-281-21/+0
|
* Display helpful feedback when proxying an SSH git push to secondary request ↵Ash McKenzie2018-09-254-52/+44
| | | | (v2)
* primary_repo can be a String or a Hashash.mckenzie/display-feedbackAsh McKenzie2018-09-131-34/+44
|
* Print message to $stderr for custom actionAsh McKenzie2018-09-132-0/+105
|
* Make ordered expectations around results outputAsh McKenzie2018-09-132-4/+19
| | | | This also cleans up the output from the tests as previously, Base64 encoded output was printed.
* Ensure text/plain & text/html content typs are handled and add missing specs ↵Ash McKenzie2018-09-1119-30/+614
| | | | for handled HTTP status codes
* Custom Action supportash.mckenzie/custom-action-supportAsh McKenzie2018-09-086-0/+389
|
* GitlabAccessStatus needs HTTP response status codeAsh McKenzie2018-09-072-11/+16
|
* GitlabConfig, GitlabShell & GitlabKeys spec fixesAsh McKenzie2018-09-073-11/+16
| | | | GitlabConfig spec was relying upon real config.yml
* Fix handling non 200 response codeszj-fix-non-200-resp-codeZeger-Jan van de Weg2018-09-051-0/+9
| | | | | | | | | After the cleanup in https://gitlab.com/gitlab-org/gitlab-shell/merge_requests/231 gitlab-shell mishandled the non 200 response codes. This commit removes another few lines of codes, which fixes this. Also now we test against this case through mocking. Fixes https://gitlab.com/gitlab-org/gitlab-shell/issues/152
* Clean up cmd_exec execution environmentZeger-Jan van de Weg2018-08-241-124/+27
| | | | | | | | | | | Given the gitaly-* now proxy the data from the client to the Gitaly server, the environment variables aren't used. Therefor we don't have to set them either. Only exception to the rule, is the GITALY_TOKEN. These changes also remove the `GIT_TRACE` options, introduced by 192e2bd367494bf66746c8971896a2d9cb84fc92. Part of: https://gitlab.com/gitlab-org/gitaly/issues/1300
* Remove non Gitaly code pathsZeger-Jan van de Weg2018-08-201-16/+0
| | | | | | | All shell access goes through Gitaly, so dead code paths exist to support the legacy way too. This change mostly removes the dead code from `#process_cmd`.
* Remove repo_path from GitlabShellzj-remove-repo-pathZeger-Jan van de Weg2018-08-162-30/+5
| | | | | | | | | | | | | | | The internal api returns '/' from gitlab, since `8fad07383ada021fc995294fd0fe0f77fe37da35` from GitLab CE. To clean up later, https://gitlab.com/gitlab-org/gitlab-shell/issues/135 was created. This change closes that issue, making it possible to remove the field from the response on GitLab-CE too. Given the Rails app always returns `/` as the repository_path, the associated checks are basically a noop too. The tests are updated and at times look a little fishy, but those are testing code that is to be removed in another MR. Closes https://gitlab.com/gitlab-org/gitlab-shell/issues/135
* Disable WEBrick logging in HTTPUNIXServer to reduce spec output noisers-rspecRobert Speicher2018-08-151-0/+6
|
* Update webmock to 3.4.2Robert Speicher2018-08-152-2/+3
|
* Reorganize spec_helper; add support files for VCR and HTTPUNIXServerRobert Speicher2018-08-153-35/+40
|
* Use `output` matcher in one testRobert Speicher2018-08-151-4/+1
|
* Require gitlab_init from spec_helperRobert Speicher2018-08-151-0/+2
| | | | This defines `ROOT_PATH`, which we later stub.
* Override `ROOT_PATH` in specs in a less insane wayRobert Speicher2018-08-151-2/+6
|
* Remove usages of `its` in specsRobert Speicher2018-08-153-16/+27
|
* Update rspec to 3.8.0; remove rspec-itsRobert Speicher2018-08-151-2/+0
|
* Autocorrect specs via `transpec -k its -v stub_with_hash`Robert Speicher2018-08-1510-195/+195
|
* Merge remote-tracking branch 'upstream/8-1-stable' into ↵Nick Thomas2018-08-142-0/+166
|\ | | | | | | 148-merge-8-1-1-to-master
| * Harden gitlab-shell against arguments following the gl_id parameter in the ↵Nick Thomas2018-08-091-3/+3
| | | | | | | | command line
| * Fix two regressions in SSH certificate supportÆvar Arnfjörð Bjarmason2018-08-082-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two regressions in my 2e8b670 ("Add support for SSH certificate authentication", 2018-06-14) merged in gitlab-org/gitlab-shell!207. This fixes the issue noted in gitlab-org/gitlab-shell#145 where the command-line contains things other than the key/user/username, and also a regression where SSH certificates are being used, and the username presented in the key is unknown to GitLab. In that case, we should log the user in as "Anonymous" (on an instance that allows public access), but because of how the error checking around api.discover() was implemented we ended up erroring out instead.