Skip to content
Snippets Groups Projects

Fix regression caused by using newer version of Grape

Merged gitlab-qa-bot requested to merge github/fork/dblessing/4023 into master

Created by: dblessing

This commit fixes the regression caused by using a newer version of Grape and Grape entity. This solves Issue #4023 (closed).

I don't know if there was a particular reason for changing Grape version (commit 083d6656). If there is no compelling reason to change the Grape version, I recommend we revert that change with this PR to solve the current regression with raw content in the API. This regression breaks tools that integrate with the API.

Before: before

After: after

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0%) when pulling 245deb5c on bke-drewb:4023 into d58aca06 on gitlabhq:master.

    By Administrator on 2013-05-26T01:06:19 (imported from GitLab project)

    By Administrator on 2013-05-26T01:06:19 (imported from GitLab)

  • Created by: NARKOZ

    Can you add test?

    By Administrator on 2013-05-26T01:32:13 (imported from GitLab project)

    By Administrator on 2013-05-26T01:32:13 (imported from GitLab)

  • Created by: dblessing

    Test for what?

    By Administrator on 2013-05-26T01:52:53 (imported from GitLab project)

    By Administrator on 2013-05-26T01:52:53 (imported from GitLab)

  • Created by: NARKOZ

    For broken raw content.

    On Sunday, May 26, 2013, bke-drewb wrote:

    Test for what?

    — Reply to this email directly or view it on GitHubhttps://github.com/gitlabhq/gitlabhq/pull/4076#issuecomment-18456724 .

    Nihad Abbasov

    By Administrator on 2013-05-26T01:54:35 (imported from GitLab project)

    By Administrator on 2013-05-26T01:54:35 (imported from GitLab)

  • Created by: dblessing

    I really don't know if I can do that. I haven't written spinach tests before.

    By Administrator on 2013-05-26T01:58:46 (imported from GitLab project)

    By Administrator on 2013-05-26T01:58:46 (imported from GitLab)

  • Created by: bbodenmiller

    @senny anyone who can give @bke-drewb some pointers on writing tests?

    By Administrator on 2013-05-27T00:32:27 (imported from GitLab project)

    By Administrator on 2013-05-27T00:32:27 (imported from GitLab)

  • Created by: dblessing

    Not that I don't want to learn to write tests - I think this case should have a test. However, is it necessary to have a test prior to making a decision on this?

    By Administrator on 2013-05-27T00:37:44 (imported from GitLab project)

    By Administrator on 2013-05-27T00:37:44 (imported from GitLab)

  • Created by: bbodenmiller

    I think we need to wait for @randx to let us know if the change in versions was for a particular reason. Tests would allow us to find this failure and prevent it from happening again as well as show that downgrading doesn't break anything.

    By Administrator on 2013-05-27T00:39:42 (imported from GitLab project)

    By Administrator on 2013-05-27T00:39:42 (imported from GitLab)

  • Created by: dblessing

    Yeah, I'd like to hear if there was any reason for the upgrade. Also, I've been going back and forth on the Grape mailing list trying to see what we need to do to use the latest version and retain the functionality expected of raw/blob calls to the API.

    By Administrator on 2013-05-27T00:41:46 (imported from GitLab project)

    By Administrator on 2013-05-27T00:41:46 (imported from GitLab)

  • Created by: dzaporozhets

    we should make grape 4 send plain text for such cases - not downgrade library

    By Administrator on 2013-05-27T06:01:08 (imported from GitLab project)

    By Administrator on 2013-05-27T06:01:08 (imported from GitLab)

  • Created by: bbodenmiller

    @bke-drewb any ideas how to fix?

    By Administrator on 2013-05-27T06:57:44 (imported from GitLab project)

    By Administrator on 2013-05-27T06:57:44 (imported from GitLab)

  • Created by: dzaporozhets

    related to https://github.com/intridea/grape/issues/412

    By Administrator on 2013-05-27T09:51:30 (imported from GitLab project)

    By Administrator on 2013-05-27T09:51:30 (imported from GitLab)

  • Created by: dzaporozhets

    ok lets revert grape for now

    By Administrator on 2013-05-27T11:56:04 (imported from GitLab project)

    By Administrator on 2013-05-27T11:56:04 (imported from GitLab)

  • Created by: dzaporozhets

    @bke-drewb I appreciate if you help us find a solution to make it works in grape 4

    By Administrator on 2013-05-27T11:57:28 (imported from GitLab project)

    By Administrator on 2013-05-27T11:57:28 (imported from GitLab)

  • Created by: dblessing

    @randx Thanks for merging in the interim. I will definitely keep exploring options. I haven't been able to find any server side options yet. There are some that would work but would require the API user to set a 'format' parameter. I don't think that's the best option. I'll open an issue if I find out more.

    By Administrator on 2013-05-27T12:41:46 (imported from GitLab project)

    By Administrator on 2013-05-27T12:41:46 (imported from GitLab)

  • Created by: dzaporozhets

    @bke-drewb fixed in grape master. See https://github.com/intridea/grape/issues/412 for discussion

    By Administrator on 2013-05-27T17:28:05 (imported from GitLab project)

    By Administrator on 2013-05-27T17:28:05 (imported from GitLab)

  • Created by: dblessing

    @randx Great! I'll get a pull request going. One more question - for blob content it currently has content_type set to blob.mime_type. What happens is Ruby/HTML/etc files are then downloaded and/or rendered in the browser instead of viewed as plain text. What is the desired outcome for blob content? Simply changing this to text/plain will make it output the raw contents. Except, that likely won't work for images and such. Do you want to wait to integrate these changes until Grape releases a new version?

    By Administrator on 2013-05-28T01:03:22 (imported from GitLab project)

    By Administrator on 2013-05-28T01:03:22 (imported from GitLab)

  • Created by: dzaporozhets

    @bke-drewb I think it depends on browser. Ex download for .rb files but render for .js files.

    By Administrator on 2013-05-28T05:47:05 (imported from GitLab project)

    By Administrator on 2013-05-28T05:47:05 (imported from GitLab)

Please register or sign in to reply
Loading