gitlab-org--gitlab-foss/app/models
Rémy Coutable f29fd65cdd Merge branch 'fix/incremental-trace-update-api' into 'master'
Fix UTF-8 handling in incremental trace update API

## What does this MR do?

This MR fixes invalid UTF-8 handling in incremental trace update API (used by GitLab Runner).

## Why was this MR needed?

Current version is using `.length` method to determine current trace size where Runner is using the trace size in bytes. Also this byte size is used in headers and file operations to agree the trace part to send. This is a problem when build trace contains any multi-byte UTF-8 characters. This MR is fixing this situation so all parts are using the same size in bytes.

### Runner -> API communication before fix:
```
Checking for builds... received                     runner=_token_
gitlab-ci-multi-runner 1.3.0~beta.26.gcfd63b9 (cfd63b9)  build=25 runner=_token_
Using Docker executor with image debian:jessie ...  build=25 runner=_token_
Pulling docker image debian:jessie ...              build=25 runner=_token_
25 Submitting build to coordinator... ok            runner=_token_
25 Appending trace to coordinator... ok             RemoteRange=0-158 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=0-158 runner=_token_
25 Appending trace to coordinator... ok             RemoteRange=0-491 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=158-505 runner=_token_
WARNING: 25 Appending trace to coordinator... range missmatch  RemoteRange=0-491 RemoteState= ResponseMessage=416 Requested Range Not Satisfiable ResponseStatusCode=416 SentRange=505-584 runner=_token_
WARNING: 25 Resending trace patch due to range missmatch  runner=_token_
25 Appending trace to coordinator... ok             RemoteRange=0-556 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=491-584 runner=_token_
WARNING: 25 Appending trace to coordinator... range missmatch  RemoteRange=0-556 RemoteState= ResponseMessage=416 Requested Range Not Satisfiable ResponseStatusCode=416 SentRange=584-663 runner=_token_
WARNING: 25 Resending trace patch due to range missmatch  runner=_token_
25 Appending trace to coordinator... ok             RemoteRange=0-621 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=556-663 runner=_token_
Build succeeded                                     build=25 runner=_token_
WARNING: 25 Appending trace to coordinator... range missmatch  RemoteRange=0-621 RemoteState= ResponseMessage=416 Requested Range Not Satisfiable ResponseStatusCode=416 SentRange=663-797 runner=_token_
WARNING: 25 Resending trace patch due to range missmatch  runner=_token_
25 Appending trace to coordinator... ok             RemoteRange=0-741 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=621-797 runner=_token_
25 Submitting build to coordinator... ok            runner=_token_
```

### Runner -> API communication after fix:
```
Checking for builds... received                     runner=_token_
gitlab-ci-multi-runner 1.3.0~beta.26.gcfd63b9 (cfd63b9)  build=26 runner=_token_
Using Docker executor with image debian:jessie ...  build=26 runner=_token_
Pulling docker image debian:jessie ...              build=26 runner=_token_
26 Submitting build to coordinator... ok            runner=_token_
26 Appending trace to coordinator... ok             RemoteRange=0-158 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=0-158 runner=_token_
26 Appending trace to coordinator... ok             RemoteRange=0-505 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=158-505 runner=_token_
26 Appending trace to coordinator... ok             RemoteRange=0-584 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=505-584 runner=_token_
26 Appending trace to coordinator... ok             RemoteRange=0-663 RemoteState=running ResponseMessage=202 Accepted ResponseStatusCode=202 SentRange=584-663 runner=_token_
Build succeeded                                     build=26 runner=_token_
26 Submitting build to coordinator... ok            runner=_token_
```

