summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow disabling group/project email notificationsBrett Walker2019-08-151-0/+7
| | | | | | - Adds UI to configure in group and project settings - Removes notification configuration for users when disabled at group or project level
* Remove code related to object hierarchy in MySQLremove-nested-groups-checksHeinrich Lee Yu2019-07-251-2/+0
| | | | | These are not required because MySQL is not supported anymore
* Merge branch 'dz-remove-old-ignore-column' into 'master'Robert Speicher2019-07-161-3/+0
|\ | | | | | | | | Remove old ignore_column in AR models See merge request gitlab-org/gitlab-ce!30725
| * 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>
* | Add Namespace#feature_available no-oprs-namespace-featureRobert Speicher2019-07-121-0/+5
|/ | | | | | This gets overridden in `EE::Namespace` and allows us to do things like always treat Epics as "disabled" in Core using the same checks we'd use elsewhere.
* Lesser Namespace#name validationsBob Van Landuyt2019-07-091-2/+1
| | | | | Since we use `Namespace#path` to build routes and URLs we can lessen the restrictions on `Namespace#name` so it can accomodate a user's name.
* Includes logic to persist namespace statisticsMayra Cabrera2019-07-021-0/+4
| | | | | | | | | | | | | | | | | | | | | - Add two new ActiveRecord models: - RootNamespaceStoragestatistics will persist root namespace statistics - NamespaceAggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled - Inject into UpdateProjectStatistics concern a new callback that will call an async job to insert a new row onto NamespaceAggregationSchedule table - When a new row is inserted a new job is scheduled. This job will update call an specific service to update the statistics and after that it will delete thee aggregated scheduled row - The RefresherServices makes heavy use of arel to build composable queries to update Namespace::RootStorageStatistics attributes. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows. - Add an extra worker to traverse pending rows on NAmespace::AggregationSchedule table and schedule a worker for each one of this rows
* Memoizing root_ancestor in NamespaceAdam Hegyi2019-07-021-1/+3
| | | | | | The root_ancestor method is heavily used in EE for the group_saml feature. Having this memoization implemented in CE would eliminate the need of overriding the root_ancestor method in EE.
* Add two new ActiveRecord models62214-migrations-and-modelsMayra Cabrera2019-06-251-0/+2
| | | | | | | | - Namespace::Storagestatistics will persist root namespace statistics - Namespace::AggregationSchedule will save information when a new update to the namespace statistics needs to be scheduled Both tables use 'namespace_id' as primary key
* Guarantee order of notification settingsWei-Meng Lee2019-05-311-2/+2
|
* Add wiki size to project statisticsPeter Marko2019-05-291-0/+1
|
* Add packages_size to ProjectStatisticsAlessio Caiazza2019-05-021-1/+2
| | | | | This new field will allow to keep track of the storage used by the packages features, it provides also aggregation at namespace level.
* Remove deprecated uses of attribute_changed?9932-fix-deprecated-attribute_changed-ceHeinrich Lee Yu2019-04-301-12/+16
| | | | Prepares us for upgrade to Rails 5.2
* Upgrade Rails to 5.1.6.1Jasper Maes2019-04-231-2/+4
| | | | Model.new.attributes now also returns encrypted attributes.
* Adds namespace information to project endpoint39858-add-group-owned-info-to-projects-apiMayra Cabrera2019-04-181-0/+5
| | | | | | | | | | | - Namespace now return avatar_url and web_url - NamespaceBasic entity was modified to include avatar_url and web_url, information is fetched differently depending if the Namespace is a user or a group Includes documentation changes Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39858
* Enable/disable Auto DevOps at Group levelMayra Cabrera2019-03-121-0/+17
| | | | | | | | | | | | - Includes instance methods on Group model to detect when a group has AutoDevOps explicitly/implicitly enabled/disabled. - Includes migration to add a new column to namespaces table - Add UI necessary modifications - Add service and controller to update auto devops related instances - Updates project and groups auto devops badges Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52447
* Adds the Rubocop ReturnNil copAndrew Newdigate2019-03-061-1/+1
| | | | | This style change enforces `return if ...` instead of `return nil if ...` to save maintainers a few minor review points
* Add query method for id queryMark Chao2019-01-151-1/+1
|
* Update storage location after a group has been renamed/transferedDouglas Barbosa Alexandre2018-12-211-0/+1
|
* Rename GroupHierarchy into ObjectHierarchyJarka Košanová2018-12-191-8/+8
| | | | | | - we now use the hierarchy class also for epics - also rename supports_nested_groups? into supports_nested_objects? - move it to a concern
* Remove unnecessary includes of ShellAdapterStan Hu2018-12-051-1/+0
| | | | | | | | | | Determined by running the script: ``` included = `git grep --name-only ShellAdapter`.chomp.split("\n") used = `git grep --name-only gitlab_shell`.chomp.split("\n") included - used ```
* Unify into :group_clusters feature flagThong Kuah2018-12-051-1/+1
| | | | | | | With this MR, group clusters is now functional, so default to enabled. Have a single setting on the root ancestor group to enabled or disable group clusters feature as a whole
* Various improvements to hierarchy sortingThong Kuah2018-12-051-2/+2
| | | | | | | | | - Rename ordered_group_clusters_for_project -> ancestor_clusters_for_clusterable - Improve name of order option. It makes much more sense to have `hierarchy_order: :asc` and `hierarchy_order: :desc` - Allow ancestor_clusters_for_clusterable for group - Re-use code already present in Project
* Eliminate duplicated wordsTakuya Noguchi2018-11-221-1/+1
| | | | Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
* Backport generic methods to CEce-fix_vuln_list_on_group_dashboardOlivier Gonzalez2018-11-051-0/+6
| | | | | | | Allow to fetch all pipelines for every projects in a group and its subgroups. Allow to fetch the latest pipeline id for each projects of a group and its subgroups.
* Fix typos in comments and specsGeorge Tsiolis2018-11-011-1/+1
|
* Improve logging when username update fails due to registry tagsStan Hu2018-10-021-0/+4
| | | | | When a user cannot be renamed due to existing container registry tags, log the namespace and an example project that has tags.
* Use `Gitlab::SafeRequestStore` in more placesMichael Kozono2018-09-241-2/+2
| | | | | | Even if it doesn’t save lines of code, since people will tend to use code they’ve seen. And `SafeRequestStore` is safer since you don’t have to remember to check `RequestStore.active?`.
* Added FromUnion to easily select from a UNIONYorick Peterse2018-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the module `FromUnion`, which provides the class method `from_union`. This simplifies the process of selecting data from the result of a UNION, and reduces the likelihood of making mistakes. As a result, instead of this: union = Gitlab::SQL::Union.new([foo, bar]) Foo.from("(#{union.to_sql}) #{Foo.table_name}") We can now write this instead: Foo.from_union([foo, bar]) This commit also includes some changes to make this new setup work properly. For example, a bug in Rails 4 (https://github.com/rails/rails/issues/24193) would break the use of `from("sub-query-here").includes(:relation)` in certain cases. There was also a CI query which appeared to repeat a lot of conditions from an outer query on an inner query, which isn't necessary. Finally, we include a RuboCop cop to ensure developers use this new module, instead of using Gitlab::SQL::Union directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
* Refactor code to remove object storage flag from Import/ExportJames Lopez2018-09-061-12/+0
| | | | | | Updated docs, refactor import/export code Fix AvatarUploader path issue Fix project export upload webhook error
* Add Acceptance testing issue templateZeger-Jan van de Weg2018-08-151-1/+1
|
* Merge branch 'frozen-string-enable-app-models' into 'master'Rémy Coutable2018-08-021-0/+2
|\ | | | | | | | | Enable frozen string in app/models/*.rb See merge request gitlab-org/gitlab-ce!20851
| * Enable frozen string in app/models/*.rbrepo-forks/gitlab-ce-frozen-string-enable-app-modelsgfyoung2018-07-261-0/+2
| | | | | | | | Partially addresses #47424.
* | Add repository languages for projectsZeger-Jan van de Weg2018-08-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our friends at GitHub show the programming languages for a long time, and inspired by that this commit means to create about the same functionality. Language detection is done through Linguist, as before, where the difference is that we cache the result in the database. Also, Gitaly can incrementaly scan a repository. This is done through a shell out, which creates overhead of about 3s each run. For now this won't be improved. Scans are triggered by pushed to the default branch, usually `master`. However, one exception to this rule the charts page. If we're requesting this expensive data anyway, we just cache it in the database. Edge cases where there is no repository, or its empty are caught in the Repository model. This makes use of Redis caching, which is probably already loaded. The added model is called RepositoryLanguage, which will make it harder if/when GitLab supports multiple repositories per project. However, for now I think this shouldn't be a concern. Also, Language could be confused with the i18n languages and felt like the current name was suiteable too. Design of the Project#Show page is done with help from @dimitrieh. This change is not visible to the end user unless detections are done.
* | Remove code for dynamically generating routesstop-dynamic-routable-creationYorick Peterse2018-07-251-1/+0
|/ | | | | | This adds a database migration that creates routes for any projects and namespaces that don't already have one. We also remove the runtime code for dynamically creating routes, as this is no longer necessary.
* Port Namespace#root_ancestor to CELin Jen-Shin2018-06-261-0/+4
|
* Add `Ci::Runner` inverse_of'sKamil Trzciński2018-05-311-1/+1
|
* Merge branch '4084-epics-username-autocomplete-ce' into 'master'Douwe Maan2018-05-071-0/+7
|\ | | | | | | | | Backport CE changes from "autocomplete usernames in Epic comments/description" See merge request gitlab-org/gitlab-ce!18605
| * Backport of 4084-epics-username-autocompleteMario de la Ossa2018-05-041-0/+7
| |
* | Rename RunnerGroup -> RunnerNamespaceDylan Griffith2018-05-021-0/+3
|/
* Get GITLAB_FEATURES from Project#licensed_features instead of ↵5320-fix-gitlab-features-env-varDylan Griffith2018-04-091-4/+0
| | | | Namespace#features (#5320)
* Extend API for importing a project export with overwrite supportFrancisco Javier López2018-04-061-0/+4
|
* Fix a typo, a conflict and improve documentationissue_38337Felipe Artur2018-03-061-1/+1
|
* Bring one group board to CEFelipe Artur2018-03-031-0/+5
|
* Expose GITLAB_FEATURES as CI/CD variable (fixes #40994)40994-expose-features-as-ci-cd-variableDylan Griffith2018-02-071-0/+4
|
* Validate path uniqueness only on Route, and bubble up appropriatelyDouwe Maan2018-02-061-1/+0
|
* Validate user namespace before saving so that errors persist on modeldm-user-namespace-route-path-validationDouwe Maan2018-02-061-0/+3
|
* 31885 - Ability to transfer a single group to another groupMayra Cabrera2018-02-061-15/+11
|
* Fix export removal for hashed-storage projects within a renamed or deleted ↵Nick Thomas2018-02-051-0/+18
| | | | namespace
* use Gitlab::UserSettings directly as a singleton instead of ↵Mario de la Ossa2018-02-021-1/+0
| | | | including/extending it