summaryrefslogtreecommitdiff
path: root/spec/models
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'security-60039' into 'master'GitLab Release Tools Bot2019-06-031-0/+36
|\ | | | | | | | | Disallow invalid MR branch name See merge request gitlab/gitlabhq!3052
| * Validate MR branch namesMark Chao2019-05-031-0/+36
| | | | | | | | | | | | | | | | | | | | Prevents refspec as branch name, which would bypass branch protection when used in conjunction with rebase. HEAD seems to be a special case with lots of occurrence, so it is considered valid for now. Another special case is `refs/head/*`, which can be imported.
* | Protect Gitlab::HTTP against DNS rebinding attackDouwe Maan2019-05-307-27/+35
| | | | | | | | | | | | Gitlab::HTTP now resolves the hostname only once, verifies the IP is not blocked, and then uses the same IP to perform the actual request, while passing the original hostname in the `Host` header and SSL SNI field.
* | Add changelog entryJacques Erasmus2019-05-271-24/+139
| | | | | | | | Added a changelog entry for the feature
* | Remove un-used methodsThong Kuah2019-05-241-28/+0
| | | | | | | | | | These two methods were used in emitting AUTO_DEVOPS_DOMAIN which has now been dropped.
* | Stop emitting AUTO_DEVOPS_DOMAIN Ci variableThong Kuah2019-05-244-167/+6
| | | | | | | | Update documentation to reflect removal
* | Merge branch 'sh-bump-shoulda-matcher' into 'master'Jan Provaznik2019-05-224-3/+7
|\ \ | | | | | | | | | | | | Bump shoulda-matchers to 4.0.1 See merge request gitlab-org/gitlab-ce!28443
| * | Fix remaining failures in shoulda-matcherStan Hu2019-05-212-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with Rails 5, belongs_to now adds a presence validation to the association, and so as of shoulda-matchers 4.0.0 the belong_to matcher follows suit and tests that this validation is there by setting the association to nil and asserting that there are validation errors. This exposed an error with the `validate_branches` method: we need to check the source and target project exist.
| * | Ensure subject passes validationsStan Hu2019-05-212-0/+4
| | | | | | | | | | | | | | | Rails 5 requires that belongs_to associations have the associated record present. These tests were failing because they had nil values.
* | | Remove legacy Kubernetes #actual_namespace61935-remove-code-left-over-from-when-clusters-were-always-project-specificTiger2019-05-214-25/+28
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Kubernetes clusters were originally built they could only exist at the project level, and so there was logic included that assumed there would only ever be a single Kubernetes namespace per cluster. We now support clusters at the group and instance level, which allows multiple namespaces. This change consolidates various project-specific fallbacks to generate namespaces, and hands all responsibility to the Clusters::KubernetesNamespace model. There is now no concept of a single namespace for a Clusters::Platforms::Kubernetes; to retrieve a namespace a project must now be supplied in all cases. This simplifies upcoming work to use a separate Kubernetes namespace per project environment (instead of a namespace per project).
* | Use Environment#deployment_platform method insteadenvironment_terminal_methodsThong Kuah2019-05-201-3/+1
| | | | | | | | | | | | As this method does have `deployment_platform(environment: self.name)`, which is what the form EE needs. Allows us to remove two overrides in EE.
* | Stop configuring group clusters on creation60379-remove-ci-preparing-state-feature-flagTiger2019-05-161-14/+6
| | | | | | | | | | | | | | | | | | | | | | Immediate configuration is not ideal for group and instance level clusters as projects that may never be deployed would still have Kubernetes namespaces and service accounts created for them. As of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25586 we now create only the resources that are required for the project being deployed, at the time of deployment.
* | Merge branch 'jc-omit-count-diverging-commits-max' into 'master'Lin Jen-Shin2019-05-161-2/+35
|\ \ | | | | | | | | | | | | Omit max-count for diverging_commit_counts behind feature flag See merge request gitlab-org/gitlab-ce!28157
| * | Omit max-count for diverging_commit_counts behind feature flagjc-omit-count-diverging-commits-maxJohn Cai2019-05-141-2/+35
| | | | | | | | | | | | | | | | | | | | | We want to optimize the query for the CountDivergingCommits rpc by removing the --max-count argument now that we have commit graphs enabled for all repositories during housekeeping. However, we want to test this first behind a feature flag.
* | | Merge branch 'jej/list-sessions-for-user' into 'master'Stan Hu2019-05-161-0/+46
|\ \ \ | | | | | | | | | | | | | | | | Sessions can be listed for a given user See merge request gitlab-org/gitlab-ce!28306
| * | | Sessions can be listed for a given userjej/list-sessions-for-userJames Edwards-Jones2019-05-151-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | Adds ActiveSession#session_ids_for_user for listing session IDs for a given user, and adds ActiveSession#list_sessions for listing session data directly.
* | | | Merge branch 'make-autocomplete-faster-with-lots-of-results' into 'master'53811-move-multiple-issue-boards-for-projects-to-coreStan Hu2019-05-141-0/+6
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Optimise upload path calls See merge request gitlab-org/gitlab-ce!28264
| * | | | Optimise upload path callsSean McGivern2019-05-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String#underscore isn't particularly slow, but it's possible for us to call it many times in a users autocomplete request, with mostly-static values ('User', 'Group', etc.). We can memoise this and save a surprising amount of time (around 10% of the total request time in some cases).
* | | | | Merge branch 'fix-project-visibility-level-validation' into 'master'Stan Hu2019-05-141-0/+7
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix project visibility level validation Closes #59379 See merge request gitlab-org/gitlab-ce!28305
| * | | | | Fix project visibility level validationPeter Marko2019-05-141-0/+7
| |/ / / /
* | | | | Rename methods that conflict in Rails 5.255583-rename-method-conflictsHeinrich Lee Yu2019-05-122-3/+3
|/ / / / | | | | | | | | | | | | | | | | Adds suffix to enum methods and changes `in_groups` to `of_groups`
* | | | Resolve "JIRA service: NoMethodError: undefined method `find' for nil:NilClass"Patrick Derichs2019-05-101-0/+7
|/ / /
* | | Added user time settings fields to profileEzekiel Kigbo2019-05-071-0/+6
| | | | | | | | | | | | | | | | | | Udpated user_edit_profile_spec with time preferences Minor update form fields
* | | Merge branch 'show-disabled-mirrors' into 'master'Nick Thomas2019-05-071-0/+16
|\ \ \ | | | | | | | | | | | | | | | | CE Show disabled project repo mirrors See merge request gitlab-org/gitlab-ce!27326
| * | | Show disabled project repo mirrorsshow-disabled-mirrorsLuke Bennett2019-05-071-0/+16
| | | | | | | | | | | | | | | | | | | | Show disabled mirrors with a badge so that they can be deleted by project owners.
* | | | Add improvements to the global search processFrancisco Javier López2019-05-071-30/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed the conditions added to Project.with_feature_available_for_user, and moved to the IssuableFinder. Now, we ensure that, in the projects retrieved in the Finder, the user has enough access for the feature.
* | | | Merge branch 'strip-attr-cron-in-pipeline-schedule' into 'master'Grzegorz Bizon2019-05-071-0/+9
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | Strip whitespace for PipelineSchedule#cron See merge request gitlab-org/gitlab-ce!27990
| * | | | Strip whitespace for PipelineSchedule#cronstrip-attr-cron-in-pipeline-scheduleFabio Pitino2019-05-021-0/+9
| | | | |
* | | | | Merge branch 'instance_level_clusters' into 'master'Bob Van Landuyt2019-05-072-3/+24
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Instance level k8s clusters See merge request gitlab-org/gitlab-ce!27196
| * | | | | Allow projects to use instance level clustersJames Fargher2019-05-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two cluster hierarchies one for the deployment platform and one for controllers. The main difference is that deployment platforms do not check user permissions and only return the first match.
| * | | | | Instance level kubernetes clusters adminJames Fargher2019-05-071-3/+15
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | Instance level clusters were already mostly supported, this change adds admin area controllers for cluster CRUD
* | | | | Additional fix to handle NULL lock_versionsh-fix-activerecord-patch-mark2Stan Hu2019-05-062-10/+32
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the UI sends a string value for lock_version (e.g. "0"), then the previous monkey patch did not properly handle that properly. This commit casts the value to an integer to determine whether to look for NULL lock_versions. For merge requests, GitLab sends a POST request to `namespace/project/merge_requests/:iid` with the `merge_request[lock_version]` parameter with a string `0`. The string value comes from the form field, which explains why https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/28145 wasn't sufficient.
* | | | Fix editing issues and MRs with NULL lock_versionSean McGivern2019-05-062-0/+24
| |/ / |/| |
* | | Implement support for CI variables of type fileKrasimir Angelov2019-05-064-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add env_var and file as supported types for CI variables. Variables of type file expose to users existing gitlab-runner behaviour - save variable value into a temp file and set the path to this file in an ENV var named after the variable key. Resolves https://gitlab.com/gitlab-org/gitlab-ce/issues/46806.
* | | Merge branch '30093-apply-bfg-object-map-to-database' into 'master'Douwe Maan2019-05-061-0/+27
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove cleaned up OIDs from database and cache Closes #30093 See merge request gitlab-org/gitlab-ce!26555
| * | | Remove cleaned up OIDs from database and cacheNick Thomas2019-05-061-0/+27
| | | |
* | | | Fix merge request pipeline exist methodfix-merge-request-pipeline-exist-methodShinya Maeda2019-05-063-5/+5
|/ / / | | | | | | | | | Refactor
* | | Allow guests users to access project releasesKrasimir Angelov2019-05-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is step one of resolving https://gitlab.com/gitlab-org/gitlab-ce/issues/56838. Here is what changed: - Revert the security fix from bdee9e8412d. - Do not leak repository information (tag name, commit) to guests in API responses. - Do not include links to source code in API responses for users that do not have download_code access. - Show Releases in sidebar for guests. - Do not display links to source code under Assets for users that do not have download_code access. GET ':id/releases/:tag_name' still do not allow guests to access releases. This is to prevent guessing tag existence.
* | | Add gitlab-managed option to clusters formMayra Cabrera2019-05-032-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | When this option is enabled, GitLab will create namespaces and service accounts as usual. When disabled, GitLab wont create any project specific kubernetes resources Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56557
* | | Adds a way to start multiple manual jobs in stageMayra Cabrera2019-05-023-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Adds an endpoint on PipelinesController - Adds a service that iterates over every build in a stage and plays it. - Includes 'play_manual' details on EntitySerializer - Builds a new Stage state: PlayManual. An stage can take this status if it has manual builds or an skipped, scheduled or manual status - Includes FE modifications and specs
* | | Add support for two-step Gitaly Rebase RPCLuke Duncalfe2019-05-021-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new two-step Gitaly `Rebase` RPC yields the rebase commit SHA to the client before proceeding with the rebase. This avoids an issue where the rebase commit SHA was returned when the RPC had fully completed, and in some cases this would be after the Rails `post_receive` worker services had already run. In these situations, the merge request did not yet have its rebase_commit_sha attribute set introducing the possibility for bugs (such as previous approvals being reset). https://gitlab.com/gitlab-org/gitlab-ee/issues/5966
* | | Update deployment chat message notificationJason Goodman2019-05-021-5/+8
| | | | | | | | | | | | | | | Include link to user and commit title. Rearrange text
* | | Add packages_size to ProjectStatisticsAlessio Caiazza2019-05-022-13/+29
| | | | | | | | | | | | | | | This new field will allow to keep track of the storage used by the packages features, it provides also aggregation at namespace level.
* | | Merge branch '9932-fix-deprecated-attribute_changed-ce' into 'master'Andreas Brandl2019-05-022-14/+20
|\ \ \ | | | | | | | | | | | | | | | | [CE] Remove deprecated usage of `attribute_changed?` See merge request gitlab-org/gitlab-ce!27577
| * | | Remove deprecated uses of attribute_changed?9932-fix-deprecated-attribute_changed-ceHeinrich Lee Yu2019-04-302-14/+20
| | | | | | | | | | | | | | | | Prepares us for upgrade to Rails 5.2
* | | | Merge branch ↵Douwe Maan2019-05-021-2/+2
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | '53064-bypassing-pipeline-jobs-by-canceling-the-pipeline-and-manually-running-later-jobs' into 'master' Disable retrying cancelled jobs Closes #53064 See merge request gitlab-org/gitlab-ce!27503
| * | | Update specs that use retryable canceled jobsmfluharty2019-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specs that test canceled jobs now - expect them not to be retryable or playable - expect them not to show retry buttons Specs that test retryability now - use failed status instead of canceled status
* | | | Merge branch 'sh-allow-equal-level-in-subgroup-membership' into 'master'James Lopez2019-05-021-0/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow a member to have an access level equal to parent group Closes gitlab-ee#11323 See merge request gitlab-org/gitlab-ce!27913
| * | | | Allow a member to have an access level equal to parent groupsh-allow-equal-level-in-subgroup-membershipStan Hu2019-04-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose you have this configuration: 1. Subgroup `hello/world` 2. Subgroup `hello/mergers`. 3. Project `hello/world/my-project` has invited group `hello/world` to access protected branches. 4. The rule allows the group to merge but no one can push. 5. User `newuser` has Owner access to the parent group `hello`. Previously, there was no way for the user `newuser` to be added to the `hello/mergers` group since the validation only allowed a user to be added at a higher access level. Since membership in a subgroup confers certain access rights, such as being able to merge or push code to protected branches, we have to loosen the validation and allow someone to be added at an equal level granted by the parent group. Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/11323
* | | | | Update metrics dashboard API to load yml from repoSarah Yasonik2019-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates the EnvironmentController#metrics_dashboard endpoint to support a "dashboard" param, which can be used to specify the filepath of a dashboard configuration from a project repository. Dashboard configurations are expected to be stored in .gitlab/dashboards/. Updates dashboard post-processing steps to exclude custom metrics, which should only display on the system dashboard.