Skip to content

Review cannot start immediatly after call lua require('gitlab').review() #524

@sergey-arkhipov

Description

@sergey-arkhipov

Prerequsities

  • [х] I'm on the latest version of the plugin
  • [х] I've installed the required dependencies
  • [х] I've run :h gitlab.nvim.troubleshooting and followed the steps there

Setup Configuration and Environment

return {
  'harrisoncramer/gitlab.nvim',
  -- version = '3.3.11',
  -- branch = 'develop',
  dependencies = {
    { 'MunifTanjim/nui.nvim' },
    { 'nvim-lua/plenary.nvim' },
    'sindrets/diffview.nvim',
    'stevearc/dressing.nvim', -- Recommended but not required. Better UI for pickers.
    'nvim-tree/nvim-web-devicons', -- Recommended but not required. Icons in discussion tree.
  },
  enabled = true,
  build = function() require('gitlab.server').build(true) end, -- Builds the Go binary
  config = function()
    require('gitlab').setup({
      discussion_tree = { -- The discussion tree that holds all comments
        auto_open = false, -- Automatically open when the reviewer is opened
      },
      create_mr = {
        delete_branch = true,
        squash = true,
      },
    })
    -- For squash = true and delete_branch = true
    local gitlab = require('gitlab')
    local original_merge = gitlab.merge
    gitlab.merge = function(opts)
      opts = opts or {}
      opts.squash = true -- Всегда squash = true
      opts.delete_branch = true -- Всегда delete_branch = true
      original_merge(opts)
    end
  end,
}

Bug Description

Review do not start after call lua require('gitlab').review()
Second call work as usual.

Reproduction Steps

  1. Check out the feature branch
  2. Open Neovim
  3. Call lua require('gitlab').review()
  4. Nothing happened
  5. Call again
  6. Work as usual

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions