Skip to content
Snippets Groups Projects

GithubImporter: Format diff note suggestions to the gitlab format

Merged Kassio Borges requested to merge kassio/github-importer-format-suggestions into master
3 files
+ 89
0
Compare changes
  • Side-by-side
  • Inline
Files
3
  • Github "suggestion" feature has a different markdown format, it uses:
    
        ```suggestion
        SUGGESTION
        ```
    
    While Gitlab has a _range_ in the suggestion markdown, like:
    
        ```suggestion-0+0
        SUGGESTION
        ```
    
    To convert the Github format to Gitlab, in the `DiffNote`
    _representation_ the range will be added. The range is calculated by the
    difference of the `start_line` and `line` when the start_line is
    present, which indicates a multi-line suggestion.
    
    Related to: #340624
    
    Changelog: changed
    MR: !71411
@@ -28,6 +28,8 @@ def self.from_api_response(note)
)
end
note = SuggestionFormatter.format(note)
user = Representation::User.from_api_response(note.user) if note.user
hash = {
noteable_type: 'MergeRequest',
Loading