This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 386776 - Be able to send comment on bugzilla from Orion level
Summary: Be able to send comment on bugzilla from Orion level
Status: RESOLVED WONTFIX
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Git (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: gsoc2012
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-07 15:02 EDT by Edyta Przymus CLA
Modified: 2015-05-05 14:51 EDT (History)
2 users (show)

See Also:


Attachments
General comment + detailed comments about files (160.25 KB, image/png)
2012-08-13 14:01 EDT, Edyta Przymus CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edyta Przymus CLA 2012-08-07 15:02:30 EDT
Next feature connected with Pull Request
Comment 1 Edyta Przymus CLA 2012-08-07 15:02:57 EDT
test comment
Comment 2 Edyta Przymus CLA 2012-08-12 14:27:10 EDT
Test comment
Comment 3 Edyta Przymus CLA 2012-08-12 18:07:56 EDT
Test comment2
Comment 4 Edyta Przymus CLA 2012-08-12 18:15:44 EDT
https://github.com/edytaprzymus/orion.client/commit/7f9b74c03c25491883be9a1d73eafbf20012061a

My commit with initial solution
Comment 5 Edyta Przymus CLA 2012-08-12 18:27:23 EDT
I wrote all this code and have the rights to contribute it to Eclipse under the
eclipse.org web site terms of use.
Comment 6 Szymon Brandys CLA 2012-08-13 05:50:22 EDT
Adding a comment via Commit page should be smarter than just a dialog with bug no and comment. It should help adding comments while reviewing changes.
1) the commit number or even url should be added automatically to the comment
2) when we review a change in the commit, we should be able to add comments just per this change. Then all comments will be aggregated into one Bugzilla comment, for instance:

commit [commit name] or commit url [commit url]

[General comment]

- bundles/org.eclipse.orion.client.core/web/orion/commands.js

[comment for change 1]

- bundles/org.eclipse.orion.client.core/web/orion/something.js

[comment for change 2]

etc.

3) when comment is added we should have indicator for that, maybe just part of the comment should be visible...
4) comment handlers should be pluggable. For now I would imagine that comment handler definition would contain:
- bugzilla url e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=[bug no]
- bugzilla query for updating comment https://bugs.eclipse.org/bugs/process_bug.cgi?id=[bug no]&comment=[comment]
- name

From now devs would need to add bugzilla url to commit comment. It would be used to find the right comment handler. If there is no such url, reviewer would need to select from the list of available comment handlers.

That's just an idea. Let me know what you think.
Comment 7 Szymon Brandys CLA 2012-08-13 05:52:01 EDT
> From now devs would need to add bugzilla url to commit comment. It would be used
> to find the right comment handler.

Maybe we should add bug/issue url field to the commit dialog?
Comment 8 Edyta Przymus CLA 2012-08-13 12:58:12 EDT
Comment generated from Orion about commit a4bd96634b2f5cbd0405f27e9888b50b77d7450cbundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.jsComment about the changebundles/org.eclipse.orion.client.git/web/orion/git/widgets/ConfirmPushDialog.jsbundles/org.eclipse.orion.client.git/web/orion/git/widgets/RemotePrompterDialog.jsbundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ConfirmPushDialog.html
Comment 9 Edyta Przymus CLA 2012-08-13 13:42:25 EDT
Comment generated from Orion about commit a4bd96634b2f5cbd0405f27e9888b50b77d7450cgeneral commentbundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.jsDetailed comment
Comment 10 Edyta Przymus CLA 2012-08-13 13:44:53 EDT
Comment generated from Orion about commit a4bd96634b2f5cbd0405f27e9888b50b77d7450c
General commentbundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
Detailed comment1
bundles/org.eclipse.orion.client.git/web/orion/git/widgets/RemotePrompterDialog.js
Detailed comment2
Comment 11 Edyta Przymus CLA 2012-08-13 13:46:17 EDT
Comment generated from Orion about commit a4bd96634b2f5cbd0405f27e9888b50b77d7450c
General comment about commit

bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ConfirmPushDialog.js
Detailed comment about changed file

bundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ConfirmPushDialog.html
Detailed comment about changed file
Comment 12 Edyta Przymus CLA 2012-08-13 14:01:08 EDT
Created attachment 219822 [details]
General comment + detailed comments about files
Comment 13 Edyta Przymus CLA 2012-08-13 14:29:45 EDT
https://github.com/edytaprzymus/orion.client/commit/323c4ef6acad4a58614d0450d7ad63e1e8fe7ae9

This is the solution illustrated by attached screenshot. Is someone able to clean up my "Test comments" - sorry for messing this bug, but I wanted to test my feature.
Comment 14 Szymon Brandys CLA 2012-08-17 09:25:02 EDT
(In reply to comment #12)
> Created attachment 219822 [details]
> General comment + detailed comments about files

I rather meant "Comment" action per each change + "General Comment" at the top. Then clicking "Send Comment" would show you the preview. After clicking "Ok" the comment would be sent to Bugzilla. You would be prompted when leaving the commit page with unsent comments. Something like that....
Comment 15 Edyta Przymus CLA 2012-08-19 13:33:12 EDT
Comment about commit a4bd96634b2f5cbd0405f27e9888b50b77d7450c
General comment

Comment about change bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
comment1

Comment about change bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ConfirmPushDialog.js
comment2
Comment 16 Szymon Brandys CLA 2012-08-20 16:38:41 EDT
Now let's convert it into an Orion plug-in.
Comment 17 Edyta Przymus CLA 2012-08-21 07:02:40 EDT
What does it mean convert it into plugin? Do I have to remove whole  code from orion files and put it into separate file that will be installed as plugin when somebody wants use this feature?
Comment 18 Edyta Przymus CLA 2012-08-22 16:37:21 EDT
Comment about commit a084a08bb7f1cd6fa349ab0cf90d1d52341c674b
general comment

Comment about change bundles/org.eclipse.orion.client.core/LabeledCheckbox.js
detailed comment 1
Comment 19 Edyta Przymus CLA 2012-08-22 16:48:33 EDT
https://github.com/edytaprzymus/orion.client/commit/8610b04696e6273e9819c80da11a5932c87b932a
I created orion service from the code written previously. Please let me know if it's done properly.
Comment 20 Szymon Brandys CLA 2012-08-28 05:46:26 EDT
(In reply to comment #19)
> https://github.com/edytaprzymus/orion.client/commit/8610b04696e6273e9819c80da11a5932c87b932a
> I created orion service from the code written previously. Please let me know if
> it's done properly.

I meant something else. See for instance "orion.navigate.command" extension in https://github.com/szbra/szbra.github.com/blob/master/solutions/exercise2and5-markdown-renderer/markdownPlugin.js
As you see services in plug-ins can not build UIs.

I think our service should look like this:

provider.registerServiceProvider("orion.git.bugzilla", {
  getCommentUrl: function(item) {
    return anchor.href + "#" + item.Location;
  }
}, {
  name: "Eclipse.org Bugzilla",
  id: "org.eclipse.bugzilla.blah",
  pattern:"bugs.eclipse.org?bugNo=[number]"
  }
});

And if this plug-in is available and the commit comment matches the service pattern, we should show comment areas. Then "Post comment" should call "getCommentUrl" to get the url to redirect.
Comment 22 Szymon Brandys CLA 2012-08-30 06:13:33 EDT
(In reply to comment #21)
> http://orion.eclipse.org/git/reviewRequest.html#git@github.com:edytaprzymus/
> orion.client.git_c42363f26a168861b08b69a3d4aa853c8501fd91

Comments:
- all new buttons should be replaced with actions/commands
- the "add comment" url should be returned by the plug-in. I think the service should have a method that gets the bug url/number + comments to add and returns the url to redirect

We need also to address the case when there is "Bug XXX" in the comment and no bug url. Maybe we should have an extra field in the service with a list of optional patterns. Then if we can't find a service using the primary pattern, we will try to scan the comment for optional patterns. Then on Post Comment, Orion would ask which service you should use.

Example:
service1 = {pattern:bugs.eclipse.org?bugId=[no]: optionalPattern:Bug [no]}
service2 = {pattern:bugs.orion.org?bugId=[no]: optionalPattern:Bug [no]}

If the commit comment contains bugs.eclipse.org?bugId=12, service1 will be used.
If the commit comment contains Bug 12, you'll be asked where to send the comment on Post Comment.
Comment 23 Szymon Brandys CLA 2012-08-30 06:14:22 EDT
(In reply to comment #22)
And please remove unused files from the commit like gitComments.js. Thanks.
Comment 25 Szymon Brandys CLA 2012-08-31 05:26:29 EDT
Please rebase the branch on top of master.
Comment 28 Szymon Brandys CLA 2012-08-31 06:38:01 EDT
(In reply to comment #27)
> http://orion.eclipse.org/git/reviewRequest.html#git@github.com:edytaprzymus/
> orion.client.git_4aa378c4573d95bf6e5abe8accb7549294c6b9a1

Comments:
- "Post Comment" dialog should just say "You cannot post empty comment. Please add comments for the commit and try again" and there is no need to show bug number, Bugzillaz to choose etc.
- "Ok" on the dialog should be renamed to "Submit" and move to the right as on other dialogs
- Please add padding around the "General comment"
- The list of Bugzillas should contain names, not URLs
- in the service there should be a method to compute "add comment url" instead of "returnUrl", the method should return complete url to redirect
- if there is url in the commit comment, "Post Comment" dialog should show anyway where we are going to post the comment
- the preview on "Post Comment" dialog should be a text area, would be nice if it was expandable
Comment 29 Szymon Brandys CLA 2012-09-03 05:32:58 EDT
Comments to teh latest commit:

> - "Post Comment" dialog should just say "You cannot post empty comment. Please
> add comments for the commit and try again" and there is no need to show bug
> number, Bugzillaz to choose etc.

Show it as a label, not in the text area.

> - in the service there should be a method to compute "add comment url" instead
> of "returnUrl", the method should return complete url to redirect

Not fixed.

Moreover when some comments are added and one is leaving the page, he should get a prompt to confirm he wants to leave the page and abandon comments.
Comment 30 Szymon Brandys CLA 2012-09-03 06:57:23 EDT
(In reply to comment #29)

Moreover you overrode changes made by Maciek in gitCommands.js in addRemoteReviewRequestCommand. Please fix it.
Comment 31 Edyta Przymus CLA 2012-09-04 17:52:10 EDT
http://orion.eclipse.org/git/reviewRequest.html#git@github.com:edytaprzymus/orion.client.git_84edb23b421bdcb6db0b6d0a44d4bb8c21e7c292

Here is the commit rebased on the top of the master. 

I still didn't implement plugin with function - I managed to create these methods, but since they return deffered object there is plenty of work to make this work and sincerely - I am not sure if it's worth it. I create warning when unposted comments exists and changed warning about empty comment to slideout. 

I didn't get whant did you mention about Maciek's changes - I didn't get any conflicts while rebasing.
Comment 32 Szymon Brandys CLA 2012-09-05 04:20:48 EDT
(In reply to comment #31)
> I still didn't implement plugin with function - I managed to create these
> methods, but since they return deffered object there is plenty of work to make
> this work and sincerely - I am not sure if it's worth it.

But I am. Please do.

> I didn't get whant did you mention about Maciek's changes - I didn't get any
> conflicts while rebasing.

See gitCommands.js in your commits (the previous and the latest one) lines 2082, 2159-2168. I'm not sure how you can't see it.
Comment 34 John Arthorne CLA 2015-05-05 14:51:30 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:

https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html