gitlab-org--gitlab-foss/lib/gitlab
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
..
auth Merge branch 'feature/gb/login-activity-metrics' into 'master' 2018-07-31 10:44:22 +00:00
background_migration Use schedulers and delete diff files upon deadtuples check 2018-07-10 10:25:48 -03:00
badge
bare_repository_import Gitlab::Shell works on shard name, not path 2018-04-25 13:36:22 +02:00
bitbucket_import Use shard name in Git::GitlabProjects instead of shard path 2018-04-03 16:22:13 +02:00
cache Add docs for RequestCache, moved from comments 2018-06-22 18:18:42 +08:00
checks Improves remote message when a developer is unable to push in an empty repository 2018-07-18 09:25:00 +01:00
ci Improve error message 2018-08-01 12:58:33 +02:00
cleanup Add local project uploads cleanup task 2018-07-31 11:09:42 -07:00
conflict Fix 500 error when trying to resolve non-ASCII conflicts in editor 2018-03-23 18:33:14 +00:00
cross_project_access
cycle_analytics Migrate CycleAnalytics::CommitCount to Gitaly 2018-06-11 12:59:11 +00:00
data_builder Remove the use of is_shared of Ci::Runner 2018-06-26 15:53:09 +02:00
database Merge branch 'add-rename-column-background-helper' into 'master' 2018-06-26 14:38:52 +00:00
dependency_linker
diff Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
downtime_check
email Merge branch 'security-event-counters-private-data' into 'master' 2018-07-24 20:25:25 +00:00
etag_caching Fix flash errors in performance bar for cached responses 2018-04-17 11:50:27 +01:00
fogbugz_import Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
gfm add support for file copy on object storage 2018-07-03 09:57:15 -07:00
git More Gitaly cleanup: fetch_ref, allow disk access blocks 2018-07-27 08:43:19 +00:00
gitaly_client Use limit parameter to retrieve Wikis from Gitaly 2018-07-24 15:36:31 -07:00
github_import Don't expose project names in various counters 2018-06-21 16:56:40 +02:00
gitlab_import Fix gitlab import project load 2018-07-23 07:52:15 +00:00
google_code_import Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
gpg Updates from rubocop -a 2018-07-09 21:13:08 +08:00
grape_logging Enforce UTF-8 encoding on user input in LogrageWithTimestamp formatter and filter out file content from logs 2018-06-06 22:25:20 +02:00
graphql Add mutation toggling WIP state of merge requests 2018-07-25 18:37:12 +02:00
graphs Show one digit after dot in commit_per_day value in charts page. 2018-07-30 03:37:47 +03:00
hashed_storage Resolve "Hashed Storage: Make possible to migrate single project" 2018-06-07 15:40:44 +00:00
health_checks Gitaly metrics check for read/writeability 2018-06-27 08:56:19 +02:00
hook_data Keep #absolute_image_urls as a private instance method 2018-07-17 14:58:14 +01:00
i18n Correctly translate all forms in tests 2018-06-15 14:58:47 +02:00
import_export Add repository languages for projects 2018-08-01 18:58:29 +02:00
kubernetes Revert "Merge branch '48098-mutual-auth-cluster-applications' into 'master'" 2018-07-31 13:15:18 +00:00
legacy_github_import Use Github repo visibility during import while respecting restricted visibility levels 2018-06-06 12:00:15 +02:00
manifest_import Improve manifest feature after backend review 2018-07-11 12:22:57 +03:00
metrics Add a 10 ms bucket for SQL timings 2018-07-10 15:59:30 +02:00
middleware Use /-/health instead of breaking /-/liveness 2018-07-28 14:35:02 -07:00
performance_bar
popen
profiler Add a Gitlab::Profiler.print_by_total_time convenience method 2018-07-19 16:00:27 +01:00
project_authorizations Resolve "Rename the Master role to Maintainer" Backend 2018-07-11 14:36:08 +00:00
prometheus Updates CE backport 2018-07-25 09:39:39 +01:00
query_limiting Make ActiveRecordSubscriber rails 5 compatible 2018-05-31 15:02:45 +02:00
quick_actions Resolve "Quick actions are case sensitive" 2018-06-13 10:23:57 +00:00
redis Display and revoke active sessions 2018-05-02 08:08:16 +00:00
request_profiler
sanitizers
search Implement filtering by filename on code search 2018-06-19 09:30:09 -06:00
serializer Fix deserializing yaml variables in imported projects 2018-07-19 14:00:35 +02:00
sherlock
sidekiq_logging Add support for Sidekiq JSON logging 2018-04-04 05:04:00 -07:00
sidekiq_middleware Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
sidekiq_status
sidekiq_versioning
slash_commands Correct "autorize" typos 2018-06-27 15:16:18 -05:00
sql Add Gitlab::SQL:CTE for easily building CTE statements 2018-06-11 12:44:08 -03:00
storage_check
template
testing
utils Also verify if extending would override a class method 2018-06-05 13:40:52 +08:00
verify Avoid N+1 queries while processing uploads 2018-06-20 10:38:17 -07:00
view/presenter Resolve "Show failure_reason in jobs view content section" 2018-04-19 07:20:53 +00:00
webpack Fix various bugs related to relative_url_root in development 2018-05-29 15:03:14 +02:00
access.rb Resolve "Rename the Master role to Maintainer" Backend 2018-07-11 14:36:08 +00:00
action_rate_limiter.rb
allowable.rb
app_logger.rb
asciidoc.rb
auth.rb Disable SAML if OmniAuth is disabled 2018-07-20 18:54:46 +08:00
background_migration.rb
base_doorkeeper_controller.rb Define custom base controller for Doorkeeper 2018-04-30 11:40:51 +02:00
blame.rb
build_access.rb Allow triggered builds git access 2018-05-11 15:20:11 +02:00
changes_list.rb
chat_name_token.rb
ci_access.rb
closing_issue_extractor.rb
color_schemes.rb
config_helper.rb
contributions_calendar.rb Replace .having with .where in calendar query 2018-05-30 20:33:25 +02:00
contributor.rb
cross_project_access.rb
current_settings.rb Updates from rubocop -a 2018-07-09 21:13:08 +08:00
daemon.rb Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
database.rb Backport various EE changes to Gitlab::Database 2018-07-24 13:25:01 +02:00
dependency_linker.rb
downtime_check.rb
ee_compat_check.rb Find the EE branch by searching the branches 2018-07-11 01:49:35 +08:00
emoji.rb
encoding_helper.rb Resolve Naming/UncommunicativeMethod 2018-07-09 21:13:08 +08:00
environment.rb
environment_logger.rb
exclusive_lease.rb Add rake task to cleanup any existing exclusive lease 2018-03-09 13:32:18 +00:00
exclusive_lease_helpers.rb Remove useless return 2018-07-09 21:13:08 +08:00
fake_application_settings.rb
favicon.rb Read asset host from ActionController::Base instead of application config 2018-06-29 11:22:51 +02:00
file_detector.rb Fix Xcode project detection by looking for dirs instead of files 2018-05-22 12:09:53 +02:00
file_finder.rb Implement filtering by filename on code search 2018-06-19 09:30:09 -06:00
git.rb Remove Gitlab::Popen dependency from lib/gitlab/git 2018-06-08 11:16:21 +02:00
git_access.rb Backport some changes from EE 2018-07-09 12:32:37 -05:00
git_access_wiki.rb
git_logger.rb
git_post_receive.rb Code cleaning in PostReceive services 2018-07-31 14:07:24 +00:00
git_ref_validator.rb Use rugged to validate ref name 2018-07-19 12:23:46 +02:00
gitaly_client.rb Remove timeouts for long running requests 2018-07-24 13:56:28 +02:00
github_import.rb
gl_id.rb Fix Custom hooks are not triggered by UI wiki edit 2018-04-18 17:50:56 +00:00
gl_repository.rb
gon_helper.rb Fix various bugs related to relative_url_root in development 2018-05-29 15:03:14 +02:00
gpg.rb Permit concurrent loads in gpg keychain mutex 2018-07-29 15:12:52 +02:00
graphql.rb Handle exceptions outside the GraphQL schema 2018-06-05 20:47:42 +02:00
group_hierarchy.rb
highlight.rb
http.rb Raise more descriptive errors when URLs are blocked 2018-04-02 17:20:01 +02:00
http_io.rb Access metadata directly from Object Storage 2018-07-09 14:19:52 +02:00
i18n.rb Add Polish as a supported language 2018-06-15 14:58:47 +02:00
identifier.rb
import_export.rb Update Import/Export to use object storage (based on aa feature flag) 2018-07-06 15:46:18 +02:00
import_formatter.rb Import bitbucket issues that are reported by an anonymous user 2018-05-24 13:28:58 +02:00
import_sources.rb EE Port 2018-07-20 19:25:10 -04:00
incoming_email.rb Add anchor for incoming email regex, closes 44989 2018-05-11 14:51:21 -07:00
insecure_key_fingerprint.rb
issuable_metadata.rb
issuable_sorter.rb
issuables_count_for_state.rb
issues_labels.rb
job_waiter.rb
json_logger.rb Bring JsonLogger to CE 2018-07-20 12:50:20 -07:00
kubernetes.rb Fix an exception seen using the online terminal 2018-07-11 15:44:34 +01:00
language_detection.rb Add repository languages for projects 2018-08-01 18:58:29 +02:00
lazy.rb
lfs_token.rb
logger.rb Backport logger changes from EE 2018-07-13 14:52:32 -07:00
mail_room.rb Updates from rubocop -a 2018-07-09 21:13:08 +08:00
markup_helper.rb
metrics.rb
multi_collection_paginator.rb [Rails5] Fix per_page in lib/gitlab/multi_collection_paginator.rb 2018-05-11 13:36:38 +11:00
omniauth_initializer.rb Disable SAML if OmniAuth is disabled 2018-07-20 18:54:46 +08:00
optimistic_locking.rb Resolve "Make a Rubocop that forbids returning from a block" 2018-04-18 09:19:40 +00:00
other_markup.rb
otp_key_rotator.rb
pages.rb
pages_client.rb Add gitlab-pages admin ping rake task 2018-04-27 11:01:54 +00:00
pages_transfer.rb
path_regex.rb Redirect favicon.(png|ico) to actual favicon asset or upload 2018-06-18 12:27:00 +02:00
performance_bar.rb Always allow the performance bar to be enabled for admins 2018-04-02 14:19:19 -05:00
plugin.rb
plugin_logger.rb
polling_interval.rb
popen.rb Avoid process deadlock in popen by consuming input pipes 2018-07-12 16:21:30 -07:00
profiler.rb Add a Gitlab::Profiler.print_by_total_time convenience method 2018-07-19 16:00:27 +01:00
project_search_results.rb Fixing bug with wiki ref in ProjectSearchResults 2018-07-20 13:49:30 +00:00
project_template.rb Resolve "Reconcile project templates with Auto DevOps" 2018-05-04 09:48:53 +00:00
project_transfer.rb Fix moving local files during namespace transfer 2018-03-13 14:45:17 -07:00
prometheus_client.rb
protocol_access.rb
proxy_http_connection_adapter.rb Rename allow_private_networks to allow_local_network 2018-04-02 17:24:19 +02:00
query_limiting.rb
recaptcha.rb
reference_counter.rb
reference_extractor.rb
regex.rb Add documentation and specs for webhook URL rewriting 2018-07-06 11:35:30 +01:00
repo_path.rb Remove Gitlab::RepoPath.strip_storage_path 2018-05-11 13:57:43 +02:00
repository_cache.rb
repository_cache_adapter.rb Expire correct method caches after HEAD changed 2018-06-29 17:41:57 +02:00
repository_check_logger.rb
request_context.rb
request_forgery_protection.rb [Rails5] Force the protect_from_forgery callback run first 2018-06-21 21:44:31 +11:00
request_profiler.rb
route_map.rb
routing.rb
search_results.rb Fix code and wiki search results when filename is non-ASCII 2018-03-12 10:43:13 +00:00
seeder.rb
sentry.rb Method to track recoverable exceptions in sentry 2018-04-17 11:39:23 +02:00
setup_helper.rb More gitaly disk access blocks 2018-06-20 09:33:50 +00:00
shard_health_cache.rb Bring Gitlab::ShardHealthCache to CE 2018-06-27 21:43:23 +02:00
shell.rb Use Gitaly for fetches and creating bundles 2018-07-09 12:50:17 +02:00
shell_adapter.rb
sherlock.rb
sidekiq_config.rb
sidekiq_logger.rb
sidekiq_status.rb
sidekiq_throttler.rb
sidekiq_versioning.rb
snippet_search_results.rb
ssh_public_key.rb
storage_check.rb
string_placeholder_replacer.rb
string_range_marker.rb
string_regex_marker.rb
task_helpers.rb Find and mark more Git disk access locations, part 2 2018-06-12 14:33:37 +02:00
tcp_checker.rb
template_helper.rb Code review comments applied 2018-07-25 09:07:47 -04:00
temporarily_allow.rb Add "deny disk access" Gitaly feature (tripswitch) 2018-06-01 11:56:29 +00:00
themes.rb Restore navigation theme order 2018-06-07 12:24:57 +00:00
time_tracking_formatter.rb
timeless.rb
untrusted_regexp.rb Simplify untrusted regexp factory method 2018-05-18 10:14:10 +02:00
update_path_error.rb
upgrader.rb
uploads_transfer.rb
url_blocker.rb Avoid checking the user format in every url validation 2018-06-11 13:29:37 +00:00
url_builder.rb Sidebar Milestone - Fix wrong URL when selecting a parent group milestone 2018-06-12 17:22:12 -06:00
url_sanitizer.rb Escape username and password in UrlSanitizer#full_url 2018-07-19 03:14:07 -07:00
usage_data.rb Disable SAML if OmniAuth is disabled 2018-07-20 18:54:46 +08:00
user_access.rb Rephrase "maintainer" to more precise "members who can merge to the target branch" 2018-06-01 14:33:12 +09:00
utils.rb Backport of EE !4989 2018-04-11 22:05:07 -05:00
version_info.rb
visibility_level.rb
wiki_file_finder.rb Add ability to search wiki titles 2018-06-04 11:41:37 +00:00
workhorse.rb Remove last flags from Blob and Workhorse 2018-07-11 12:59:15 +02:00