Release 2.5.1 (#271)

* feat: Support for custom authentication provider functions (#270)
* feat: Support for adding "draft" notes to the review, and publishing them, either individually or all at once. Addresses feature request #223.
* feat: Lets users select + checkout a merge request directly within Neovim, without exiting to the terminal
* fix: Checks that the remote feature branch exists and is up-to-date before creating a MR, starting a review, or opening the MR summary (#278)
* docs: We require some state from Diffview, this shows how to load that state prior to installing w/ Packer. Fixes #94.

This is a #MINOR release.

---------

Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
Co-authored-by: sunfuze <sunfuze.1989@gmail.com>
Co-authored-by: Patrick Pichler <mail@patrickpichler.dev>
This commit is contained in:
Harrison (Harry) Cramer
2024-04-22 16:56:27 -04:00
committed by GitHub
parent f10c4ebb8f
commit cf6ccddce3
42 changed files with 2830 additions and 1149 deletions

View File

@@ -7,6 +7,7 @@ local job = require("gitlab.job")
local u = require("gitlab.utils")
local git = require("gitlab.git")
local state = require("gitlab.state")
local common = require("gitlab.actions.common")
local miscellaneous = require("gitlab.actions.miscellaneous")
---@class Mr
@@ -42,6 +43,10 @@ end
--- continue working on it.
---@param args? Mr
M.start = function(args)
if not git.current_branch_up_to_date_on_remote(vim.log.levels.ERROR) then
return
end
if M.started then
vim.ui.select({ "Yes", "No" }, { prompt = "Continue your previous MR?" }, function(choice)
if choice == "Yes" then
@@ -82,7 +87,10 @@ M.pick_target = function(mr)
end
local function make_template_path(t)
local base_dir = git.base_dir()
local base_dir, err = git.base_dir()
if err ~= nil then
return
end
return base_dir
.. state.settings.file_separator
.. ".gitlab"
@@ -202,7 +210,7 @@ M.open_confirmation_popup = function(mr)
M.layout_visible = false
end
local description_lines = mr.description and M.build_description_lines(mr.description) or { "" }
local description_lines = mr.description and common.build_content(mr.description) or { "" }
local delete_branch = u.get_first_non_nil_value({ mr.delete_branch, state.settings.create_mr.delete_branch })
local squash = u.get_first_non_nil_value({ mr.squash, state.settings.create_mr.squash })
@@ -234,18 +242,6 @@ M.open_confirmation_popup = function(mr)
end)
end
---Builds a lua list of strings that contain the MR description
M.build_description_lines = function(template_content)
local description_lines = {}
for line in u.split_by_new_lines(template_content) do
table.insert(description_lines, line)
end
-- TODO: @harrisoncramer Same as in lua/gitlab/actions/summary.lua:114
table.insert(description_lines, "")
return description_lines
end
---Prompts for interactive selection of a new target among remote-tracking branches
M.select_new_target = function()
local bufnr = vim.api.nvim_get_current_buf()