summaryrefslogtreecommitdiff
path: root/app/models/project.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'mc/feature/find-all-artifacts-for-sha' into 'master'Robert Speicher2019-07-261-7/+18
|\ | | | | | | | | | | | | Find build by sha from ref Closes #64534 and #45697 See merge request gitlab-org/gitlab-ce!30843
| * Rename latest_successful to be more explicitMatija Čupić2019-07-261-7/+7
| | | | | | | | | | | | | | * Reword Project#latest_successful_build_for to Project#latest_successful_build_for_ref * Reword Ci::Pipeline#latest_successful_for to Ci::Pipeline#latest_successful_build_for_ref
| * Find build by sha from refMatija Čupić2019-07-231-1/+12
| | | | | | | | Adds ability to find builds by sha when only specifying a ref.
* | Merge branch 'optimise-import-performance' into 'master'Stan Hu2019-07-241-18/+14
|\ \ | |/ |/| | | | | | | | | Optimise import performance Closes #64924 See merge request gitlab-org/gitlab-ce!31045
| * Optimise import performanceoptimise-import-performanceKamil Trzciński2019-07-241-18/+14
| | | | | | | | | | | | | | | | | | - Fix `O(n)` complexity of `append_or_update_attribute`, we append objects to an array and re-save project - Remove the usage of `keys.include?` as it performs `O(n)` search, instead use `.has_key?` - Remove the usage of `.keys.first` as it performs a copy of all keys, instead use `.first.first`
* | Merge branch 'gsemet/gitlab-ce-gsemet-master-patch-33258' into 'master'Sean McGivern2019-07-231-2/+10
|\ \ | |/ |/| | | | | Multiple pipeline support for Build status See merge request gitlab-org/gitlab-ce!30828
| * Add specs for specifying pipeline behaviorMatija Čupić2019-07-231-2/+10
| | | | | | | | | | Adds specs for testing the new behavior of specifying a pipeline when POSTing a status.
* | Removed project autocomplete paginationJan Provaznik2019-07-221-16/+1
| | | | | | | | | | | | This pagination is not used anywhere so there is no reason to keep it. It seems the usage of offset_id was probably removed in 90c60138db4e1f86026aac5760febe4ba066ca30
* | Fix the project auto devops APINick Thomas2019-07-191-1/+1
|/ | | | | | | | | | | | | If `project_auto_devops.enabled` is nil for a project, when setting any auto devops values via the API, we try to create a new row in the DB, instead of re-using the existing one. This leads to the project_id being set to nil, and the database `NOT NULL` constraint leading to a 500 response. This commit resolves the issue by correctly detecting the presence of a ProjectAutoDevops row and re-using it. Persistence is also moved away from explicit `update!` calls and into relying on `autosave: true` on the model.
* 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