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

Status and resolution not set when issue is fixed #229

Open
Nick-Hall opened this issue Jun 15, 2017 · 9 comments
Open

Status and resolution not set when issue is fixed #229

Nick-Hall opened this issue Jun 15, 2017 · 9 comments

Comments

@Nick-Hall
Copy link

I have set up GitHub source integration for the Gramps Project and our bug tracker. We are using Source Control Integration 2.0.3 and Source GitHub Integration 2.0.0.

When a bug is fixed in a maintenance branch (maintenance/gramps50), the changeset is attached to the issue and a fixed message is created. However the issue is not set to "resolved" and "fixed".

In the configuration, "Resolve Fixed Issues" is set. "Bug Fixed Status" is set to "resolved" (I also tried "[Resolved Status]") and "Bug Fixed Resolution" is set to "fixed".

What am I doing wrong?

I also tried setting "Bug Fixed Assign To Committer", although I would prefer the issue assigned to the author or left unchanged. This resulted in a webhook timeout.

@dregad
Copy link
Member

dregad commented Jun 16, 2017

How did you reference the issue in the commit message ? Have a look at the regexes in the plugin configuration; there are 2 sets, for resolution it should be Fix|es|ed or Resolve|s|d #xxx

If that is correctly written, and the settings are correct, then maybe the author (or committer as fallback) user's account does not have the privilege to handle issues ?

It may also depend on your Mantis' settings for bug_resolved_status_threshold, bug_resolution_fixed_threshold and bug_resolution_not_fixed_threshold

Have a look at the code for full details on the resolution logic.

@Nick-Hall
Copy link
Author

Thanks for your help. After examining the code, I now have it working.

The problem was that I wrongly interpreted a couple of the settings. The "Bug Fixed Assign To Committer" was the setting I needed, but I found the description misleading. Tooltips to describe this and the "Resolve Fixed Issues" setting would have been useful. The webhook timeout was totally unrelated.

@dregad
Copy link
Member

dregad commented Jun 17, 2017

@Nick-Hall thanks for the feedback.

If you would be so kind as to provide what you'd like to see as tooltips, and how to amend the description to make it clearer, I'll gladly improve that.

@luzpaz
Copy link

luzpaz commented Aug 12, 2017

@Nick-Hall good point, I also would like to know what tooltips you suggest?

@Nick-Hall
Copy link
Author

Sorry, I forgot about this PR.

Renaming "Bug Fixed Assign To Committer" to something like "Automatically Update Issue", and swapping its position with the "Resolve Fixed Issues" setting would be clearer. The "Bug Fixed Assign To Committer" setting is required to enable a feature. The "Resolve Fixed Issues" setting customises the feature.

Tooltips just provide extra information as you have done for "Changeset linking". For example, the tooltip for "Repository Statistics" could be "Add columns to show the number of changesets, files and issues in the repository listing".

@fcenedese
Copy link

Actually I'd keep the descriptions but change the code. In Source.API.php

function Source_Process_Changesets( $p_changesets, $p_repo=null ) {

instead of skipping closing completely if the handler is not set
(meaning "Bug Fixed Assign To Committer" is not enabled)

	} elseif( $t_handler && $t_handler_id !== null ) {

do it like this

	} elseif( $t_handler_id !== null ) {

and only check the handler setting for the real assignment

		if ($t_handler) {
			if( $t_bug->handler_id != $t_handler_id ) {
				$t_bug->handler_id = $t_handler_id;
				$t_update = true;
			}
		}

That way auto closing still works even if the "Bug Fixed Assign To Committer"
option is not set. In my view the code then works as described by the options.

@Heavenfighter
Copy link

I agree with fcenedese

@dregad
Copy link
Member

dregad commented Sep 21, 2023

The current behavior is by design actually (see #80), as documented in the code:

} elseif( $t_handler && $t_handler_id !== null ) {
# We only resolve the issue if an authorized handler has been
# identified; otherwise, it will remain open.

I did not look in detail to confirm for sure, but if I'm not mistaken what @fcenedese suggests would allow resolved issues not to be assigned at all, which feels strange to me. What do you think ?

Anyway, I'll have a closer look as time allows.

@fcenedese
Copy link

(Sorry for replying to the mailing list)

I just think that the naming of this option doesn't match its function.
Right now it just says "assign name", but unchecking it disables
issue closing completely. So it does (almost?) the same as the
feature box. I find this counter intuitive.

If you use my code change and enable the "assign name" box by
default then you get the same behavior as it is now I think. However
disabling it allows to close an issue without changing the assignee
which is not possible right now. If that means that an issue might be
closed without a user assigned to it then so be it, that's why we
unchecked this feature. Usually we already assigned the issues
beforehand so they already have an assignee. And if the issue is
closed by a commit then it's also visible who did the commit. The
assignee does not need to be the same as the one fixing/closing
the issue. For us mantis is a bug tracker, not more. We already
have VCS to track of who did what.

Of course you can keep the current behavior but then at least you
need to change the wording of the check box as it definitely doesn't
describe its function right now. And we'd still keep our local mantis
patched to get the desired functionality. But looking at the comments
in the issues and mailing lists we're not the only ones struggling
with this.

Thanks

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

No branches or pull requests

5 participants