gitlab-org--gitlab-foss/app/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
ci Fix spec failures 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 Resolve "Allow issue's Internal ID (`iid`) to be set when creating via the API" 2018-08-01 09:03:14 +00:00
conversational_development_index
diff_viewer
hooks Fixed pagination of web hook logs 2018-07-03 14:24:17 +02:00
issue
members Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
merge_request
network Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
project_services Fix couple of moments in HangoutsChatService and its spec 2018-07-14 20:45:53 +09:00
protected_branch
protected_tag
storage Gitlab::Shell works on shard name, not path 2018-04-25 13:36:22 +02:00
.gitkeep
ability.rb Backport of 4084-epics-username-autocomplete 2018-05-04 11:33:09 -06:00
abuse_report.rb
active_session.rb Display and revoke active sessions 2018-05-02 08:08:16 +00:00
appearance.rb allow uploading favicon in appearance settings 2018-06-05 16:20:18 +02:00
application_setting.rb Merge branch '41416-making-instance-wide-data-tools-more-accessible' into 'master' 2018-08-01 15:17:47 +00:00
audit_event.rb
award_emoji.rb
badge.rb Add validation to webhook and service URLs to ensure they are not blocked because of SSRF 2018-06-01 11:43:53 +00:00
blob.rb 26039 - update github-linguist to 5.3.3 version 2018-02-21 03:29:04 +10:30
board.rb Unify app/views/shared/issuable/_search_bar.html.haml 2018-07-05 17:27:30 +08:00
broadcast_message.rb Backport: Propagate broadcast messages to secondaries 2018-04-11 11:28:44 -07:00
chat_name.rb Expose ChatName objects to slash commands 2018-02-23 14:37:53 +01:00
chat_team.rb
commit.rb Preload pipeline data for project pipelines 2018-05-17 13:53:00 +02:00
commit_collection.rb
commit_range.rb
commit_status.rb Fix spec failures 2018-08-01 12:25:19 +02:00
compare.rb Remove unused Compare#base_commit 2018-03-08 11:39:50 -03:00
container_repository.rb
cycle_analytics.rb Refactors median code to work with both single and multiple projects 2018-02-28 10:46:20 +00:00
dashboard_milestone.rb
deploy_key.rb Revert the addition of goldiloader 2018-04-18 15:51:39 +02:00
deploy_keys_project.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.rb Rename the module and add a simple test to check 2018-07-27 17:52:45 +08:00
deployment.rb Remove unused `stop_action?` method from deployment class 2018-07-12 12:31:33 +02:00
diff_discussion.rb
diff_note.rb Persist truncated note diffs on a new table 2018-05-24 15:34:43 -03:00
directly_addressed_user.rb
discussion.rb Changes tab VUE refactoring 2018-06-21 12:22:40 +00:00
discussion_note.rb
email.rb fixes #47716 where email confirmation fails after adding additional emails 2018-07-25 16:15:04 +00:00
environment.rb Rename environments stop action method 2018-07-12 12:22:11 +02:00
epic.rb
event.rb Throttle updates to Project#last_repository_updated_at. 2018-05-29 12:51:32 +02:00
event_collection.rb
external_issue.rb Fix closing issues text added to MRs for external issue trackers 2018-02-14 14:58:28 +00:00
fork_network.rb Revert the addition of goldiloader 2018-04-18 15:51:39 +02:00
fork_network_member.rb
forked_project_link.rb
generic_commit_status.rb Add validation to webhook and service URLs to ensure they are not blocked because of SSRF 2018-06-01 11:43:53 +00:00
global_label.rb
global_milestone.rb Merge branch 'milestones-finder-order-fix' into 'security-10-3' 2018-01-16 17:04:38 -08:00
gpg_key.rb
gpg_key_subkey.rb
gpg_signature.rb
group.rb Revert "Merge branch 'ee-5481-epic-todos' into 'master'" 2018-07-11 18:33:24 +02:00
group_custom_attribute.rb
group_label.rb
group_milestone.rb
guest.rb
identity.rb Backport Identity.uniqueness_scope from EE 2018-05-02 14:36:47 +01:00
import_export_upload.rb Update Import/Export to use object storage (based on aa feature flag) 2018-07-06 15:46:18 +02:00
individual_note_discussion.rb
instance_configuration.rb
internal_id.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.rb Resource event model 2018-08-01 08:58:49 +00:00
issue_assignee.rb use Gitlab::UserSettings directly as a singleton instead of including/extending it 2018-02-02 18:39:55 +00:00
issue_collection.rb
key.rb Revert "Merge branch 'rd-43185-revert-sanitize-extra-blank-spaces-used-when-uploading-a-ssh-key' into 'master'" 2018-02-15 09:50:19 -05:00
label.rb Add ability to filter labels by title or description 2018-07-31 12:46:36 +03:00
label_link.rb
label_priority.rb
legacy_diff_discussion.rb
legacy_diff_note.rb
lfs_file_lock.rb Backport of LFS File Locking API 2018-02-07 09:04:00 -05:00
lfs_object.rb Fix file_store for artifacts and lfs when saving 2018-05-01 22:27:54 +02:00
lfs_objects_project.rb
list.rb Backport of "Add assignee lists to boards" 2018-06-07 20:54:24 +00:00
member.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
merge_request.rb Resource event model 2018-08-01 08:58:49 +00:00
merge_request_diff.rb Render MR page when no persisted diff_refs or diffs size 2018-07-18 10:53:19 +01:00
merge_request_diff_commit.rb [Rails5] Update `type_cast_*_database` methods 2018-04-06 10:57:19 +00:00
merge_request_diff_file.rb Persist truncated note diffs on a new table 2018-05-24 15:34:43 -03:00
merge_requests_closing_issues.rb
milestone.rb Fix ordering by name on milestones page 2018-07-30 11:01:55 -03:00
namespace.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
note.rb Show the status of a user in interactions 2018-07-30 15:01:26 +02:00
note_diff_file.rb Persist truncated note diffs on a new table 2018-05-24 15:34:43 -03:00
notification_reason.rb Initial work to add notification reason to emails 2018-01-16 19:17:55 -06:00
notification_recipient.rb Merge branch 'issue_44230' into 'master' 2018-06-07 20:10:45 +00:00
notification_setting.rb Allow to toggle notifications for issues due soon 2018-07-12 12:03:29 -03:00
oauth_access_grant.rb
oauth_access_token.rb
out_of_context_discussion.rb
pages_domain.rb Upgrade to Ruby 2.4.4 2018-05-29 15:19:33 -07:00
personal_access_token.rb
personal_snippet.rb Fix an N+1 in avatar URLs 2018-06-05 14:57:19 +01:00
programming_language.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
project.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
project_authorization.rb
project_auto_devops.rb Enforce setting string as value of the CI/CD variable 2018-06-25 14:48:34 +02:00
project_ci_cd_setting.rb Fix Project#group_runners_enabled as it was doing nothing 2018-05-03 14:37:19 +02:00
project_custom_attribute.rb
project_deploy_token.rb Increase test suite around deploy tokens behavior 2018-04-06 21:20:17 -05:00
project_feature.rb Added SiteStatistics as counter cache for Projects and Wikis 2018-07-24 18:44:07 +02:00
project_group_link.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
project_import_data.rb Upgrade to Ruby 2.4.4 2018-05-29 15:19:33 -07:00
project_import_state.rb Backports every CE related change from ee-44542 to CE 2018-05-04 17:33:26 +02:00
project_label.rb
project_snippet.rb
project_statistics.rb Update total storage size when changing size of artifacts 2018-07-27 17:21:41 +02:00
project_team.rb Resolve "Rename the `Master` role to `Maintainer`" Backend 2018-07-11 14:36:08 +00:00
project_wiki.rb Use limit parameter to retrieve Wikis from Gitaly 2018-07-24 15:36:31 -07:00
protectable_dropdown.rb
protected_branch.rb Rename master to maintainer 2018-06-06 20:57:14 +09:00
protected_ref_matcher.rb
protected_tag.rb
push_event.rb Last push widget will show banner for new pushes to previously merged branch 2018-01-15 16:45:56 -06:00
push_event_payload.rb
readme_blob.rb
redirect_route.rb Remove permanent redirects 2018-03-28 14:12:08 +02:00
release.rb
remote_mirror.rb Merge branch 'security-event-counters-private-data' into 'master' 2018-07-24 20:25:25 +00:00
repository.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
repository_language.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
resource_label_event.rb Resource event model 2018-08-01 08:58:49 +00:00
route.rb Remove permanent redirects 2018-03-28 14:12:08 +02:00
security_event.rb
sent_notification.rb Backport 5480-epic-notifications from EE 2018-05-07 12:58:47 -06:00
service.rb Add dummy Google Hangouts Chat integration 2018-07-14 20:45:04 +09:00
site_statistic.rb Document site statistics API 2018-07-24 18:44:08 +02:00
snippet.rb Show the status of a user in interactions 2018-07-30 15:01:26 +02:00
snippet_blob.rb
spam_log.rb
subscription.rb
system_note_metadata.rb Backport of 1481-changing-weight-values-should-trigger-system-notes 2018-05-03 11:18:51 -07:00
term_agreement.rb Messaging on terms page when user already accepted 2018-06-04 22:22:11 +02:00
timelog.rb Rails5 fix expected `issuable.reload.updated_at` to have changed 2018-06-13 07:52:35 +02:00
todo.rb Revert "Merge branch 'ee-5481-epic-todos' into 'master'" 2018-07-11 18:33:24 +02:00
tree.rb Migrate recursive tree entries fetching to Gitaly 2018-02-26 16:59:29 +01:00
trending_project.rb
u2f_registration.rb
upload.rb remove EE-only code 2018-03-22 13:00:58 -04:00
user.rb Merge branch 'bvl-user-status-message-35463' into 'master' 2018-08-01 15:21:24 +00:00
user_agent_detail.rb
user_callout.rb Resolve "Inform users of up to $500 offer for GCP account" 2018-05-07 18:06:02 +00:00
user_custom_attribute.rb
user_interacted_project.rb Shortcut and return on duplicate record error. 2018-03-06 12:53:15 +01:00
user_status.rb Show the status of a user in interactions 2018-07-30 15:01:26 +02:00
user_synced_attributes_metadata.rb Moved o_auth/saml/ldap modules under gitlab/auth 2018-02-28 16:53:02 +01:00
users_star_project.rb
wiki_directory.rb
wiki_page.rb Merge branch 'satishperala/gitlab-ce-20720_webhooks_full_image_url' into 'master' 2018-07-17 15:57:10 +00:00