gitlab-org--gitlab-foss/lib/gitlab
Rémy Coutable 8bdb5b6aec Merge branch '1548-average-commits-per-day' into 'master'
Fix: Infinity Bug in Commit Statistics

## What does this MR do?

It fixes a logic bug in the commits statistics: The code assumed that the amount of days involved in a commit range is equal to the difference between the first and last date. This is not true, though, as (from a human standpoint), a commit yesterday and a commit today involve two days, not one. Similarly, a fresh project with only commits made today already 'used' one day.

Since the number of involved days used to be zero for new projects, the result for commits per day quite often amounted to `Infinity`…

## Are there points in the code the reviewer needs to double check?

The test file. I hope it is up to the standards of GitLab.

## Why was this MR needed?

The bug occurres especially for new users with their first project while exploring GitLab.

## What are the relevant issue numbers?

This bug was reported as #1548.

## Screenshots (if relevant)

See merge request !4231
2016-07-08 15:20:22 +00:00
..
auth Fix tests 2016-06-06 17:40:26 +02:00
backend Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
badge Extend build status badge, add html/markdown methods 2016-04-06 19:56:34 +02:00
bitbucket_import Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
ci Add minor improvements in readability in CI config 2016-07-04 18:36:06 +02:00
database Fix update_column_in_batches to update all rows 2016-06-17 17:50:38 +02:00
diff Remove duplication, unused methods, and some other style things 2016-07-06 19:29:41 -04:00
email Allow reply-by-email with diff notes 2016-07-06 18:51:00 -04:00
fogbugz_import Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
gfm Remove reduntant move_to_store override 2016-03-30 12:50:19 +02:00
git Merge branch '18627-wildcard-branch-protection' into 'master' 2016-07-07 22:37:30 +00:00
github_import Rename MergeRequest methods that return commits or shas to be more clear and consistent 2016-07-06 18:50:58 -04:00
gitlab_import adding notifications stuff and more refactoring for exporting projects 2016-06-14 16:31:03 +02:00
gitorious_import
google_code_import Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
graphs Infinity Bug in Commit Statistics 2016-05-20 22:23:08 +02:00
import_export fix log statements in import/export 2016-07-07 09:49:46 +02:00
ldap Enable Style/EmptyLinesAroundAccessModifier rubocop cop 2016-06-03 10:34:20 +02:00
lfs Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
markdown Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
metrics RailsCache metrics now includes fetch_hit/fetch_miss and read_hit/read_miss info. 2016-07-05 12:28:06 +02:00
middleware Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
o_auth Merge branch 'master' into dev-master 2016-07-02 22:58:21 +02:00
saml Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
sanitizers Refactored SVG sanitizer 2016-06-12 21:05:58 -04:00
sherlock
sidekiq_middleware even more debug 2016-07-06 10:29:31 +02:00
sql
template fixup! override content method 2016-06-20 14:48:28 -05:00
access.rb Raise a new Gitlab::Access::AccessDeniedError when permission is not enough to destroy a member 2016-06-18 06:06:34 +02:00
akismet_helper.rb Use ActionDispatch Remote IP for Akismet checking 2016-04-27 22:12:55 -07:00
app_logger.rb
asciidoc.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
auth.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
award_emoji.rb Fix emoji paths in relative root configurations 2016-07-01 09:10:12 -07:00
bitbucket_import.rb
blame.rb add custom highlighting via .gitattributes 2016-06-27 14:17:49 -07:00
build_data_builder.rb Try to use pipeline where applicable 2016-06-03 13:09:49 +02:00
closing_issue_extractor.rb
color_schemes.rb
config_helper.rb
contributions_calendar.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
contributor.rb
current_settings.rb Added setting to set new users by default as external 2016-07-07 19:21:18 +02:00
database.rb Fix RangeError exceptions when referring to issues or merge requests outside of max database values 2016-06-18 13:07:38 -07:00
devise_failure.rb Use a custom Devise failure app to handle unauthenticated .zip requests 2016-03-08 23:49:30 -05:00
emoji.rb Add emoji.rb in lib/gitlab instead of using the gitlab_emoji gem. 2016-06-29 14:53:09 -06:00
exclusive_lease.rb clean up ExclusiveLease 2016-04-13 13:12:05 +03:00
force_push_check.rb
git.rb Freeze the expression instead of the literal 2016-02-05 08:39:44 +01:00
git_access.rb Revert back to not defining a default Git access protocol. 2016-07-05 16:54:22 -05:00
git_access_status.rb
git_access_wiki.rb
git_logger.rb
git_post_receive.rb Back-porting PostReceive refactor made for EE 🍺 2016-03-17 00:24:12 -03:00
git_ref_validator.rb
gitorious_import.rb
gl_id.rb Revert "squashed merge and fixed conflicts" 2016-06-16 12:59:07 +02:00
gon_helper.rb Unused got variable with very bad performance 2016-06-28 17:01:37 +02:00
highlight.rb support cgi style options, such as erb?parent=json 2016-06-27 14:17:49 -07:00
identifier.rb
import_export.rb bump version - as old exports wont be compatible 2016-06-29 10:49:31 +02:00
import_formatter.rb
import_sources.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
incoming_email.rb Improve and finish the fallback to the In-Reply-To and References header for the reply-by-email feature 2016-03-25 13:05:15 +01:00
issues_labels.rb
key_fingerprint.rb Enable Style/UnneededCapitalW Rubocop cop 2016-06-30 13:31:52 +02:00
lazy.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
logger.rb
markup_helper.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
metrics.rb Fix setting of "action" for Grape transactions 2016-04-20 22:42:52 +02:00
note_data_builder.rb Refactor and expose only Gitlab::UrlBuilder.build(record) 2016-04-13 16:07:04 +02:00
other_markup.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
popen.rb
production_logger.rb
project_search_results.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
protocol_access.rb Default Git access protocol to web 2016-07-05 16:54:22 -05:00
push_data_builder.rb API support for the 'since' and 'until' operators on commit requests 2016-04-29 09:26:52 +02:00
recaptcha.rb
redis.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
reference_extractor.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
regex.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
repository_check_logger.rb Rename almost all the things 2016-04-06 13:47:05 +02:00
routing.rb Added & use Gitlab::Routing for URL helpers 2016-04-01 11:13:48 +02:00
search_results.rb Restrict access to confidential issues on search results 2016-03-17 20:55:59 -03:00
seeder.rb Replace colorize gem with rainbow. 2016-06-03 10:37:09 -06:00
sherlock.rb
sidekiq_logger.rb
snippet_search_results.rb Refactor Gitlab::SnippetSearchResults 2016-03-11 15:25:22 -05:00
themes.rb
timeless.rb Add Timeless helper module to prevent updated_at from being updated 2016-07-06 18:50:58 -04:00
upgrader.rb
uploads_transfer.rb
url_builder.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
url_sanitizer.rb few more changes from suggestions 2016-06-30 17:22:56 +02:00
user_access.rb Move method to User 2016-03-10 12:37:14 +01:00
utils.rb
version_info.rb
visibility_level.rb Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
workhorse.rb Add send_git_patch helper 2016-07-06 18:51:01 -04:00