Bug 550986 - [regression] EGit context menu contributions missing in PDE editor for MANIFEST.MF or plugin.xml
Summary: [regression] EGit context menu contributions missing in PDE editor for MANIFE...
Status: CLOSED DUPLICATE of bug 552361
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 4.14 M1   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
: 544274 (view as bug list)
Depends on:
Blocks: 549818
  Show dependency tree
 
Reported: 2019-09-11 15:07 EDT by Lars Vogel CLA
Modified: 2019-10-31 08:08 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2019-09-11 15:07:45 EDT
The "Show Revision information" context menu is not available in the MANIFEST.MF editor. Would be great to have it here.

Similar to Bug 544274 but now the menu entry is gone.
Comment 1 Thomas Wolf CLA 2019-09-12 05:06:47 EDT
What Eclipse version, EGit version? I can't reproduce this. It is available for me.

Also cannot reproduce bug 544274.
Comment 2 Lars Vogel CLA 2019-09-12 05:13:25 EDT
Eclipse SDK
Version: 2019-12 (4.14)
Build id: I20190911-1512
OS: Linux, v.5.0.0-27-generic, x86_64 / gtk 3.24.8
Java version: 12.0.1

Git integration for Eclipse	5.6.0.201909081954	org.eclipse.egit.feature.group	Eclipse EGit
Comment 3 Thomas Wolf CLA 2019-09-12 06:57:55 EDT
Looks like something broke in platform between 2019-09 M2 and 2019-09 RC1.

All with EGit nightly 5.6.0.201909120555:

BROKEN:

* Eclipse SDK 4.14.0.I20190911-1805.
* Eclipse IDE for Eclipse Committers 2019-09 RC1 (4.13.0RC1) 20190905-1130.

GOOD:

* Eclipse IDE for Eclipse Committers 2019-09 M2 (4.13.0M2) 20190808-0907.

In the broken versions, it's not just the "Show Revision Information" that's missing. All EGit items in the Team menu are missing.

On the 4.14 SDK, starting with the Java perspective and then opening the git repositories view, the view doesn't come up in the correct part stack. Should be left, below package explorer, but appears in the bottom stack.

Since I tested on all platforms with the exact same EGit nightly version this appears to be a bug in platform or in PDE introduced between 2019-08-08 and 2019-09-05.

Tests done on OS X 10.12.6, Java 8.
Comment 4 Thomas Wolf CLA 2019-09-12 07:04:59 EDT
Also reproducible with Eclipse IDE for Eclipse Committers 2019-09 RC1 (4.13.0RC1) 20190905-1130 as downloaded, i.e., using EGit 5.5.0.201909041048-rc1. Which is a further indication that something in platform broke, not in EGit.
Comment 5 Thomas Wolf CLA 2019-09-12 08:06:59 EDT
GOOD:

* Eclipse SDK I20190819-0600

BROKEN:

* Eclipse SDK I20190902-1800
* Eclipse SDK I20190826-0415

So the breakage occurred between 2019-08-19 and 2019-08-26.
Comment 6 Thomas Wolf CLA 2019-09-12 08:15:39 EDT
Steps: open a MANIFEST.MF from a project shared with EGit in the PDE manifest editor. Navigate to the MANIFEST.MF tab, open context menu within the editor. Select the "Team" sub-menu.

Expected: Team sub-menu with EGit entries is shown (Commit..., Repository and Advanced sub.menus, Merge Tool (disabled), Create Patch..., Apply Patch..., Ignore, Show in History, Show in Repositories View, Show Revision Information).

Actual: Team sub-menu only has the entries Merge Tool (disabled) and Apply Patch... That's actually the Team menu for an unshared project, minus the "Share Project..." entry.

Note: works as expected in the build.properties tab of the PDE editor.
Comment 7 Paul Pazderski CLA 2019-09-12 08:28:41 EDT
Also does not work in the plugin.xml tab.

