gitlab-ce/spec/models
Zeger-Jan van de Weg 79a5d76801
Add repository languages for projects
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.
2018-08-01 18:58:29 +02:00
..
application_setting Messaging on terms page when user already accepted 2018-06-04 22:22:11 +02:00
badges Projects and groups badges API 2018-03-05 17:51:40 +00:00
blob_viewer Bump Gitaly to 0.98.0 2018-05-07 14:10:04 +02:00
ci Add specs for unsupported runner 2018-08-01 12:25:19 +02:00
clusters Revert "Merge branch '48098-mutual-auth-cluster-applications' into 'master'" 2018-07-31 13:15:18 +00:00
concerns Remove code for dynamically generating routes 2018-07-25 16:41:29 +02:00
conversational_development_index Store & use ConvDev percentages returned by Version app 2017-08-07 20:52:08 +02:00
cycle_analytics Adapt cycle analytics spec helper and cycle analytics usage data spec 2018-03-01 16:43:26 +00:00
diff_viewer Batchload blobs for diff generation 2017-11-21 13:53:26 +01:00
hooks Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
issue Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
members Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
merge_request Cache merged and closed events data in merge_request_metrics table 2018-01-02 17:45:25 -02:00
network Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
project_services Fix Hangouts Chat service spec shared example 2018-07-18 20:14:55 +09:00
protected_branch Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
ability_spec.rb Remove edit_note and update_note abilities in favor of admin_note 2018-04-10 15:46:20 +02:00
abuse_report_spec.rb Optimize a few simple spec files by using `set` 2017-09-13 13:35:18 +02:00
active_session_spec.rb Display and revoke active sessions 2018-05-02 08:08:16 +00:00
appearance_spec.rb Use the new CacheableAttributes concern in the ApplicationSetting and Appearance models 2018-05-23 16:14:43 +02:00
application_setting_spec.rb Ignore unknown OAuth sources in ApplicationSetting 2018-06-26 09:34:08 +02:00
award_emoji_spec.rb Merge branch 'master' into issue-discussions-refactor 2017-07-31 10:23:50 +02:00
badge_spec.rb Projects and groups badges API 2018-03-05 17:51:40 +00:00
blob_spec.rb Batchload blobs for diff generation 2017-11-21 13:53:26 +01:00
board_spec.rb
broadcast_message_spec.rb Backport: Propagate broadcast messages to secondaries 2018-04-11 11:28:44 -07:00
chat_name_spec.rb Expose ChatName objects to slash commands 2018-02-23 14:37:53 +01:00
chat_team_spec.rb Optimize a few simple spec files by using `set` 2017-09-13 13:35:18 +02:00
commit_collection_spec.rb Optimise getting the pipeline status of commits 2017-11-16 16:01:14 +01:00
commit_range_spec.rb Only search for MR revert commits on notes after MR was merged 2018-01-12 13:19:05 +00:00
commit_spec.rb Client-side fix for Gitaly TreeEntry bug 2018-06-26 14:12:08 +02:00
commit_status_spec.rb Respect the inheritance chain between Ci::Build and CommitStatus 2018-05-16 15:59:51 -05:00
compare_spec.rb Remove unused Compare#base_commit 2018-03-08 11:39:50 -03:00
container_repository_spec.rb Prevent new / renamed project from using a repository path that already exists on disk 2017-08-25 20:06:06 +02:00
cycle_analytics_spec.rb Adapt cycle analytics spec helper and cycle analytics usage data spec 2018-03-01 16:43:26 +00:00
deploy_key_spec.rb Fall back on ghost user when deploy key user is not set 2018-03-28 18:54:15 +02:00
deploy_keys_project_spec.rb Merge branch 'sh-migrate-can-push-to-deploy-keys-projects-10-3' into 'security-10-3' 2018-01-16 17:04:51 -08:00
deploy_token_spec.rb Resolve "Deploy Tokens failed to clone LFS repository" 2018-07-23 09:23:08 +00:00
deployment_spec.rb Remove unused `stop_action?` method from deployment class 2018-07-12 12:31:33 +02:00
diff_discussion_spec.rb Fix links to old commits in merge requests 2017-12-29 14:44:39 +01:00
diff_note_spec.rb Persist truncated note diffs on a new table 2018-05-24 15:34:43 -03:00
discussion_spec.rb Remove superfluous type defs in specs 2017-07-27 14:31:52 +02:00
email_spec.rb remove extra whitespace 2017-10-27 17:35:40 +02:00
environment_spec.rb Rename environments stop action method 2018-07-12 12:22:11 +02:00
event_collection_spec.rb Use a specialized class for querying events 2017-08-10 17:45:49 +02:00
event_spec.rb Throttle updates to Project#last_repository_updated_at. 2018-05-29 12:51:32 +02:00
external_issue_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
fork_network_member_spec.rb Delete the fork network when removing the last membership 2017-11-17 12:58:15 +01:00
fork_network_spec.rb Unlink a project from a fork network when it's source was deleted. 2017-11-03 12:17:59 +01:00
forked_project_link_spec.rb Add a project forks spec helper 2017-10-07 11:46:23 +02:00
generic_commit_status_spec.rb Respect the inheritance chain between Ci::Build and CommitStatus 2018-05-16 15:59:51 -05:00
global_milestone_spec.rb Move total time spend calculation to milestoneish 2017-11-11 16:47:39 +02:00
gpg_key_spec.rb Invalidate GpgSignatures associated to GpgKeySubkeys when revoking the GpgKey 2017-10-05 08:26:02 -05:00
gpg_key_subkey_spec.rb Add some basic specs and refactor model and validations 2017-10-05 08:25:27 -05:00
gpg_signature_spec.rb Fix error with GPG signature updater when commit was deleted 2017-10-07 10:47:53 -05:00
group_custom_attribute_spec.rb Support custom attributes on groups 2017-11-06 10:51:50 +01:00
group_label_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
group_milestone_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
group_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
guest_spec.rb Add a unique and not null constraint on the project_features.project_id column 2018-05-15 14:20:14 +02:00
identity_spec.rb Fixed user synced attributes metadata after removing current provider 2018-02-15 09:27:38 +00:00
import_export_upload_spec.rb Update Import/Export to use object storage (based on aa feature flag) 2018-07-06 15:46:18 +02:00
instance_configuration_spec.rb Added ssh fingerprint, gitlab ci and pages information in an instance configuration page 2017-10-25 23:51:26 +03:00
internal_id_spec.rb Resolve "Allow issue's Internal ID (`iid`) to be set when creating via the API" 2018-08-01 09:03:14 +00:00
issue_collection_spec.rb Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
issue_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
key_spec.rb Validate SSH keys through the sshkey gem 2018-02-16 11:32:08 -05:00
label_link_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
label_priority_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
label_spec.rb Add specs for label search backend code 2018-07-31 12:46:37 +03:00
legacy_diff_discussion_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
lfs_file_lock_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
lfs_object_spec.rb Fix file_store for artifacts and lfs when saving 2018-05-01 22:27:54 +02:00
lfs_objects_project_spec.rb Fix syntax error in LFS objects specs 2017-09-13 13:35:18 +02:00
list_spec.rb Adjust tests to work with latest shoulda gem 2017-07-24 19:26:15 +03:00
member_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
merge_request_diff_commit_spec.rb [Rails5] Update `type_cast_*_database` methods 2018-04-06 10:57:19 +00:00
merge_request_diff_file_spec.rb Remove superfluous type defs in specs 2017-07-27 14:31:52 +02:00
merge_request_diff_spec.rb Render MR page when no persisted diff_refs or diffs size 2018-07-18 10:53:19 +01:00
merge_request_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
milestone_spec.rb Fix ordering by name on milestones page 2018-07-30 11:01:55 -03:00
namespace_spec.rb Merge branch 'stop-dynamic-routable-creation' into 'master' 2018-07-27 13:51:04 +00:00
note_diff_file_spec.rb Persist truncated note diffs on a new table 2018-05-24 15:34:43 -03:00
note_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
notification_recipient_spec.rb Apply notification settings level of groups to all child objects 2018-06-07 15:47:39 -03:00
notification_setting_spec.rb Allow to toggle notifications for issues due soon 2018-07-12 12:03:29 -03:00
pages_domain_spec.rb Add HTTPS-only pages 2018-03-22 19:58:36 +01:00
personal_access_token_spec.rb Fix new personal access token showing up in a flash message 2017-12-07 16:22:37 -06:00
programming_language_spec.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
project_authorization_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
project_auto_devops_spec.rb Merge remote-tracking branch 'origin/master' into 38542-application-control-panel-in-settings-page 2018-06-07 20:27:30 +02:00
project_ci_cd_setting_spec.rb Introduce new ProjectCiCdSetting 2018-04-16 14:05:35 +02:00
project_custom_attribute_spec.rb Support custom attributes on projects 2017-11-06 10:51:46 +01:00
project_deploy_token_spec.rb Addresses database comments 2018-04-06 21:20:17 -05:00
project_feature_spec.rb Added SiteStatistics as counter cache for Projects and Wikis 2018-07-24 18:44:07 +02:00
project_group_link_spec.rb Use the DatabaseCleaner 'deletion' strategy instead of 'truncation' 2018-01-24 17:25:55 +00:00
project_import_state_spec.rb Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
project_label_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
project_snippet_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
project_spec.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
project_statistics_spec.rb Update total storage size when changing size of artifacts 2018-07-27 17:21:41 +02:00
project_team_spec.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
project_wiki_spec.rb Merge remote-tracking branch 'upstream/master' into 14995-custom_wiki_sidebar 2018-07-13 17:34:27 +08:00
protectable_dropdown_spec.rb Whitelist or fix additional `Gitlab/PublicSend` cop violations 2017-08-14 12:14:11 -04:00
protected_branch_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
protected_tag_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
push_event_payload_spec.rb Migrate events into a new format 2017-08-10 17:45:44 +02:00
push_event_spec.rb Last push widget will show banner for new pushes to previously merged branch 2018-01-15 16:45:56 -06:00
redirect_route_spec.rb Fix conflicting redirect search 2017-08-08 10:30:07 -07:00
release_spec.rb Remove superfluous type defs in specs 2017-07-27 14:31:52 +02:00
remote_mirror_spec.rb Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
repository_language_spec.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
repository_spec.rb More Gitaly cleanup: fetch_ref, allow disk access blocks 2018-07-27 08:43:19 +00:00
resource_label_event_spec.rb Resource event model 2018-08-01 08:58:49 +00:00
route_spec.rb Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
sent_notification_spec.rb Don't show an "Unsubscribe" link in snippet comment notifications 2017-10-09 15:03:05 +02:00
service_spec.rb Updates from `rubocop -a` 2018-07-09 21:13:08 +08:00
site_statistic_spec.rb Added SiteStatistics as counter cache for Projects and Wikis 2018-07-24 18:44:07 +02:00
snippet_blob_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
snippet_spec.rb Use fuzzy search with minimum length of 3 characters where appropriate 2017-11-27 11:29:40 +01:00
spam_log_spec.rb Replace 'Sidekiq::Testing.inline!' with 'perform_enqueued_jobs' 2018-07-23 15:34:54 +11:00
subscription_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
system_note_metadata_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
term_agreement_spec.rb Messaging on terms page when user already accepted 2018-06-04 22:22:11 +02:00
timelog_spec.rb Resolve "Update `updated_at` on an issue/mr on every issue/mr changes" 2018-06-01 15:09:08 +00:00
todo_spec.rb Revert "Merge branch 'ee-5481-epic-todos' into 'master'" 2018-07-11 18:33:24 +02:00
tree_spec.rb Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true 2017-07-27 14:31:53 +02:00
trending_project_spec.rb Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
upload_spec.rb Revert "Merge branch '3867-port-to-ce' into 'master'" 2018-02-28 21:09:34 +01:00
user_agent_detail_spec.rb Remove superfluous type defs in specs 2017-07-27 14:31:52 +02:00
user_callout_spec.rb Change UserCallout feautre_name to enum 2018-02-03 00:18:25 +01:00
user_custom_attribute_spec.rb Support custom attributes on users 2017-09-28 16:49:42 +00:00
user_interacted_project_spec.rb Operate on ids to avoid unnecessary loading. 2018-03-06 12:53:15 +01:00
user_spec.rb Merge branch 'bvl-user-status-message-35463' into 'master' 2018-08-01 15:21:24 +00:00
user_status_spec.rb Allow users to set a status 2018-07-30 15:01:26 +02:00
wiki_directory_spec.rb Use described_class when possible 2017-07-27 14:31:53 +02:00
wiki_page_spec.rb Simplify WikiPage#hook_attrs spec 2018-07-17 10:38:09 +01:00