See merge request !4541
2016-06-10 13:08:22 +00:00
..
ci Fix UTF-8 handling in incremental trace update API 2016-06-10 13:09:34 +02:00
concerns Fix pseudo n+1 queries with Note and Note Authors in issuables APIs 2016-06-08 10:26:05 -04:00
hooks Merge branch 'hook-docs-behavior' into 'master' 2016-05-11 16:34:00 +00:00
members Add changelog and code refactor 2016-05-30 22:32:07 +07:00
network Merge branch 'style/enable-semicolon-rubocop-cop' into 'master' 2016-06-01 17:41:19 +00:00
project_services Enable Lint/AmbiguousOperator rubocop cop 2016-06-03 10:59:43 +02:00
.gitkeep
ability.rb Merge branch 'separate-banzai-references' into 'master' 2016-06-01 15:51:59 +00:00
abuse_report.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
appearance.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
application_setting.rb Allow custom text on 'almost there' page 2016-06-08 19:08:53 +01:00
audit_event.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
award_emoji.rb Fix latests concerns 2016-05-18 08:47:15 -05:00
blob.rb Properly handle bigger files 2016-04-28 21:28:39 +02:00
broadcast_message.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
commit.rb Remove `projects` inclusion in `notes_with_associations` to skip some unnecessary queries 2016-06-08 10:26:05 -04:00
commit_range.rb Don't modify arguments in CommitRange#initialize 2016-05-26 13:58:01 +02:00
commit_status.rb Delegate to pipeline instead of commit 2016-06-03 13:34:38 +02:00
deploy_key.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
deploy_keys_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
email.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
event.rb Reduce duplication and branching logic in EventsHelper 2016-05-16 14:52:04 -05:00
external_issue.rb Merge branch 'master' into number_sign_for_external_issue_ref 2016-04-17 18:17:27 +02:00
forked_project_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
generic_commit_status.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
global_label.rb
global_milestone.rb
group.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
identity.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
issue.rb Improve Issuable.order_labels_priority 2016-06-06 11:59:49 -05:00
jira_issue.rb
key.rb Add leading comment space cop 2016-05-31 19:33:46 -03:00
label.rb Fix label order by priority on labels page 2016-06-07 14:01:30 +01:00
label_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
legacy_diff_note.rb Incorportate feedback 2016-06-01 12:10:08 +02:00
lfs_object.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
lfs_objects_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
member.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
merge_request.rb Rename ci_commit -> pipeline 2016-06-10 14:41:38 +02:00
merge_request_diff.rb Maintain commit order in MRs 2016-05-18 17:14:55 +01:00
milestone.rb Address Yorick's feedback 2016-05-18 23:45:25 -05:00
namespace.rb Merge branch 'docker-registry' into docker-registry-view 2016-05-13 17:15:01 -05:00
note.rb Backend awardables on comments 2016-06-06 11:03:39 +02:00
notification_setting.rb Notifications dropdown on project page now has descriptions 2016-06-07 15:02:00 +01:00
oauth_access_token.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
personal_snippet.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
project.rb Merge remote-tracking branch 'origin/master' into rename-ci-commit 2016-06-03 13:10:01 +02:00
project_group_link.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
project_import_data.rb Upgrade attr_encrypted and encryptor 2016-05-30 13:51:21 -06:00
project_snippet.rb Refactor Participable 2016-06-01 16:22:35 +02:00
project_team.rb
project_wiki.rb Codestyle changes 2016-05-31 11:24:58 -03:00
protected_branch.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
release.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
repository.rb Remove main_language and tests 2016-05-25 17:16:42 -04:00
security_event.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
sent_notification.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
service.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
snippet.rb Remove `projects` inclusion in `notes_with_associations` to skip some unnecessary queries 2016-06-08 10:26:05 -04:00
spam_log.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
spam_report.rb
subscription.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
todo.rb Create a todo on failing MR build 2016-05-17 10:17:45 +01:00
tree.rb
u2f_registration.rb Add a `U2fRegistrations` table/model. 2016-06-06 12:50:31 +05:30
user.rb Add a `U2fRegistrations` table/model. 2016-06-06 12:50:31 +05:30
users_star_project.rb Remove the annotate gem and delete old annotations 2016-05-09 18:00:28 +02:00
wiki_page.rb add slack notifications for wiki pages 2016-04-20 08:25:40 +08:00