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

NumberFormatException when trying to close a ticket on push #700

Closed
gitblit opened this issue Aug 12, 2015 · 13 comments
Closed

NumberFormatException when trying to close a ticket on push #700

gitblit opened this issue Aug 12, 2015 · 13 comments

Comments

@gitblit
Copy link
Collaborator

gitblit commented Aug 12, 2015

Originally reported on Google Code with ID 404

I've upgraded from 1.3.2 to 1.4.. Now when I try to commit with a message like:

Closes #2879 @4h

Which tells Redmine to close issue #2879 with spent time of 4 hours. This worked flawlessly
with 1.3.2. Now it throws the attached exception.

Reported by sundayfunday1234@outlook.com on 2014-03-28 19:21:05


- _Attachment: [exception.txt](https://storage.googleapis.com/google-code-attachments/gitblit/issue-404/comment-0/exception.txt)_
@gitblit gitblit self-assigned this Aug 12, 2015
@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Strangely enough,

Refs #2879 @4h

won't trigger the crash, only

Closes #2879 @4h

Reported by sundayfunday1234@outlook.com on 2014-03-28 19:31:02

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Even

Closes #2879

is sufficient.

Reported by sundayfunday1234@outlook.com on 2014-03-28 19:32:16

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hmm...

Close #2879 = success
Closes #2879 = exception

Very strange.

Reported by sundayfunday1234@outlook.com on 2014-03-28 19:36:13

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Disable "accept patchsets" for this repository.  Gitblit is looking to close a ticket.

Reported by James.Moger on 2014-03-28 23:47:18

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

This is also a bug in the patchsets code which has been fixed on master.  But basically,
you can't use Gitblit branch pull-requests (tickets) and your Redmine commit message
integration at the same time because of the regex overlap.

Reported by James.Moger on 2014-03-29 00:09:57

  • Status changed: Queued
  • Labels added: Milestone-1.5.0

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hm, you mean this should only happen with BranchTicketService? Coz currently I have
FileTicketService enabled.

Reported by sundayfunday1234@outlook.com on 2014-03-29 00:50:32

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

I mean the tickets feature - all backends, doesn't matter which one.

Gitblit will scan every incoming commit message for "closes|fixes #1234" and will automatically
close as merged a matching ticket id within the repo.  This means that if you push
a commit for Redmine Issue 1234 with a message like "closes #1234", Gitblit will close
ticket 1234 because it doesn't know that you actually mean to close/reference the Redmine
issue.

You can disable this by disabling patchsets for the repo.  You may still use the tickets
feature as an issue tracker, but you will no longer be able to attach commits to a
ticket.

Reported by James.Moger on 2014-03-29 02:08:35

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Hmm, so the crash happened because Gitblit tried to close an issue which wasn't found
(at least in Gitblit)? Then it seems you were quite lucky (or in fact, unlucky) to
never mistype an issue id during testing :D

By saying "you can't use Gitblit tickets and your Redmine commit message integration
at the same time" do you mean that it'd be technically possible to process at both
places but it would cause malfunctioning in a way that someone would intentionally
close Gitblit issue #419 and unintentionally close the probably unrelated Redmine issue
#419 (or vice versa), right? So our problem is that we can't explicitly state which
kind of issue we're referencing to.

In which case I could imagine the keywords to be configurable. In fact, they're already
configurable in Redmine (see the attached screenshot). So then people could use like
"gcloses" and "rcloses" or whatever, I can't think of better ones ATM :D What do you
think? Or did I got something wrong?

Reported by sundayfunday1234@outlook.com on 2014-03-31 14:34:02


- _Attachment: redmine.png
![redmine.png](https://storage.googleapis.com/google-code-attachments/gitblit/issue-404/comment-8/redmine.png)_

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Correct.  I never make mistakes in commit messages.  ;)

Right. Technically possible, but would have unexpected consequences since it is unlikely
that both referenced objects actually reference the same subject.

Making the expression configurable is probably a useful improvement.

Reported by James.Moger on 2014-03-31 14:51:41

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Great, thanks! :)

Anyway, will this crash fix be in 1.4.2 or 1.5.0, what are your plans for future releases,
if any?

Reported by sundayfunday1234@outlook.com on 2014-03-31 15:22:12

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Master already has the fix for non-existent tickets and regex parsing.  I just pushed
a change to make the expression configurable.

This will be part of 1.5.0 which is due in a week or two.  I'm trying to get on pace
for more frequent releases.

Reported by James.Moger on 2014-03-31 15:46:28

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Fix/change released in 1.5.0.

Reported by James.Moger on 2014-04-18 13:27:24

@gitblit
Copy link
Collaborator Author

gitblit commented Aug 12, 2015

Reported by James.Moger on 2014-04-18 13:27:49

  • Status changed: Done

@gitblit gitblit closed this as completed Aug 12, 2015
@flaix flaix modified the milestone: 1.5.0 Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants