summaryrefslogtreecommitdiff
path: root/app/models/project.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'optimise-import-performance' into 'master'Stan Hu2019-07-301-18/+14
| | | | | | | | | | | Optimise import performance Closes #64924 See merge request gitlab-org/gitlab-ce!31045 (cherry picked from commit 0d538e44aff066372ecd9d10ac6786681bc347c9) 8d1e97fc Optimise import performance
* Merge branch '64731-fix-project-auto-devops-api' into 'master'Mayra Cabrera2019-07-301-1/+1
| | | | | | | | | Fix the project auto devops API See merge request gitlab-org/gitlab-ce!30946 (cherry picked from commit a85a233ffc5a8a06de16fd2a52b3fdb039cfae5b) 74444a93 Fix the project auto devops API
* Remove old ignore_column in AR modelsdz-remove-old-ignore-columnDmitriy Zaporozhets2019-07-151-3/+0
| | | | | | | | | | | | Next models are affected: * Project * Namespace * Issue * Merge request * CI Trigger * CI Pipeline schedule Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Fix typo "beetween" in timeout validation messageDaniel Danner2019-07-131-1/+1
|
* Backports of "Remove feature flag behind MR's multiple assignees"Igor2019-07-121-4/+0
|
* Upgrade to Rails 5.2upgrade-rails-5-2-ceHeinrich Lee Yu2019-07-121-3/+5
| | | | Updates changed method names and fixes spec failures
* Add a rubocop for Rails.loggerMayra Cabrera2019-07-101-0/+6
| | | | | | Suggests to use a JSON structured log instead Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
* Resolve Gitaly N+1 for CI/CD environments statusesGrzegorz Bizon2019-07-101-2/+1
|
* Merge branch 'master' into sathieu/gitlab-ce-project_apiDouglas Barbosa Alexandre2019-07-091-1/+1
|\
| * Enable repository object pools by defaultJames Ramsay2019-07-091-1/+1
| | | | | | | | | | Object pools allow Git objects to be shared from the parent project to forks, reducing storage requirements.
* | Add build_git_strategy attribute to project APIMathieu Parent2019-07-031-0/+1
|/ | | | | We map the boolean to the string 'fetch' or 'clone', to be more explicit.
* Remove deprecated `#forked_from?` checkBob Van Landuyt2019-06-281-5/+0
| | | | | | I forgot to clean up this bit in we switched the `forked_from_project` relation to use fork networks in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22226
* Remove group_clusters feature flagThong Kuah2019-06-281-1/+0
| | | | | | Now we have terminals for instance and group clusters we can remove the FF now. Deploying to group clusters has been working without complaints too.
* Move Multiple Issue Boards for Projects to Core53811-issue-boards-to-core-projects-backend-ceAlexandru Croitor2019-06-261-2/+1
| | | | | Refactor code to allow multiple issue boards management for projects in CE
* Re-add ignore_column for import columnsStan Hu2019-06-231-0/+2
| | | | | This `ignore_column` was present for a while but recently removed, but to ensure we don't get error 500s let's keep it for a while.
* Remove import columns from projects tablesh-remove-import-columns-from-projectsStan Hu2019-06-191-2/+0
| | | | | | | | | | | | | | | | | | In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21497, we migrated all project import data into a separate table, `project_import_data`. In addition, we also added: ``` ignore_column :import_status, :import_jid, :import_error ``` In https://gitlab.com/gitlab-com/gl-infra/production/issues/908, we observed some of these `import_error` columns consumed megabytes of error backtraces and caused slow loading of projects whenever a `SELECT * from projects` query loaded the row into memory. Since we have long migrated away from these columns, we can now drop these columns entirely.
* Merge branch '9490-record-repository_type-on-lfs_objects_projects-ce' into ↵Grzegorz Bizon2019-06-171-1/+1
|\ | | | | | | | | | | | | 'master' CE backport for gitlab-ee!13894 (Save repository_type to LfsObjectsProject) See merge request gitlab-org/gitlab-ce!29179
| * CE backport for changes in EE MR 138949490-record-repository_type-on-lfs_objects_projects-ceLuke Duncalfe2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This backports to CE changes that allow the recording of the repository_type in the table lfs_objects_projects. This is in order to allow future pruning of unreferenced LFS objects, as we will need to know which repository to look in for the LFS pointer file. The EE MR that contains the original code and a full explanation of the changes is https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894 EE Issue https://gitlab.com/gitlab-org/gitlab-ee/issues/9490 Note that there was a lot of CE code changed in the EE MR because we want to allow the wiki repository to also use LFS. See https://gitlab.com/gitlab-org/gitlab-ce/issues/43721. As the wiki is an unlicensed feature, a full backport is required to enable this.
* | Fix inability to set visibility_level on project via APIsh-fix-issue-63158Stan Hu2019-06-141-1/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | | Consider the scenario: 1. The default visibility level is set to internal 2. A user attempts to create a private project within a private group Previously this would always fail because default_value_for would overwrite the private visibility setting, no matter what visibility_level were specified. This was happening because default_value_for was confused by the default value of 0 specified by the database schema. default_value_for attempts to assign the default value in the block by checking whether the attribute has changed. The problem is that since the default value by the database was 0, and the user requested 0, this appeared as though no changes were made. As a result, default_value_for would always overwrite the user's preference. To fix this, we remove the use of default_value_for and only set the visibility level to the default application setting when no preference has been given at creation time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63158
* Expose ci_default_git_depth via project APIexpose-project-git-depth-via-apiFabio Pitino2019-06-121-1/+1
| | | | | | | | | | Enable Get and Update of ci_default_git_depth for Project API. Renaming Project#default_git_depth to :ci_default_git_depth to give more context through the API usage. Add API documentation
* Add project level git depth settingKrasimir Angelov2019-06-061-0/+2
| | | | | | | | | | | | | | | | | | | | Introduce default_git_depth in project's CI/CD settings and set it to 50. Use it if there is no GIT_DEPTH variable specified. Apply this default only to newly created projects and keep it nil for old ones in order to not break pipelines that rely on non-shallow clones. default_git_depth can be updated from CI/CD Settings in the UI, must be either nil or integer between 0 and 1000 (incl). Inherit default_git_depth from the origin project when forking projects. MR pipelines are run on a MR ref (refs/merge-requests/:iid/merge) and it contains unique commit (i.e. merge commit) which doesn't exist in the other branch/tags refs. We need to add it cause otherwise it may break pipelines for old projects that have already enabled Pipelines for merge results and have git depth 0. Document new default_git_depth project CI/CD setting
* Merge dev.gitlab.org master into GitLab.com masterYorick Peterse2019-06-031-0/+12
|\
| * Resolve: Milestones leaked via search APIFelipe Artur2019-05-201-0/+12
| | | | | | | | | | Fix milestone titles being leaked using search API when users cannot read milestones
* | Make external_dashboard_url available to frontendReuben Pereira2019-05-291-0/+1
|/ | | | | - On Operations settings page - On Metrics dashboard page
* Fix project visibility level validationPeter Marko2019-05-141-2/+6
|
* Remove ignore_column from Project model61302-remove-ignore_column-ci_cdDmitriy Zaporozhets2019-05-101-1/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Add improvements to the global search processFrancisco Javier López2019-05-071-12/+16
| | | | | | | 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.
* Added blank lines to meet style guideEzekiel Kigbo2019-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Un-nest title variable output Update spec test names Rename sort_value_most_stars -> sort_value_stars_desc Rename sorted_by_stars -> sorted_by_stars_desc Renname sort_value_most_stars_asc -> sort_value_stars_asc Invert feature check, assign feature condition to a variable Inline conditional nav bar rendering Invert conditional label Added follow up task Fix filters returning 0 projects show the wrong view Move click action out of test expectation Use proper variable name for project in before block Rename projects_sort_admin_options_hash Renamed projects_sort_admin_options_has to old_projects_sort_options_hash as its not only used on the admin screen Fix extra whitespace errors Stub project_list_filter_bar in the projects_helper specs Added follow up task for `show_projects?` Removed url test expectations
* Added sorted_by_stars_asc scope to projects modelEzekiel Kigbo2019-05-061-0/+3
|
* Merge branch '27777-drop-projects-ci_id-column' into 'master'Douglas Barbosa Alexandre2019-05-021-0/+1
|\ | | | | | | | | | | | | Resolve "Drop "projects"."ci_id" column" Closes #27777 See merge request gitlab-org/gitlab-ce!27623
| * Remove unused projects.ci_id column27777-drop-projects-ci_id-columnDmitriy Zaporozhets2019-05-021-0/+1
| | | | | | | | | | | | And remove Gitlab::Ci::Trace#deprecated_path as it relies on ci_id Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | Remove deprecated uses of attribute_changed?9932-fix-deprecated-attribute_changed-ceHeinrich Lee Yu2019-04-301-2/+2
|/ | | | Prepares us for upgrade to Rails 5.2
* Add ProjectMetricsDashboardSetting model and tableReuben Pereira2019-04-261-0/+2
| | | | | | This new table will be used to store the external_dashboard_url which allows users to add a link to their external dashboards (ex Grafana) to the Metrics dashboard.
* Upgrade Rails to 5.1.6.1Jasper Maes2019-04-231-3/+3
| | | | Model.new.attributes now also returns encrypted attributes.
* Fix wrong use of ActiveRecord in PoolRepositoryJacob Vosmaer2019-04-201-5/+3
|
* Externalize strings in app/modelsMartin Wortschack2019-04-121-16/+16
| | | | - Update PO file
* Merge branch 'restore-hipchat' into 'master'Nick Thomas2019-04-111-0/+1
|\ | | | | | | | | | | | | Revert "Remove HipChat integration from GitLab" Closes #60042 See merge request gitlab-org/gitlab-ce!27172
| * Revert "Remove HipChat integration from GitLab"Sean McGivern2019-04-101-0/+1
| | | | | | | | This reverts commit a5378665a1dc0b9c8dc3a4fa279a0eb78aac5aac.
* | Align UrlValidator to validate_url gem implementation.Thong Kuah2019-04-111-1/+1
|/ | | | | | | Renamed UrlValidator to AddressableUrlValidator to avoid 'url:' naming collision with ActiveModel::Validations::UrlValidator in 'validates' statement. Make use of the options attribute of the parent class ActiveModel::EachValidator. Add more options: allow_nil, allow_blank, message. Renamed 'protocols' option to 'schemes' to match the option naming from UrlValidator.
* Revert "Merge branch 'sh-optimize-projects-api' into 'master'"revert-2cc01f12Stan Hu2019-04-101-35/+8
| | | This reverts merge request !26481
* Move Contribution Analytics related spec in ↵Imre Farkas2019-04-091-0/+5
| | | | spec/features/groups/group_page_with_external_authorization_service_spec to EE
* [CE] Support multiple assignees for merge requestsosw-multi-assignees-merge-requestsOswaldo Ferreira2019-04-081-0/+4
| | | | | Backports https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10161 (code out of ee/ folder).
* Revert "Merge branch 'if-57131-external_auth_to_ce' into 'master'"Andreas Brandl2019-04-051-5/+0
| | | This reverts merge request !26823
* Move Contribution Analytics related spec in ↵Imre Farkas2019-04-051-0/+5
| | | | spec/features/groups/group_page_with_external_authorization_service_spec to EE
* Stop calling UnlinkRepositoryFromObjectPool RPCJacob Vosmaer2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/59777. In earlier iterations of our implementation of Git object deduplication we thought we would be making extensive use of Git remotes in pool repositories in the future, and that we should manage these remotes carefully from the start. We now expect we only care about one remote, namely the source project. The other remotes are there only for forensic purposes. Before this MR we tried to also remove pool remotes when member projects got deleted, with the UnlinkRepositoryFromObjectPool RPC. This is fragile when there are race conditions (see https://gitlab.com/gitlab-org/gitaly/issues/1568#note_153955926). We have spent some time making this RPC less fragile in https://gitlab.com/gitlab-org/gitaly/merge_requests/1151 but looking at this problem again, I think we should just stop calling it.
* Inherit from ApplicationRecord instead of ActiveRecord::BaseNick Thomas2019-03-281-1/+1
|
* Skip querying for private projects if they are not requestedStan Hu2019-03-271-6/+21
| | | | | | If the requested visibility levels contains only public and/or internal, omitting private, then we can skip the EXISTS query to search for private projects for the user.
* Optimize /api/v4/projects endpoint for visibility levelStan Hu2019-03-271-5/+17
| | | | | | | | | | Previously when a user requested a list of projects, `Project#public_or_visible_to_user` would search all authorized projects and public/internal projects as well. However, when a user requests a specific `visibility_level` (e.g. private), that should reduce the search space, and we shouldn't need to load public/internal projects. Improves https://gitlab.com/gitlab-org/gitlab-ce/issues/59329
* Allow multiple repositories per projectBob Van Landuyt2019-03-261-7/+3
| | | | | | | | This changes the repository type from a binary `wiki?` to a type. So we can have more than 2 repository types. Now everywhere we called `.wiki?` and expected a boolean, we check that type.
* Merge branch 'refresh-commit-count-after-head-change' into 'master'Stan Hu2019-03-221-0/+1
|\ | | | | | | | | | | | | Refresh commit count after repository head changes Closes #59346 See merge request gitlab-org/gitlab-ce!26473