Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab FOSS
GitLab FOSS
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge Requests
  • !21982

Merged
Opened Sep 28, 2018 by Mark Chao@lulalala🔴Maintainer7 of 7 tasks completed7/7 tasks

Fix MR discussion not loaded issue

  • Overview 8
  • Commits 1
  • Pipelines 7
  • Changes 10

What does this MR do?

Some MR discussions aren't being loaded, because its json endpoint return 500.
The error was caused by json generation causing IOError: not opened for reading.
One possible cause might be that the Position object could trigger a as_json call to its diff_file instance variable, which in turn triggers as_json on repository, which is not serializable and causes the IOError.

Error report: https://sentry.gitlab.net/gitlab/gitlabcom/issues/515862/

Currently the position hash contains a formatter hash.

This MR removes the nesting, so position hash will have what the formatter hash contains. This removes the unneeded diff_file, and thus avoids the error all together.

Current:

{
   "position": {
    "formatter": {
      "base_sha":"xxx",
      "start_sha":"xxx",
      "head_sha":"xxx",
      "old_path":".jscsrc",
      "new_path":".jscsrc",
      "position_type":"text",
      "old_line":null,
      "new_line":1 
     }
  }
}

After this MR

{
   "position": {
      "base_sha":"xxx",
      "start_sha":"xxx",
      "head_sha":"xxx",
      "old_path":".jscsrc",
      "new_path":".jscsrc",
      "position_type":"text",
      "old_line":null,
      "new_line":1 
     }
}

What are the relevant issue numbers?

#51958 (closed)

Does this MR meet the acceptance criteria?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • Tests added for this feature/bug
  • Conforms to the code review guidelines
  • Conforms to the merge request performance guidelines
  • Conforms to the style guides
  • Conforms to the database guides

Closes #51958 (closed)

Edited Oct 12, 2018 by Mark Chao
Assignee
Assign to
Reviewer
Request review from
11.3
Milestone
11.3 (Past due)
Assign milestone
Time tracking
Reference: gitlab-org/gitlab-foss!21982
Source branch: 51958-fix-mr-discussion-loading