Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close issue on merge #871

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

prarit
Copy link
Collaborator

@prarit prarit commented Jul 14, 2023

cmd/mr_create.go: Add --close-issue option

Add an option that allows a user to specify issues that can be closed when
the merge request is merged.  The --close-issue option can be used
multiple times to indicate multiple issues.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>

close #844

Rearrange code to match that of other files.  There are no functionality
changes introduced in this commit.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Add an option that allows a user to specify issues that can be closed when
the merge request is merged.  The --close-issue option can be used
multiple times to indicate multiple issues.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 56.52% and project coverage change: +0.31 🎉

Comparison is base (cce34e2) 55.25% compared to head (971b5b7) 55.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #871      +/-   ##
==========================================
+ Coverage   55.25%   55.57%   +0.31%     
==========================================
  Files          82       82              
  Lines        5961     5988      +27     
==========================================
+ Hits         3294     3328      +34     
+ Misses       2380     2371       -9     
- Partials      287      289       +2     
Impacted Files Coverage Δ
cmd/mr_show.go 65.80% <0.00%> (-1.52%) ⬇️
cmd/mr_create.go 70.04% <59.09%> (-2.00%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@prarit prarit marked this pull request as ready for review July 14, 2023 16:49
@bmeneg
Copy link
Collaborator

bmeneg commented Feb 26, 2024

@prarit, the code rearrangement seems odd. Only func init() is left as the final function, the command creation has been the first bit after lib imports and global var declaration, doesn't it?

@zampierilucas
Copy link
Collaborator

@bmeneg I agree, on newly created function we use Run: func(... , so it might be nice to also add it here, since you moving it

}

if len(closeIssues) > 0 {
closeIssueString := "\n\nCloses "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if Closes is in the first line? Does it still work?
This is the Gitlab regex just for reference /^\/(?<cmd>close|reopen|...)(?:( |$))(?<arg>[^\/\n]*)(?:\n|$)/
which if you take all the fuzz, it matches that it is at the start of the line without any break line check.


func init() {
mrCreateCmd.Flags().StringArrayP("message", "m", []string{}, "use the given <msg>; multiple -m are concatenated as separate paragraphs")
mrCreateCmd.Flags().StringSliceP("assignee", "a", []string{}, "set assignee by username; can be specified multiple times for multiple assignees")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking-suggestion: This is true for premium/ultimate, as multiple assignees are not allowed on free plan, so I think we should note that on this description, something like:

Suggested change
mrCreateCmd.Flags().StringSliceP("assignee", "a", []string{}, "set assignee by username; can be specified multiple times for multiple assignees")
mrCreateCmd.Flags().StringSliceP("assignee", "a", []string{}, "set assignee by username; can be specified multiple times for multiple assignees (multiple assigness is premium gitlab feature)")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lab issue create mr
3 participants