summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Smarter refreshing of authorized projectsproject-authorizations-diffYorick Peterse2016-12-197-61/+364
| | | | | | | | | | | | | | | | | | | | | Prior to this commit the refreshing of authorized projects was done in two steps: 1. Remove existing authorizations 2. Insert a new list of all authorizations This can lead to a high amount of dead tuples as every time all rows are being replaced. For example, if a user with 100 authorizations is given access to a new project this would lead to: * 100 rows being removed * 101 new rows being inserted This commit changes the way this system works so it only removes/inserts what is necessary. Using the above example this would lead to only 1 new row being inserted, with the initial 100 being left untouched. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/25257
* Merge branch 'fix/ci-readme-typo' into 'master' Grzegorz Bizon2016-12-191-1/+1
|\ | | | | | | | | | | | | Fix small typo in CI readme fix typo See merge request !8167
| * Fix typofix/ci-readme-typoJames Lopez2016-12-191-1/+1
| |
* | Merge branch '25301-git-2.11-force-push-bug' into 'master' Douglas Barbosa Alexandre2016-12-1910-10/+147
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept environment variables from the `pre-receive` script ## Summary 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`, and `GIT_QUARANTINE_PATH`) on the `/allowed` endpoint, and then include these environment variables while calling out to git. 4. This commit includes these environment variables while making the "force push" check. ## Issue Numbers - Closes #25301 (assuming the corresponding `gitlab-shell` MR has been merged in first) - Corresponding `gitlab-shell` MR: gitlab-org/gitlab-shell!112 - Corresponding EE MR: gitlab-org/gitlab-ee!964 ## Tasks - [#25301/!7967/!112] Git version 2.11.0 - Can't push to protected branch as master or developer - [x] Investigate - [x] Implementation - [x] `force_push.rb` should use the relevant environment variables - [x] Any other instances of `/allowed` calling out to git directly? - [x] Verify that the fix works over SSH as well - [x] Can we trim the number of env variables? Do we need all 3? - [x] Whitelist variables. Server shouldn't pass through _any_ env variable passed in - [x] Any security implications? - [x] Check for force push return code - [x] Shouldn't be able to opt-out from the force push check by passing an env variable - [x] Tests - [x] CE - [x] Added - [x] Passing - [x] Shell - [x] Added - [x] Passing - [x] Meta - [x] CHANGELOG entry created - [x] Branch has no merge conflicts with `master` - [x] Squashed related commits together - [x] EE merge request - [x] Review - [x] Endboss - [ ] Follow-up - [x] Make sure EE is working as expected - [x] [CE] Gitlab changes without gitlab-shell changes shouldn't raise any exceptions - [x] [CE] Gitlab-shell changes without gitlab changes shouldn't raise any exceptions - [x] [EE] Gitlab changes without gitlab-shell changes shouldn't raise any exceptions - [x] [EE] Gitlab-shell changes without gitlab changes shouldn't raise any exceptions - [ ] Wait for merge - [ ] CE - [ ] EE - [x] Shell See merge request !7967
| * | Implement final review comments from @rymai.25301-git-2.11-force-push-bugTimothy Andrew2016-12-163-51/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `raise "string"` raises a `RuntimeError` - no need to be explicit - Remove top-level comment in the `RevList` class - Use `%w()` instead of `%w[]` - Extract an `environment_variables` method to cache `env.slice(*ALLOWED_VARIABLES)` - Use `start_with?` for env variable validation instead of regex match - Validation specs for each allowed environment variable were identical. Build them dynamically. - Minor change to `popen3` expectation.
| * | Implement review comments from @dbalexandre.Timothy Andrew2016-12-164-92/+57
| | | | | | | | | | | | | | | | | | | | | | | | - Don't define "allowed environment variables" in two places. - Dispatch to different arities of `Popen.open` without an if/else block. - Use `described_class` instead of explicitly stating the class name within a - spec. - Remove `git_environment_variables_validator_spec` and keep the validation inline.
| * | Add CHANGELOG entry.Timothy Andrew2016-12-161-0/+4
| | |
| * | Check the exit code while invoking git in the force push check.Timothy Andrew2016-12-162-2/+26
| | | | | | | | | | | | | | | Previously, we were calling out to `popen` without asserting on the returned exit-code. Now we raise a `RuntimeError` if the exit code is non-zero.
| * | Validate environment variables in `Gitlab::Git::RevList`Timothy Andrew2016-12-164-3/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of environment variables in `Gitlab::Git::RevList` need to be validate to make sure that they don't reference any other project on disk. This commit mixes in `ActiveModel::Validations` into `Gitlab::Git::RevList`, and validates that the environment variables are on the level (using a custom validator class). If the validations fail, the force push is still executed without any environment variables set. Add specs for the validation using shared examples.
| * | Accept environment variables from the `pre-receive` script.Timothy Andrew2016-12-167-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch 'dockerfile-templates' into 'master' Rémy Coutable2016-12-1912-6/+138
|\ \ \ | | | | | | | | | | | | | | | | Allow to use Dockerfile templates See merge request !7247
| * \ \ Merge remote-tracking branch 'origin/master' into dockerfile-templatesdockerfile-templatesKamil Trzcinski2016-12-182868-35378/+79204
| |\ \ \
| * | | | Add CHANGELOGKamil Trzcinski2016-12-181-0/+4
| | | | |
| * | | | Update templates.rbKamil Trzciński2016-12-161-1/+1
| | | | |
| * | | | Refactored JSLuke "Jared" Bennett2016-11-087-42/+84
| | | | | | | | | | | | | | | | | | | | Added spec
| * | | | Allow to use Dockerfile templatesKamil Trzcinski2016-11-089-7/+93
| | | | |
* | | | | Merge branch 'move-admin-application-spinach-test-to-rspec' into 'master' Rémy Coutable2016-12-194-77/+36
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move admin application spinach test to RSpec Part of #23036 See merge request !8140
| * | | | | Move admin application spinach test to rspecSemyon Pupkov2016-12-174-77/+36
| | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
* | | | | | Merge branch 'deploy-keys-to-rspec' into 'master' Rémy Coutable2016-12-193-62/+29
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move admin deploy keys spinach test to RSpec Part of #23036 See merge request !8141
| * | | | | Move admin deploy keys spinach test to rspecSemyon Pupkov2016-12-173-62/+29
| |/ / / / | | | | | | | | | | | | | | | https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
* | | | | Merge branch 'fix-groups-helper-spec' into 'master' Stan Hu2016-12-191-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always use `fixture_file_upload` helper to upload files in tests. ## What does this MR do? Fix a broken spec. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !8164
| * | | | | Always use `fixture_file_upload` helper to upload files in tests.fix-groups-helper-specRuben Davila2016-12-181-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | * Also is not a good idea to use File.open without closing the file handler. We should use it with a block or close it explicitly.
* | | | | Merge branch 'update-nginx-config-for-websockets' into 'master' Kamil Trzciński2016-12-182-0/+15
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update NGINX configuration files to add websocket support ## What does this MR do? Changes the bundled NGINX configuration files to support websockets introduced in https://gitlab.com/gitlab-org/gitlab-workhorse/merge_requests/83 These changes are also going into omnibus: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1146 ## Are there points in the code the reviewer needs to double check? Best to wait until the omnibus MR is merged as the method may be changed. ## Why was this MR needed? Without it, NGINX won't let websockets through to workhorse. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - Tests - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [X] Branch has no merge conflicts with `master` (if it does - rebase it please) - [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Related to #22864 See merge request !8039
| * | | | | Upgrade NGINX configuration files to add websocket supportNick Thomas2016-12-122-0/+15
| | | | | |
* | | | | | Merge branch 'correct-slack-slash-commands-pretty-path' into 'master' Kamil Trzciński2016-12-181-3/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct mattermost slash commands pretty path ## What does this MR do? Corrects the pretty path used for mattermost slash commands. ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ![Screen_Shot_2016-12-14_at_13.31.18](/uploads/61b0cbe11bf747d566ed7959efa704b8/Screen_Shot_2016-12-14_at_13.31.18.png) ## Does this MR meet the acceptance criteria? - [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !8085
| * | | | | | Correct slack slash commands pretty pathcorrect-slack-slash-commands-pretty-pathLuke "Jared" Bennett2016-12-151-3/+2
| | | | | | |
* | | | | | | Merge branch 'feature/runner-script-attempts-docs' into 'master' Kamil Trzciński2016-12-183-0/+29
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new runner script attempts docs and update .gitlab-ci.yml Related: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1907 and https://gitlab.com/gitlab-com/infrastructure/issues/685 Adds missing docs about the new script attempts variables in the runner. See merge request !8100
| * | | | | | Add detailed docs in yaml README [ci skip]feature/runner-script-attempts-docsJames Lopez2016-12-161-0/+25
| | | | | | |
| * | | | | | add new runner script attempts docs and update .gitlab-ci.ymlJames Lopez2016-12-152-0/+4
| | | | | | |
* | | | | | | Merge branch '25741_enable_multiline_operation_indentation_rubocop_rule' ↵Sean McGivern2016-12-1721-44/+45
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 'master' Enable Style/MultilineOperationIndentation in Rubocop Fixes #25741 See merge request !8125
| * | | | | | Enable Style/MultilineOperationIndentation in Rubocop, fixes #25741Rydkin Maxim2016-12-1621-44/+45
| | | | | | |
* | | | | | | Merge branch 'zj-mattermost-session' into 'master' Grzegorz Bizon2016-12-174-0/+227
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mattermost session This branch is based of tag v8.14.4 so I could test on an instance better. But stuck on the tests, as setting up the whole doorkeeper stuff doesn't seem to be supported for testing. See merge request !8033
| * | | | | | | Fix rubocop failureszj-mattermost-sessionKamil Trzcinski2016-12-172-17/+23
| | | | | | | |
| * | | | | | | Store mattermost_url in settingsKamil Trzcinski2016-12-174-13/+35
| | | | | | | |
| * | | | | | | Improve Mattermost Session specsKamil Trzcinski2016-12-172-26/+50
| | | | | | | |
| * | | | | | | Ensure the session is destroyedZ.J. van de Weg2016-12-171-3/+5
| | | | | | | |
| * | | | | | | Improve session testsZ.J. van de Weg2016-12-173-45/+74
| | | | | | | |
| * | | | | | | Setup mattermost sessionZ.J. van de Weg2016-12-172-0/+144
|/ / / / / / /
* | | | | | | Merge branch 'cleaner-merge-commit-messages' into 'master' Sean McGivern2016-12-179-21/+242
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleaner merge commit messages Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23462 See merge request !7722
| * | | | | | | Change closes issues reference text on MergeRequest#merge_commit_message to ↵Gabriel Gizotti2016-12-163-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | match existing text generated by the system
| * | | | | | | add feature specs to test toggling of merge commit message between message ↵Gabriel Gizotti2016-12-162-3/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with description and without
| * | | | | | | add eslint disable prefix for prefer-arrow-callback rule on header of ↵Gabriel Gizotti2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge_request.js file
| * | | | | | | Add feature spec to verify all 4 different states of closing issues message ↵Gabriel Gizotti2016-12-161-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Merge Request show page.
| * | | | | | | add guard clause to MergeRequest#issues_mentioned_but_not_closingGabriel Gizotti2016-12-161-9/+6
| | | | | | | |
| * | | | | | | add js prefix to classes used to toggle description on commit message in ↵Gabriel Gizotti2016-12-162-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge request
| * | | | | | | Show either description or closes issues references on ↵Gabriel Gizotti2016-12-163-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MergeRequest#merge_commit_message so closes issues references are not duplicated
| * | | | | | | Unify commit message listeners in one functionGabriel Gizotti2016-12-161-11/+6
| | | | | | | |
| * | | | | | | better text for mentioned but not closedGabriel Gizotti2016-12-161-1/+1
| | | | | | | |
| * | | | | | | add mentioned but not closed message to the same line as closes issueswqGabriel Gizotti2016-12-161-13/+14
| | | | | | | |
| * | | | | | | extract duplicate logic into a variable on _commit_message_containerGabriel Gizotti2016-12-161-2/+3
| | | | | | | |