That bothered me before but I can't remember if it ever worked.
Comment 8 Thomas Wolf CLA 2019-09-12 08:31:34 EDT
(In reply to Paul Pazderski from comment #7)
> Also does not work in the plugin.xml tab.
> 
> That bothered me before but I can't remember if it ever worked.

It used to. And yes, in the broken versions it also doesn't work in the plugin.xml tab.
Comment 9 Thomas Wolf CLA 2019-09-12 09:17:42 EDT
(In reply to Thomas Wolf from comment #5)
> GOOD:
> 
> * Eclipse SDK I20190819-0600

BROKEN:

* Eclipse SDK Y20190819-0900

So down to a 3-hours window.

Could it be this: https://git.eclipse.org/r/#/c/147881/3/bundles/org.eclipse.ui.workbench/Eclipse+UI/org/eclipse/ui/internal/PopupMenuExtender.java ?
Comment 10 Lars Vogel CLA 2019-09-12 09:37:32 EDT
(In reply to Thomas Wolf from comment #9)
> Could it be this:
> https://git.eclipse.org/r/#/c/147881/3/bundles/org.eclipse.ui.workbench/
> Eclipse+UI/org/eclipse/ui/internal/PopupMenuExtender.java ?

Unfortunately, Rolf is currently in vacation. If you revert that one for your runtime Eclipse does is show up?
Comment 11 Thomas Wolf CLA 2019-09-12 12:08:25 EDT
(In reply to Lars Vogel from comment #10)
> (In reply to Thomas Wolf from comment #9)
> > Could it be this:
> > https://git.eclipse.org/r/#/c/147881/3/bundles/org.eclipse.ui.workbench/
> > Eclipse+UI/org/eclipse/ui/internal/PopupMenuExtender.java ?
> 
> Unfortunately, Rolf is currently in vacation. If you revert that one for
> your runtime Eclipse does is show up?

Yes, reverting https://git.eclipse.org/r/#/c/147881/ fixes the problem. BTW, "Compare With" and "Replace With" contributions are also missing, not just the "Team" contributions.
Comment 12 Lars Vogel CLA 2019-09-13 01:35:28 EDT
Thanks, Thomas for your analysis.

Rolf, can you have a look after your vacation?
Comment 13 Andrey Loskutov CLA 2019-09-18 02:26:50 EDT
This is "must have" for 4.14. I assume we have more issues, not just EGit is affected.

This regression affects *all* multi-page editors: I see that if I patch PDE to show only one MANIFEST.MF source page (and do not show plugin.xml/build.properties), the menu appears.

The reason is that each PopupMenuExtender created for each page in such an editor uses 

this.modelPart = part.getSite().getService(MPart.class);

which resolves to the *same* model for *different* pages.

I'm not an e4 expert, is there any way to get a "model" for the concrete editor page inside a multi-page editor?
Comment 14 Andrey Loskutov CLA 2019-09-18 03:33:42 EDT
(In reply to Andrey Loskutov from comment #13)
> I'm not an e4 expert, is there any way to get a "model" for the concrete
> editor page inside a multi-page editor?

Looks like we don't model this. It looks like all menu contributions from all child parts are attached directly to the model of the parent editor part.

So PopupMenuExtender.createModelFor(id) must consider that it is allowed to create menus with same id's in case of MP editors.
Comment 15 Andrey Loskutov CLA 2019-09-30 09:17:44 EDT
Rolf, do you plan to work on this?
Comment 16 Andrey Loskutov CLA 2019-10-06 04:15:58 EDT
*** Bug 544274 has been marked as a duplicate of this bug. ***
Comment 17 Eclipse Genie CLA 2019-10-06 04:30:03 EDT
New Gerrit change created: https://git.eclipse.org/r/150641
Comment 19 Andrey Loskutov CLA 2019-10-07 08:54:08 EDT
Verified with I20191007-0625
Comment 20 Ed Willink CLA 2019-10-31 07:57:06 EDT
This does not look like the right/complete fix. At any rate it does not resolve the very similar phenomenon reported in

https://www.eclipse.org/forums/index.php/m/1816560/#msg_1816560

reports missing OCL menus in 2019-09.

Debugging the problem reveals that the change at line 161 of PopupMenuExtender.createModelFor from 

    item.getTags().contains("popup")

to

    item.getTags().contains(ContributionsAnalyzer.MC_POPUP)

no longer treats an incoming tags value of "popup:simple.presentation.SimpleEditorID" (as auto-generated by the EMF Model Editor creation) in a way that allows additions to be added.

Reverting the above sub-change solves the problem.

NB the tags value is a list of String so "popup" probably never matched anything.
Comment 21 Andrey Loskutov CLA 2019-10-31 08:08:16 EDT
Ed, try latest nightly build please, the issue you refer is fixed as a part of bug 552361.

*** This bug has been marked as a duplicate of bug 552361 ***